Home
last modified time | relevance | path

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

12345678910>>...12

/frameworks/base/core/tests/coretests/src/android/graphics/
DTypefaceSystemFallbackTest.java97 final Paint paint = new Paint();
98 paint.setTypeface(new Typeface.Builder(am, "fonts/a3em.ttf").build()); in paint.setTypeface()
99 GLYPH_3EM_WIDTH = paint.measureText("a");
100 GLYPH_1EM_WIDTH = paint.measureText("b");
102 paint.setTypeface(new Typeface.Builder(am, "fonts/all2em.ttf").build()); in paint.setTypeface()
103 GLYPH_2EM_WIDTH = paint.measureText("a");
266 final Paint paint = new Paint(); in testBuildSystemFallback_NamedFamily() local
270 paint.setTypeface(sansSerifTypeface); in testBuildSystemFallback_NamedFamily()
271 assertEquals(GLYPH_3EM_WIDTH, paint.measureText("a"), 0.0f); in testBuildSystemFallback_NamedFamily()
272 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/hwui/
DCanvas.cpp37 const Paint& 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 …]
DMinikinUtils.cpp31 minikin::MinikinPaint MinikinUtils::prepareMinikinPaint(const Paint* paint, in prepareMinikinPaint() argument
34 const SkFont& font = paint->getSkFont(); in prepareMinikinPaint()
42 minikinPaint.letterSpacing = paint->getLetterSpacing(); in prepareMinikinPaint()
43 minikinPaint.wordSpacing = paint->getWordSpacing(); in prepareMinikinPaint()
45 minikinPaint.localeListId = paint->getMinikinLocaleListId(); in prepareMinikinPaint()
46 minikinPaint.familyVariant = paint->getFamilyVariant(); in prepareMinikinPaint()
48 minikinPaint.fontFeatureSettings = paint->getFontFeatureSettings(); in prepareMinikinPaint()
52 minikin::Layout MinikinUtils::doLayout(const Paint* paint, minikin::Bidi bidiFlags, in doLayout() argument
57 minikin::MinikinPaint minikinPaint = prepareMinikinPaint(paint, typeface); in doLayout()
62 const minikin::StartHyphenEdit startHyphen = paint->getStartHyphenEdit(); in doLayout()
[all …]
DPaintImpl.cpp35 Paint::Paint(const Paint& paint) in Paint() argument
36 : SkPaint(paint) in Paint()
37 , mFont(paint.mFont) in Paint()
38 , mLooper(paint.mLooper) in Paint()
39 , mLetterSpacing(paint.mLetterSpacing) in Paint()
40 , mWordSpacing(paint.mWordSpacing) in Paint()
41 , mFontFeatureSettings(paint.mFontFeatureSettings) in Paint()
42 , mMinikinLocaleListId(paint.mMinikinLocaleListId) in Paint()
43 , mFamilyVariant(paint.mFamilyVariant) in Paint()
44 , mHyphenEdit(paint.mHyphenEdit) in Paint()
[all …]
DCanvas.h140 uirenderer::CanvasPropertyPaint* paint) = 0;
144 uirenderer::CanvasPropertyPaint* paint) = 0;
165 virtual void restoreUnclippedLayer(int saveCount, const Paint& paint) = 0;
167 … virtual int saveLayer(float left, float top, float right, float bottom, const SkPaint* paint) = 0;
206 virtual void drawPaint(const Paint& paint) = 0;
209 virtual void drawPoint(float x, float y, const Paint& paint) = 0;
210 virtual void drawPoints(const float* points, int floatCount, const Paint& paint) = 0;
212 const Paint& paint) = 0;
213 virtual void drawLines(const float* points, int floatCount, const Paint& paint) = 0;
215 const Paint& paint) = 0;
[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 …]
/frameworks/base/graphics/java/android/graphics/
DBaseCanvas.java103 float sweepAngle, boolean useCenter, @NonNull Paint paint) { in drawArc() argument
104 throwIfHasHwFeaturesInSwMode(paint); in drawArc()
106 useCenter, paint.getNativeInstance()); in drawArc()
110 @NonNull Paint paint) { in drawArc() argument
111 throwIfHasHwFeaturesInSwMode(paint); in drawArc()
113 paint); in drawArc()
120 public void drawBitmap(@NonNull Bitmap bitmap, float left, float top, @Nullable Paint paint) { in drawBitmap() argument
122 throwIfHasHwFeaturesInSwMode(paint); in drawBitmap()
124 paint != null ? paint.getNativeInstance() : 0, mDensity, mScreenDensity, in drawBitmap()
128 public void drawBitmap(@NonNull Bitmap bitmap, @NonNull Matrix matrix, @Nullable Paint paint) { in drawBitmap() argument
[all …]
DBaseRecordingCanvas.java55 float sweepAngle, boolean useCenter, @NonNull Paint paint) { in drawArc() argument
57 useCenter, paint.getNativeInstance()); in drawArc()
62 boolean useCenter, @NonNull Paint paint) { in drawArc() argument
64 paint); in drawArc()
74 @Nullable Paint paint) { in drawBitmap() argument
77 paint != null ? paint.getNativeInstance() : 0, mDensity, mScreenDensity, in drawBitmap()
83 @Nullable Paint paint) { in drawBitmap() argument
85 paint != null ? paint.getNativeInstance() : 0); in drawBitmap()
90 @Nullable Paint paint) { in drawBitmap() argument
95 final long nativePaint = paint == null ? 0 : paint.getNativeInstance(); in drawBitmap()
[all …]
DCanvas.java485 public int saveLayer(@Nullable RectF bounds, @Nullable Paint paint, @Saveflags int saveFlags) { in saveLayer() argument
490 return saveLayer(bounds.left, bounds.top, bounds.right, bounds.bottom, paint, in saveLayer()
520 public int saveLayer(@Nullable RectF bounds, @Nullable Paint paint) { in saveLayer() argument
521 return saveLayer(bounds, paint, ALL_SAVE_FLAG); in saveLayer()
537 public void restoreUnclippedLayer(int saveCount, Paint paint) { in restoreUnclippedLayer() argument
538 nRestoreUnclippedLayer(mNativeCanvasWrapper, saveCount, paint.getNativeInstance()); in restoreUnclippedLayer()
549 public int saveLayer(float left, float top, float right, float bottom, @Nullable Paint paint, in saveLayer() argument
553 paint != null ? paint.getNativeInstance() : 0); in saveLayer()
560 public int saveLayer(float left, float top, float right, float bottom, @Nullable Paint paint) { in saveLayer() argument
561 return saveLayer(left, top, right, bottom, paint, ALL_SAVE_FLAG); in saveLayer()
[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/
DRecordingCanvas.cpp105 SaveLayer(const SkRect* bounds, const SkPaint* paint, const SkImageFilter* backdrop, in SaveLayer()
110 if (paint) { in SaveLayer()
111 this->paint = *paint; in SaveLayer()
117 SkPaint paint; member
121 c->saveLayer({maybe_unset(bounds), &paint, backdrop.get(), flags}); in draw()
201 DrawPaint(const SkPaint& paint) : paint(paint) {} in DrawPaint()
202 SkPaint paint; member
203 void draw(SkCanvas* c, const SkMatrix&) const { c->drawPaint(paint); } in draw()
207 DrawBehind(const SkPaint& paint) : paint(paint) {} in DrawBehind()
208 SkPaint paint; member
[all …]
DCanvasTransform.cpp78 static void applyColorTransform(ColorTransform transform, SkPaint& paint) { in applyColorTransform() argument
81 SkColor newColor = transformColor(transform, paint.getColor()); in applyColorTransform()
82 paint.setColor(newColor); in applyColorTransform()
84 if (paint.getShader()) { in applyColorTransform()
91 SkShader::GradientType type = paint.getShader()->asAGradient(&info); in applyColorTransform()
99 paint.setShader(SkGradientShader::MakeLinear(info.fPoint, info.fColors, in applyColorTransform()
109 if (paint.getColorFilter()) { in applyColorTransform()
113 if (paint.getColorFilter()->asAColorMode(&color, &mode)) { in applyColorTransform()
115 paint.setColorFilter(SkColorFilters::Blend(color, mode)); in applyColorTransform()
126 static BitmapPalette filterPalette(const SkPaint* paint, BitmapPalette palette) { in filterPalette() argument
[all …]
DSkiaCanvas.h78 virtual void restoreUnclippedLayer(int saveCount, const Paint& paint) override;
80 …virtual int saveLayer(float left, float top, float right, float bottom, const SkPaint* paint) over…
107 virtual void drawPaint(const Paint& paint) override;
109 virtual void drawPoint(float x, float y, const Paint& paint) override;
110 virtual void drawPoints(const float* points, int count, const Paint& paint) override;
112 const Paint& paint) override;
113 virtual void drawLines(const float* points, int count, const Paint& paint) override;
115 const Paint& paint) override;
116 virtual void drawRegion(const SkRegion& region, const Paint& paint) override;
118 const Paint& paint) override;
[all …]
/frameworks/base/libs/hwui/canvas/
DCanvasOps.h126 sp<uirenderer::CanvasPropertyPaint> paint;
130 canvas->drawRoundRect(rect, rx->value, ry->value, paint->value);
140 sp<uirenderer::CanvasPropertyPaint> paint;
143 canvas->drawCircle(x->value, y->value, radius->value, paint->value);
168 SkPaint paint;
169 void draw(SkCanvas* canvas) const { canvas->drawPaint(paint); }
177 SkPaint paint;
178 void draw(SkCanvas* canvas) const { canvas->drawPoint(x, y, paint); }
185 SkPaint paint;
192 paint
[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/utils/
DPaintUtils.h35 static bool isOpaquePaint(const SkPaint* paint) { in isOpaquePaint() argument
36 if (!paint) return true; // default (paintless) behavior is SrcOver, black in isOpaquePaint()
38 if (paint->getAlpha() != 0xFF || PaintUtils::isBlendedShader(paint->getShader()) || in isOpaquePaint()
39 PaintUtils::isBlendedColorFilter(paint->getColorFilter())) { in isOpaquePaint()
44 const auto mode = paint->asBlendMode(); in isOpaquePaint()
54 static inline SkBlendMode getBlendModeDirect(const SkPaint* paint) { in getBlendModeDirect() argument
55 return paint ? paint->getBlendMode_or(SkBlendMode::kSrcOver) : SkBlendMode::kSrcOver; in getBlendModeDirect()
58 static inline int getAlphaDirect(const SkPaint* paint) { in getAlphaDirect() argument
59 return paint ? paint->getAlpha() : 255; in getAlphaDirect()
/frameworks/minikin/tests/unittest/
DFontFeatureTest.cpp55 auto paint = MinikinPaint(font); in TEST_F() local
56 paint.fontFeatureSettings = "\"chws\" off"; in TEST_F()
58 auto f = cleanAndAddDefaultFontFeatures(paint); in TEST_F()
67 auto paint = MinikinPaint(font); in TEST_F() local
68 paint.fontFeatureSettings = "\"ruby\" on"; in TEST_F()
70 auto f = cleanAndAddDefaultFontFeatures(paint); in TEST_F()
81 auto paint = MinikinPaint(font); in TEST_F() local
82 paint.letterSpacing = 1.0; // em in TEST_F()
84 auto f = cleanAndAddDefaultFontFeatures(paint); in TEST_F()
97 auto paint = MinikinPaint(font); in TEST_F() local
[all …]
DLayoutTest.cpp39 static void getBounds(const U16StringPiece& text, Bidi bidiFlags, const MinikinPaint& paint, in getBounds() argument
41 getBounds(text, Range(0, text.size()), bidiFlags, paint, StartHyphenEdit::NO_EDIT, in getBounds()
59 MinikinPaint paint(mCollection); in TEST_F() local
60 paint.size = 10.0f; // make 1em = 10px in TEST_F()
71 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
75 getBounds(text, Bidi::LTR, paint, &rect); in TEST_F()
90 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
94 getBounds(text, Bidi::LTR, paint, &rect); in TEST_F()
109 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
113 getBounds(text, Bidi::LTR, paint, &rect); in TEST_F()
[all …]
/frameworks/base/tests/SilkFX/src/com/android/test/silkfx/hdr/
DGlowingCard.kt52 val paint = Paint() in onDraw() constant
53 paint.isAntiAlias = true in onDraw()
59 paint.setColor(Color.pack(2f, 2f, 2f, 1f, scRGB)) in onDraw()
60 paint.strokeWidth = 4.dp() in onDraw()
61 paint.style = Paint.Style.FILL in onDraw()
62 paint.shader = LinearGradient(rect.left, rect.bottom, rect.right, rect.top, in onDraw()
66 canvas.drawRoundRect(rect, radius, radius, paint) in onDraw()
71 paint.setColor(Color.pack(.14f, .14f, .14f, .8f, scRGB)) in onDraw()
72 paint.style = Paint.Style.FILL in onDraw()
73 paint.shader = null in onDraw()
[all …]
DRadialGlow.kt59 val paint = Paint() in onDraw() constant
60 paint.isDither = true in onDraw()
61 paint.isAntiAlias = true in onDraw()
62 paint.textSize = 18.dp() in onDraw()
63 paint.textAlign = Paint.Align.CENTER in onDraw()
67 paint.setColor(bgColor) in onDraw()
68 canvas.drawRoundRect(rect, radius, radius, paint) in onDraw()
71 paint.shader = glow in onDraw()
75 canvas.drawPaint(paint) in onDraw()
77 paint.shader = null in onDraw()
[all …]
/frameworks/base/libs/hwui/tests/common/scenes/
DShapeAnimation.cpp34 [](Canvas& canvas, float size, const Paint& paint) { in createContent()
35 canvas.drawArc(0, 0, size, size, 50, 189, true, paint); in createContent()
37 [](Canvas& canvas, float size, const Paint& paint) { in createContent()
38 canvas.drawOval(0, 0, size, size, paint); in createContent()
40 [](Canvas& canvas, float size, const Paint& paint) { in createContent()
47 canvas.drawPath(diamondPath, paint); in createContent()
49 [](Canvas& canvas, float size, const Paint& paint) { in createContent()
51 canvas.drawLines(data, sizeof(data) / sizeof(float), paint); in createContent()
53 [](Canvas& canvas, float size, const Paint& 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.java57 public static BoringLayout make(CharSequence source, TextPaint paint, int outerWidth, in make() argument
60 return new BoringLayout(source, paint, outerWidth, align, spacingMult, spacingAdd, metrics, in make()
83 public static BoringLayout make(CharSequence source, TextPaint paint, int outerWidth, in make() argument
86 return new BoringLayout(source, paint, outerWidth, align, spacingmult, spacingadd, metrics, in make()
116 @NonNull CharSequence source, @NonNull TextPaint paint, in make() argument
121 return new BoringLayout(source, paint, outerWidth, align, 1f, 0f, metrics, includePad, in make()
141 public BoringLayout replaceOrMake(CharSequence source, TextPaint paint, int outerwidth, in replaceOrMake() argument
144 replaceWith(source, paint, outerwidth, align, spacingMult, spacingAdd); in replaceOrMake()
151 init(source, paint, align, metrics, includePad, true, false /* useFallbackLineSpacing */); in replaceOrMake()
183 @NonNull TextPaint paint, @IntRange(from = 0) int outerWidth, in replaceOrMake() argument
[all …]
/frameworks/base/libs/hwui/tests/common/
DCallCountingCanvas.h45 void onDrawPaint(const SkPaint& paint) override { in onDrawPaint() argument
55 void onDrawRect(const SkRect& rect, const SkPaint& paint) override { in onDrawRect() argument
60 void onDrawRRect(const SkRRect& rrect, const SkPaint& paint) override { in onDrawRRect() argument
66 const SkPaint& paint) override { in onDrawDRRect() argument
71 void onDrawOval(const SkRect& rect, const SkPaint& paint) override { in onDrawOval() argument
77 const SkPaint& paint) override { in onDrawArc() argument
82 void onDrawPath(const SkPath& path, const SkPaint& paint) override { in onDrawPath() argument
87 void onDrawRegion(const SkRegion& region, const SkPaint& paint) override { in onDrawRegion() argument
93 const SkPaint& paint) override { in onDrawTextBlob() argument
100 const SkPaint& paint) override { in onDrawPatch() argument
[all …]

12345678910>>...12