Home
last modified time | relevance | path

Searched refs:paint (Results 1 – 25 of 246) sorted by relevance

12345678910

/frameworks/base/core/tests/coretests/src/android/graphics/
DTypefaceSystemFallbackTest.java93 final Paint paint = new Paint();
94 paint.setTypeface(new Typeface.Builder(am, "fonts/a3em.ttf").build()); in paint.setTypeface()
95 GLYPH_3EM_WIDTH = paint.measureText("a");
96 GLYPH_1EM_WIDTH = paint.measureText("b");
98 paint.setTypeface(new Typeface.Builder(am, "fonts/all2em.ttf").build()); in paint.setTypeface()
99 GLYPH_2EM_WIDTH = paint.measureText("a");
225 final Paint paint = new Paint(); in testBuildSystemFallback_NamedFamily() local
229 paint.setTypeface(sansSerifTypeface); in testBuildSystemFallback_NamedFamily()
230 assertEquals(GLYPH_3EM_WIDTH, paint.measureText("a"), 0.0f); in testBuildSystemFallback_NamedFamily()
231 assertEquals(GLYPH_1EM_WIDTH, paint.measureText("b"), 0.0f); in testBuildSystemFallback_NamedFamily()
[all …]
/frameworks/base/tests/CanvasCompare/src/com/android/test/hwuicompare/
DDisplayModifier.java40 abstract public void modifyDrawing(Paint paint, Canvas canvas); in modifyDrawing() argument
85 public void modifyDrawing(Paint paint, Canvas canvas) {
86 paint.setAntiAlias(true);
91 public void modifyDrawing(Paint paint, Canvas canvas) {
92 paint.setAntiAlias(false);
101 public void modifyDrawing(Paint paint, Canvas canvas) {
102 paint.setStyle(Paint.Style.FILL);
107 public void modifyDrawing(Paint paint, Canvas canvas) {
108 paint.setStyle(Paint.Style.STROKE);
115 public void modifyDrawing(Paint paint, Canvas canvas) {
[all …]
/frameworks/base/libs/hwui/
DRecordingCanvas.cpp97 SaveLayer(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop, in SaveLayer()
102 if (paint) { in SaveLayer()
103 this->paint = *paint; in SaveLayer()
111 SkPaint paint; member
117 c->saveLayer({maybe_unset(bounds), &paint, backdrop.get(), clipMask.get(), in draw()
187 DrawPaint(const SkPaint& paint) : paint(paint) {} in DrawPaint()
188 SkPaint paint; member
189 void draw(SkCanvas* c, const SkMatrix&) const { c->drawPaint(paint); } in draw()
193 DrawBehind(const SkPaint& paint) : paint(paint) {} in DrawBehind()
194 SkPaint paint; member
[all …]
DCanvasTransform.cpp68 static void applyColorTransform(ColorTransform transform, SkPaint& paint) { in applyColorTransform() argument
71 SkColor newColor = transformColor(transform, paint.getColor()); in applyColorTransform()
72 paint.setColor(newColor); in applyColorTransform()
74 if (paint.getShader()) { in applyColorTransform()
81 SkShader::GradientType type = paint.getShader()->asAGradient(&info); in applyColorTransform()
89 paint.setShader(SkGradientShader::MakeLinear(info.fPoint, info.fColors, in applyColorTransform()
99 if (paint.getColorFilter()) { in applyColorTransform()
103 if (paint.getColorFilter()->asColorMode(&color, &mode)) { in applyColorTransform()
105 paint.setColorFilter(SkColorFilter::MakeModeFilter(color, mode)); in applyColorTransform()
116 static BitmapPalette filterPalette(const SkPaint* paint, BitmapPalette palette) { in filterPalette() argument
[all …]
DSkiaCanvas.cpp172 int SkiaCanvas::saveLayer(float left, float top, float right, float bottom, const SkPaint* paint, in saveLayer() argument
175 const SkCanvas::SaveLayerRec rec(&bounds, paint, layerFlags(flags)); in saveLayer()
195 void SkiaCanvas::restoreUnclippedLayer(int restoreCount, const SkPaint& paint) { in restoreUnclippedLayer() argument
202 SkCanvasPriv::DrawBehind(mCanvas, *filterPaint(paint)); in restoreUnclippedLayer()
442 SkiaCanvas::PaintCoW&& SkiaCanvas::filterPaint(PaintCoW&& paint) const { in filterPaint()
444 mPaintFilter->filter(&paint.writeable()); in filterPaint()
446 return std::move(paint); in filterPaint()
449 void SkiaCanvas::drawPaint(const SkPaint& paint) { in drawPaint() argument
450 mCanvas->drawPaint(*filterPaint(paint)); in drawPaint()
457 void SkiaCanvas::drawPoints(const float* points, int count, const SkPaint& paint, in drawPoints() argument
[all …]
DSkiaCanvas.h72 virtual void restoreUnclippedLayer(int saveCount, const SkPaint& paint) override;
74 virtual int saveLayer(float left, float top, float right, float bottom, const SkPaint* paint,
100 virtual void drawPaint(const SkPaint& paint) override;
102 virtual void drawPoint(float x, float y, const SkPaint& paint) override;
103 virtual void drawPoints(const float* points, int count, const SkPaint& paint) override;
105 const SkPaint& paint) override;
106 virtual void drawLines(const float* points, int count, const SkPaint& paint) override;
108 const SkPaint& paint) override;
109 virtual void drawRegion(const SkRegion& region, const SkPaint& paint) override;
111 const SkPaint& paint) override;
[all …]
/frameworks/base/graphics/java/android/graphics/
DBaseCanvas.java95 float sweepAngle, boolean useCenter, @NonNull Paint paint) { in drawArc() argument
96 throwIfHasHwBitmapInSwMode(paint); in drawArc()
98 useCenter, paint.getNativeInstance()); in drawArc()
102 @NonNull Paint paint) { in drawArc() argument
103 throwIfHasHwBitmapInSwMode(paint); in drawArc()
105 paint); in drawArc()
112 public void drawBitmap(@NonNull Bitmap bitmap, float left, float top, @Nullable Paint paint) { in drawBitmap() argument
114 throwIfHasHwBitmapInSwMode(paint); in drawBitmap()
116 paint != null ? paint.getNativeInstance() : 0, mDensity, mScreenDensity, in drawBitmap()
120 public void drawBitmap(@NonNull Bitmap bitmap, @NonNull Matrix matrix, @Nullable Paint paint) { in drawBitmap() argument
[all …]
DBaseRecordingCanvas.java49 float sweepAngle, boolean useCenter, @NonNull Paint paint) { in drawArc() argument
51 useCenter, paint.getNativeInstance()); in drawArc()
56 boolean useCenter, @NonNull Paint paint) { in drawArc() argument
58 paint); in drawArc()
68 @Nullable Paint paint) { in drawBitmap() argument
71 paint != null ? paint.getNativeInstance() : 0, mDensity, mScreenDensity, in drawBitmap()
77 @Nullable Paint paint) { in drawBitmap() argument
79 paint != null ? paint.getNativeInstance() : 0); in drawBitmap()
84 @Nullable Paint paint) { in drawBitmap() argument
89 final long nativePaint = paint == null ? 0 : paint.getNativeInstance(); in drawBitmap()
[all …]
DCanvas.java515 public int saveLayer(@Nullable RectF bounds, @Nullable Paint paint, @Saveflags int saveFlags) { in saveLayer() argument
520 return saveLayer(bounds.left, bounds.top, bounds.right, bounds.bottom, paint, in saveLayer()
550 public int saveLayer(@Nullable RectF bounds, @Nullable Paint paint) { in saveLayer() argument
551 return saveLayer(bounds, paint, ALL_SAVE_FLAG); in saveLayer()
567 public void restoreUnclippedLayer(int saveCount, Paint paint) { in restoreUnclippedLayer() argument
568 nRestoreUnclippedLayer(mNativeCanvasWrapper, saveCount, paint.getNativeInstance()); in restoreUnclippedLayer()
579 public int saveLayer(float left, float top, float right, float bottom, @Nullable Paint paint, in saveLayer() argument
583 paint != null ? paint.getNativeInstance() : 0, in saveLayer()
591 public int saveLayer(float left, float top, float right, float bottom, @Nullable Paint paint) { in saveLayer() argument
592 return saveLayer(left, top, right, bottom, paint, ALL_SAVE_FLAG); in saveLayer()
[all …]
/frameworks/base/core/tests/coretests/src/android/text/
DTextLineTest.java47 final TextPaint paint = new TextPaint(); in stretchesToFullWidth() local
49 tl.set(paint, line, 0, line.length(), Layout.DIR_LEFT_TO_RIGHT, in stretchesToFullWidth()
100 private TextLine getTextLine(String str, TextPaint paint, TabStops tabStops) { in getTextLine() argument
102 StaticLayout.Builder.obtain(str, 0, str.length(), paint, Integer.MAX_VALUE) in getTextLine()
105 tl.set(paint, str, 0, str.length(), in getTextLine()
112 private TextLine getTextLine(String str, TextPaint paint) { in getTextLine() argument
113 return getTextLine(str, paint, null); in getTextLine()
130 final TextPaint paint = new TextPaint(); in testMeasure_LTR() local
131 paint.setTypeface(TYPEFACE); in testMeasure_LTR()
132 paint.setTextSize(10.0f); // make 1em = 10px in testMeasure_LTR()
[all …]
DStaticLayoutTest.java107 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testGetters1()
134 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testLineMetrics_withPadding()
150 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testLineMetrics_withPaddingAndWidth()
170 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testLineMetrics_withThreeLines()
192 b.paint.setTextSize(36); in testLineMetrics_withLargeText()
193 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testLineMetrics_withLargeText()
223 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testLineMetrics_withSpacingAdd()
246 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testLineMetrics_withSpacingMult()
272 FontMetricsInt fmi = b.paint.getFontMetricsInt(); in testLineMetrics_withUnitIntervalSpacingMult()
328 TextPaint paint = new TextPaint(); // default field in StaticLayoutTest.LayoutBuilder
[all …]
/frameworks/base/libs/hwui/utils/
DPaintUtils.h36 static inline GLenum getFilter(const SkPaint* paint) { in getFilter() argument
37 if (!paint || paint->getFilterQuality() != kNone_SkFilterQuality) { in getFilter()
43 static bool isOpaquePaint(const SkPaint* paint) { in isOpaquePaint() argument
44 if (!paint) return true; // default (paintless) behavior is SrcOver, black in isOpaquePaint()
46 if (paint->getAlpha() != 0xFF || PaintUtils::isBlendedShader(paint->getShader()) || in isOpaquePaint()
47 PaintUtils::isBlendedColorFilter(paint->getColorFilter())) { in isOpaquePaint()
52 SkBlendMode mode = paint->getBlendMode(); in isOpaquePaint()
77 static inline bool getTextShadow(const SkPaint* paint, TextShadow* textShadow) { in getTextShadow() argument
79 if (paint && paint->getLooper() && paint->getLooper()->asABlurShadow(&blur)) { in getTextShadow()
91 static inline bool hasTextShadow(const SkPaint* paint) { return getTextShadow(paint, nullptr); } in hasTextShadow() argument
[all …]
/frameworks/layoutlib/bridge/src/com/android/layoutlib/bridge/android/graphics/
DNopCanvas.java59 public int saveLayer(RectF bounds, Paint paint, int saveFlags) { in saveLayer() argument
64 public int saveLayer(RectF bounds, Paint paint) { in saveLayer() argument
69 public int saveLayer(float left, float top, float right, float bottom, Paint paint, in saveLayer() argument
75 public int saveLayer(float left, float top, float right, float bottom, Paint paint) { in saveLayer() argument
130 public void drawPaint(Paint paint) { in drawPaint() argument
134 public void drawPoints(float[] pts, int offset, int count, Paint paint) { in drawPoints() argument
138 public void drawPoints(float[] pts, Paint paint) { in drawPoints() argument
142 public void drawPoint(float x, float y, Paint paint) { in drawPoint() argument
146 public void drawLine(float startX, float startY, float stopX, float stopY, Paint paint) { in drawLine() argument
150 public void drawLines(float[] pts, int offset, int count, Paint paint) { in drawLines() argument
[all …]
/frameworks/base/libs/hwui/hwui/
DCanvas.cpp37 const SkPaint& paint, Canvas* canvas) { in drawStroke() argument
40 canvas->drawRect(left, top, right, bottom, paint); in drawStroke()
43 void Canvas::drawTextDecorations(float x, float y, float length, const Paint& paint) { in drawTextDecorations() argument
45 const bool strikeThru = paint.isStrikeThru(); in drawTextDecorations()
46 const bool underline = paint.isUnderline(); in drawTextDecorations()
50 const float textSize = paint.getSkFont().getSize(); in drawTextDecorations()
53 paint.getSkFont().getMetrics(&metrics); in drawTextDecorations()
63 drawStroke(left, right, top, thickness, paint, this); in drawTextDecorations()
69 drawStroke(left, right, top, thickness, paint, this); in drawTextDecorations()
74 static void simplifyPaint(int color, Paint* paint) { in simplifyPaint() argument
[all …]
DPaintImpl.cpp34 Paint::Paint(const Paint& paint) in Paint() argument
35 : SkPaint(paint) in Paint()
36 , mFont(paint.mFont) in Paint()
37 , mLetterSpacing(paint.mLetterSpacing) in Paint()
38 , mWordSpacing(paint.mWordSpacing) in Paint()
39 , mFontFeatureSettings(paint.mFontFeatureSettings) in Paint()
40 , mMinikinLocaleListId(paint.mMinikinLocaleListId) in Paint()
41 , mFamilyVariant(paint.mFamilyVariant) in Paint()
42 , mHyphenEdit(paint.mHyphenEdit) in Paint()
43 , mTypeface(paint.mTypeface) in Paint()
[all …]
DMinikinUtils.cpp30 minikin::MinikinPaint MinikinUtils::prepareMinikinPaint(const Paint* paint, in prepareMinikinPaint() argument
33 const SkFont& font = paint->getSkFont(); in prepareMinikinPaint()
41 minikinPaint.letterSpacing = paint->getLetterSpacing(); in prepareMinikinPaint()
42 minikinPaint.wordSpacing = paint->getWordSpacing(); in prepareMinikinPaint()
44 minikinPaint.localeListId = paint->getMinikinLocaleListId(); in prepareMinikinPaint()
45 minikinPaint.familyVariant = paint->getFamilyVariant(); in prepareMinikinPaint()
47 minikinPaint.fontFeatureSettings = paint->getFontFeatureSettings(); in prepareMinikinPaint()
51 minikin::Layout MinikinUtils::doLayout(const Paint* paint, minikin::Bidi bidiFlags, in doLayout() argument
56 minikin::MinikinPaint minikinPaint = prepareMinikinPaint(paint, typeface); in doLayout()
61 const minikin::StartHyphenEdit startHyphen = paint->getStartHyphenEdit(); in doLayout()
[all …]
DCanvas.h171 uirenderer::CanvasPropertyPaint* paint) = 0;
175 uirenderer::CanvasPropertyPaint* paint) = 0;
194 virtual void restoreUnclippedLayer(int saveCount, const SkPaint& paint) = 0;
196 virtual int saveLayer(float left, float top, float right, float bottom, const SkPaint* paint,
231 virtual void drawPaint(const SkPaint& paint) = 0;
234 virtual void drawPoint(float x, float y, const SkPaint& paint) = 0;
235 virtual void drawPoints(const float* points, int floatCount, const SkPaint& paint) = 0;
237 const SkPaint& paint) = 0;
238 virtual void drawLines(const float* points, int floatCount, const SkPaint& paint) = 0;
240 const SkPaint& paint) = 0;
[all …]
/frameworks/base/tests/HwAccelerationTest/src/com/android/test/hwui/
DGradientStopsActivity.java50 Paint paint = new Paint(); in onDraw() local
51 paint.setShader(gradient); in onDraw()
53 canvas.drawRect(0.0f, 0.0f, 256.0f, 50.0f, paint); in onDraw()
60 paint.setShader(gradient); in onDraw()
63 canvas.drawRect(0.0f, 0.0f, 256.0f, 50.0f, paint); in onDraw()
70 paint.setShader(gradient); in onDraw()
73 canvas.drawRect(0.0f, 0.0f, 256.0f, 50.0f, paint); in onDraw()
79 paint.setShader(gradient); in onDraw()
82 canvas.drawRect(0.0f, 0.0f, 256.0f, 50.0f, paint); in onDraw()
87 paint.setShader(gradient); in onDraw()
[all …]
/frameworks/base/libs/hwui/tests/common/scenes/
DShapeAnimation.cpp34 [](Canvas& canvas, float size, const SkPaint& paint) { in createContent()
35 canvas.drawArc(0, 0, size, size, 50, 189, true, paint); in createContent()
37 [](Canvas& canvas, float size, const SkPaint& paint) { in createContent()
38 canvas.drawOval(0, 0, size, size, paint); in createContent()
40 [](Canvas& canvas, float size, const SkPaint& paint) { in createContent()
47 canvas.drawPath(diamondPath, paint); in createContent()
49 [](Canvas& canvas, float size, const SkPaint& paint) { in createContent()
51 canvas.drawLines(data, sizeof(data) / sizeof(float), paint); in createContent()
53 [](Canvas& canvas, float size, const SkPaint& paint) { in createContent()
55 canvas.drawPoints(data, sizeof(data) / sizeof(float), paint); in createContent()
[all …]
/frameworks/minikin/include/minikin/
DMinikinPaint.h76 void copyFrom(const MinikinPaint& paint) { *this = paint; } in copyFrom()
84 inline bool operator==(const MinikinPaint& paint) const {
85 return size == paint.size && scaleX == paint.scaleX && skewX == paint.skewX &&
86 letterSpacing == paint.letterSpacing && wordSpacing == paint.wordSpacing &&
87 fontFlags == paint.fontFlags && localeListId == paint.localeListId &&
88 fontStyle == paint.fontStyle && familyVariant == paint.familyVariant &&
89 fontFeatureSettings == paint.fontFeatureSettings && font.get() == paint.font.get();
/frameworks/base/core/java/android/text/
DBoringLayout.java54 public static BoringLayout make(CharSequence source, TextPaint paint, int outerWidth, in make() argument
57 return new BoringLayout(source, paint, outerWidth, align, spacingMult, spacingAdd, metrics, in make()
80 public static BoringLayout make(CharSequence source, TextPaint paint, int outerWidth, in make() argument
83 return new BoringLayout(source, paint, outerWidth, align, spacingmult, spacingadd, metrics, in make()
103 public BoringLayout replaceOrMake(CharSequence source, TextPaint paint, int outerwidth, in replaceOrMake() argument
106 replaceWith(source, paint, outerwidth, align, spacingMult, spacingAdd); in replaceOrMake()
112 init(source, paint, align, metrics, includePad, true); in replaceOrMake()
137 public BoringLayout replaceOrMake(CharSequence source, TextPaint paint, int outerWidth, in replaceOrMake() argument
143 replaceWith(source, paint, outerWidth, align, spacingMult, spacingAdd); in replaceOrMake()
150 replaceWith(TextUtils.ellipsize(source, paint, ellipsizedWidth, ellipsize, true, this), in replaceOrMake()
[all …]
/frameworks/base/core/jni/android/graphics/
DPaint.cpp97 static void deletePaint(Paint* paint) { in deletePaint() argument
98 delete paint; in deletePaint()
110 Paint* paint = reinterpret_cast<Paint*>(paintHandle); in initWithPaint() local
111 Paint* obj = new Paint(*paint); in initWithPaint()
115 static int breakText(JNIEnv* env, const Paint& paint, const Typeface* typeface, in breakText() argument
122 MinikinUtils::measureText(&paint, static_cast<minikin::Bidi>(bidiFlags), typeface, text, in breakText()
151 Paint* paint = reinterpret_cast<Paint*>(paintHandle); in breakTextC() local
152 const Typeface* typeface = paint->getAndroidTypeface(); in breakTextC()
169 count = breakText(env, *paint, typeface, text + index, count, maxWidth, in breakTextC()
180 Paint* paint = reinterpret_cast<Paint*>(paintHandle); in breakTextS() local
[all …]
/frameworks/opt/setupwizard/library/recyclerview/test/instrumentation/src/com/android/setupwizardlib/test/
DDividerItemDecorationTest.java74 Paint paint = new Paint(); in testShouldDrawDividerBelowWithEitherCondition() local
75 paint.setColor(Color.RED); in testShouldDrawDividerBelowWithEitherCondition()
76 expectedCanvas.drawRect(0, 5, 20, 6, paint); in testShouldDrawDividerBelowWithEitherCondition()
77 expectedCanvas.drawRect(0, 10, 20, 11, paint); in testShouldDrawDividerBelowWithEitherCondition()
78 expectedCanvas.drawRect(0, 15, 20, 16, paint); in testShouldDrawDividerBelowWithEitherCondition()
90 paint.setColor(Color.TRANSPARENT); in testShouldDrawDividerBelowWithEitherCondition()
91 paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); in testShouldDrawDividerBelowWithEitherCondition()
92 expectedCanvas.drawRect(0, 15, 20, 16, paint); in testShouldDrawDividerBelowWithEitherCondition()
98 expectedCanvas.drawRect(0, 5, 20, 6, paint); in testShouldDrawDividerBelowWithEitherCondition()
99 expectedCanvas.drawRect(0, 10, 20, 11, paint); in testShouldDrawDividerBelowWithEitherCondition()
[all …]
/frameworks/minikin/tests/unittest/
DLayoutTest.cpp52 MinikinPaint paint(mCollection); in TEST_F() local
53 paint.size = 10.0f; // make 1em = 10px in TEST_F()
64 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
82 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
100 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
118 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
135 MinikinPaint paint(mCollection); in TEST_F() local
136 paint.size = 10.0f; // make 1em = 10px in TEST_F()
141 paint.wordSpacing = 5.0f; in TEST_F()
148 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
[all …]
/frameworks/base/core/jni/
Dandroid_graphics_Canvas.cpp94 Paint* paint = reinterpret_cast<Paint*>(paintHandle); in saveLayer() local
96 return static_cast<jint>(get_canvas(canvasHandle)->saveLayer(l, t, r, b, paint, flags)); in saveLayer()
110 Paint* paint = reinterpret_cast<Paint*>(paintHandle); in restoreUnclippedLayer() local
111 get_canvas(canvasHandle)->restoreUnclippedLayer(saveCount, *paint); in restoreUnclippedLayer()
243 Paint* paint = reinterpret_cast<Paint*>(paintHandle); in drawPaint() local
244 get_canvas(canvasHandle)->drawPaint(*paint); in drawPaint()
249 const Paint* paint = reinterpret_cast<Paint*>(paintHandle); in drawPoint() local
250 get_canvas(canvasHandle)->drawPoint(x, y, *paint); in drawPoint()
265 const Paint* paint = reinterpret_cast<Paint*>(paintHandle); in drawPoints() local
266 get_canvas(canvasHandle)->drawPoints(floats + offset, count, *paint); in drawPoints()
[all …]

12345678910