Home
last modified time | relevance | path

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

12345

/cts/tests/tests/text/src/android/text/cts/
DPaintRunFlagTest.kt44 private fun assertSame_measureText_Result(text: String, start: Int, end: Int, paint: Paint) { in assertSame_measureText_Result()
49 paint.flags = paint.flags and Paint.TEXT_RUN_FLAG_LEFT_EDGE.inv() in assertSame_measureText_Result()
50 paint.flags = paint.flags and Paint.TEXT_RUN_FLAG_RIGHT_EDGE.inv() in assertSame_measureText_Result()
51 val measureTextStringNoFlag = paint.measureText(text, start, end) in assertSame_measureText_Result()
52 val measureTextCharSequenceNoFlag = paint.measureText(SpannedString(text), start, end) in assertSame_measureText_Result()
53 val measureTextCharArrayNoFlag = paint.measureText(charArray, start, end - start) in assertSame_measureText_Result()
56 paint.flags = paint.flags or Paint.TEXT_RUN_FLAG_LEFT_EDGE in assertSame_measureText_Result()
57 paint.flags = paint.flags and Paint.TEXT_RUN_FLAG_RIGHT_EDGE.inv() in assertSame_measureText_Result()
58 val measureTextStringLeft = paint.measureText(text, start, end) in assertSame_measureText_Result()
59 val measureTextCharSequenceLeft = paint.measureText(SpannedString(text), start, end) in assertSame_measureText_Result()
[all …]
DTextShaperTest.java54 private List<Pair<PositionedGlyphs, TextPaint>> shapeText(CharSequence text, TextPaint paint) { in shapeText() argument
56 TextShaper.shapeText(text, 0, text.length(), TextDirectionHeuristics.LTR, paint, in shapeText()
66 TextPaint paint = new TextPaint(); in shapeText_noStyle() local
67 paint.setTextSize(100f); in shapeText_noStyle()
72 List<Pair<PositionedGlyphs, TextPaint>> glyphs = shapeText(text, paint); in shapeText_noStyle()
75 paint); in shapeText_noStyle()
86 TextPaint paint = new TextPaint(); in shapeText_multiStyle() local
87 paint.setTextSize(100f); in shapeText_multiStyle()
95 List<Pair<PositionedGlyphs, TextPaint>> result = shapeText(text, paint); in shapeText_multiStyle()
117 public void assertSameDrawResult(CharSequence text, TextPaint paint, in assertSameDrawResult() argument
[all …]
DTextRunAdvancesTest.java38 Paint paint = new Paint(); in getPaint() local
42 paint.setTypeface(typeface); in getPaint()
43 paint.setTextSize(10f); // Make 1em = 10px in getPaint()
44 return paint; in getPaint()
49 final Paint paint = getPaint(); in testGetRunCharacterAdvance() local
53 final float advance = paint.getRunCharacterAdvance(text, 1, 3, 0, text.length, in testGetRunCharacterAdvance()
63 final Paint paint = getPaint(); in testGetRunCharacterAdvance_charSequence() local
67 final float advance = paint.getRunCharacterAdvance(text, 0, text.length(), 0, in testGetRunCharacterAdvance_charSequence()
75 final Paint paint = getPaint(); in testGetRunCharacterAdvance_LTR() local
79 final float advance = paint.getRunCharacterAdvance(text, 0, text.length, 0, text.length, in testGetRunCharacterAdvance_LTR()
[all …]
DLayoutTest.java40 TextPaint paint = new TextPaint(); in testGetDesiredWidthRange() local
41 float widthShort = Layout.getDesiredWidth(textShort, 0, textShort.length(), paint); in testGetDesiredWidthRange()
42 float widthLonger = Layout.getDesiredWidth(textLonger, 0, textLonger.length(), paint); in testGetDesiredWidthRange()
43 float widthLongest = Layout.getDesiredWidth(textLongest, 0, textLongest.length(), paint); in testGetDesiredWidthRange()
44 float widthPartShort = Layout.getDesiredWidth(textShort, 2, textShort.length(), paint); in testGetDesiredWidthRange()
45 float widthZero = Layout.getDesiredWidth(textLonger, 5, textShort.length() - 3, paint); in testGetDesiredWidthRange()
57 TextPaint paint = new TextPaint(); in testGetDesiredWidth() local
58 float widthShort = Layout.getDesiredWidth(textShort, paint); in testGetDesiredWidth()
59 float widthLonger = Layout.getDesiredWidth(textLonger, paint); in testGetDesiredWidth()
60 float widthLongest = Layout.getDesiredWidth(textLongest, paint); in testGetDesiredWidth()
DFontVariationSettingsTest.kt36 val paint = Paint() in assumeDefaultFontHasVariableFont() constant
37 val glyphs = TextRunShaper.shapeTextRun("a", 0, 1, 0, 1, 0f, 0f, false, paint) in assumeDefaultFontHasVariableFont()
42 fun drawText(text: String, paint: TextPaint): Bitmap { in drawText()
43 val w = ceil(Layout.getDesiredWidth(text, paint)).toInt() in drawText()
44 val layout = Layout.Builder(text, 0, text.length, paint, w).build() in drawText()
46 Canvas(bmp).drawText(text, 0, text.length, 0f, layout.getLineAscent(0).toFloat(), paint) in drawText()
53 val paint = TextPaint().apply { in testFontVariationSettingsEffective() constant
57 val expect = drawText("a", paint) in testFontVariationSettingsEffective()
59 paint.fontVariationSettings = "'wght' 900" in testFontVariationSettingsEffective()
60 val actual = drawText("a", paint) in testFontVariationSettingsEffective()
DLayoutMinimumLineHeightTest.kt44 private val paint = TextPaint().apply { in <lambda>() constant in android.text.cts.LayoutMinimumLineHeightTest
49 private fun getMetrics(text: String, paint: TextPaint): Pair<Int, Int> { in getMetrics()
50 val l = StaticLayout.Builder.obtain(text, 0, text.length, paint, Int.MAX_VALUE) in getMetrics()
63 val layout = Layout.Builder(text, 0, text.length, paint, 1024) in layout_SetGetMinimumFontMetrics()
78 val layout = StaticLayout.Builder.obtain(text, 0, text.length, paint, 1024) in StaticLayout_SetGetMinimumFontMetrics()
93 val layout = DynamicLayout.Builder.obtain(text, paint, 1024) in DynamicLayout_SetGetMinimumFontMetrics()
105 val originalMetrics = getMetrics(text, paint) in Layout_expandToReserveMinimumFontMetrics()
112 val layout = Layout.Builder(text, 0, text.length, paint, 1024) in Layout_expandToReserveMinimumFontMetrics()
125 val originalMetrics = getMetrics(text, paint) in StaticLayout_expandToReserveMinimumFontMetrics()
132 val layout = StaticLayout.Builder.obtain(text, 0, text.length, paint, 1024) in StaticLayout_expandToReserveMinimumFontMetrics()
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testinfrastructure/
DDisplayModifier.java91 public void modifyDrawing(Paint paint, Canvas canvas) {
92 paint.setAntiAlias(true);
97 public void modifyDrawing(Paint paint, Canvas canvas) {
98 paint.setAntiAlias(false);
105 public void modifyDrawing(Paint paint, Canvas canvas) {
106 paint.setStyle(Paint.Style.FILL);
111 public void modifyDrawing(Paint paint, Canvas canvas) {
112 paint.setStyle(Paint.Style.STROKE);
117 public void modifyDrawing(Paint paint, Canvas canvas) {
118 paint.setStyle(Paint.Style.FILL_AND_STROKE);
[all …]
/cts/tests/tests/graphics/src/android/graphics/text/cts/
DTextRunShaperTest.java54 Paint paint = new Paint(); in shapeText() local
55 paint.setTextSize(100f); in shapeText()
60 text, 0, text.length(), 0, text.length(), 0f, 0f, false, paint); in shapeText()
80 result.getFont(i).getMetrics(paint, metrics); in shapeText()
91 Paint paint = new Paint(); in shapeText_differentPaint() local
95 paint.setTextSize(100f); // Shape text with 100px in shapeText_differentPaint()
97 text, 0, text.length(), 0, text.length(), 0f, 0f, false, paint); in shapeText_differentPaint()
99 paint.setTextSize(50f); // Shape text with 50px in shapeText_differentPaint()
101 text, 0, text.length(), 0, text.length(), 0f, 0f, false, paint); in shapeText_differentPaint()
117 Paint paint = new Paint(); in shapeText_context() local
[all …]
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/
DPaintTests.kt59 val paint = Paint() in <lambda>() constant
63 val blurPaint = Paint(paint) in <lambda>()
69 paint.setShadowLayer(radius, dx, dy, shadowColor) in <lambda>()
71 drawCall(paint, canvas) in <lambda>()
84 paint, canvas -> in <lambda>() method
85 paint.textSize = 100f in <lambda>()
86 canvas.drawText("shadow text", 0f, paint.textSize, paint) in <lambda>()
91 paint, canvas -> in <lambda>() method
92 paint.textSize = 100f in <lambda>()
95 canvas.drawTextOnPath("shadow text on path", path, 0f, 0f, paint) in <lambda>()
[all …]
DRuntimeShaderTests.kt203 val paint = Paint() in <lambda>() constant
204 paint.shader = shader in <lambda>()
209 { canvas: Canvas, width: Int, height: Int -> canvas.drawRect(rect, paint) }, in <lambda>()
217 val paint = Paint() in <lambda>() constant
218 paint.shader = shader in <lambda>()
219 paint.blendMode = BlendMode.SRC in <lambda>()
224 { canvas: Canvas, width: Int, height: Int -> canvas.drawRect(rect, paint) }, in <lambda>()
231 val paint = Paint() in <lambda>() constant
232 paint.color = Color.BLUE in <lambda>()
233 paint.shader = RuntimeShader(mBlackIfInputNotOpaqueShader) in <lambda>()
[all …]
DPathTests.java28 Paint paint = new Paint(); in testTextPathWithOffset() local
29 paint.setColor(Color.BLACK); in testTextPathWithOffset()
30 paint.setAntiAlias(true); in testTextPathWithOffset()
31 paint.setTypeface(Typeface.create("sans-serif", Typeface.NORMAL)); in testTextPathWithOffset()
32 paint.setTextSize(26); in testTextPathWithOffset()
35 File fontFile = TypefaceTestUtil.getFirstFont(text, paint); in testTextPathWithOffset()
38 Typeface typeface = paint.getTypeface(); in testTextPathWithOffset()
39 paint.setTypeface( in testTextPathWithOffset()
46 paint.getTextPath(text, 0, text.length(), 0, 0, path); in testTextPathWithOffset()
48 canvas.drawPath(path, paint); in testTextPathWithOffset()
[all …]
DGradientTests.java49 Paint paint = new Paint(); in testAlphaPreMultiplication() local
52 paint.setColor(Color.RED); in testAlphaPreMultiplication()
53 canvas.drawRect(0.0f, 0.0f, width, height, paint); in testAlphaPreMultiplication()
55 paint.setColor(Color.WHITE); in testAlphaPreMultiplication()
56 paint.setShader(new LinearGradient( in testAlphaPreMultiplication()
60 canvas.drawRect(0.0f, 0.0f, width, height, paint); in testAlphaPreMultiplication()
78 Paint paint = new Paint(); in testRadialGradientWithFocalPoint() local
93 paint.setShader(gradient); in testRadialGradientWithFocalPoint()
95 canvas.drawRect(0.0f, 0.0f, width, height, paint); in testRadialGradientWithFocalPoint()
117 Paint paint = new Paint(); in testRadialGradientSameStartEndCircles() local
[all …]
DPathClippingTests.java70 Paint paint = new Paint();
71 paint.setAntiAlias(false);
72 paint.setColor(Color.BLUE);
73 paint.setStyle(Paint.Style.STROKE);
74 paint.setStrokeWidth(20);
75 canvas.drawCircle(30, 30, 40, paint);
198 Paint paint = new Paint(); in testTextClip() local
199 paint.setAntiAlias(true); in testTextClip()
200 paint.setTextSize(90); in testTextClip()
201 paint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); in testTextClip()
[all …]
DMeshTest.kt435 val paint = Paint() in <lambda>() constant
436 paint.color = Color.BLUE in <lambda>()
443 canvas.drawMesh(mesh, BlendMode.SRC, paint) in <lambda>()
444 }, true).runWithVerifier(RectVerifier(Color.WHITE, paint.color, rect)) in <lambda>()
490 val paint = Paint() in <lambda>() constant
491 paint.color = Color.BLUE in <lambda>()
507 canvas.drawMesh(mesh, BlendMode.SRC, paint) in <lambda>()
538 val paint = Paint() in <lambda>() constant
539 paint.color = Color.BLUE in <lambda>()
547 canvas.drawMesh(mesh, BlendMode.SRC, paint) in <lambda>()
[all …]
/cts/tests/tests/graphics/src/android/graphics/cts/
DLightingColorFilterTest.java48 Paint paint = new Paint(); in testLightingColorFilter() local
50 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
51 paint.setColorFilter(new LightingColorFilter(Color.WHITE, Color.BLACK)); in testLightingColorFilter()
52 canvas.drawPaint(paint); in testLightingColorFilter()
55 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
56 paint.setColorFilter(new LightingColorFilter(Color.CYAN, Color.BLACK)); in testLightingColorFilter()
57 canvas.drawPaint(paint); in testLightingColorFilter()
60 paint.setColor(Color.MAGENTA); in testLightingColorFilter()
61 paint.setColorFilter(new LightingColorFilter(Color.BLUE, Color.GREEN)); in testLightingColorFilter()
62 canvas.drawPaint(paint); in testLightingColorFilter()
[all …]
DColorMatrixColorFilterTest.java55 Paint paint = new Paint(); in testColorMatrixColorFilter() local
56 paint.setColor(Color.BLUE); in testColorMatrixColorFilter()
57 paint.setColorFilter(filter); in testColorMatrixColorFilter()
58 paint.setAntiAlias(false); in testColorMatrixColorFilter()
59 canvas.drawPoint(0, 0, paint); in testColorMatrixColorFilter()
61 paint.setColor(Color.GREEN); in testColorMatrixColorFilter()
62 canvas.drawPoint(0, 0, paint); in testColorMatrixColorFilter()
64 paint.setColor(Color.RED); in testColorMatrixColorFilter()
65 canvas.drawPoint(0, 0, paint); in testColorMatrixColorFilter()
68 paint.setColor(Color.MAGENTA); in testColorMatrixColorFilter()
[all …]
DDiscretePathEffectTest.java54 Paint paint = new Paint(); in testDiscretePathEffect() local
55 paint.setColor(Color.GREEN); in testDiscretePathEffect()
56 paint.setStyle(Style.STROKE); in testDiscretePathEffect()
57 paint.setStrokeWidth(0); in testDiscretePathEffect()
58 paint.setPathEffect(effect); in testDiscretePathEffect()
59 paint.setAntiAlias(false); in testDiscretePathEffect()
69 canvas.drawPath(path, paint); in testDiscretePathEffect()
72 paint = new Paint(); in testDiscretePathEffect()
73 paint.setColor(Color.RED); in testDiscretePathEffect()
74 paint.setStyle(Style.STROKE); in testDiscretePathEffect()
[all …]
DCanvasDrawGlyphsTest.java60 int positionStart, int glyphCount, Font font, Paint paint) { in drawGlyphsToBitmap() argument
64 font, paint); in drawGlyphsToBitmap()
70 Paint paint = new Paint(); in drawGlyphs_SameToDrawText() local
71 paint.setTextSize(TEXT_SIZE); in drawGlyphs_SameToDrawText()
86 paint in drawGlyphs_SameToDrawText()
91 paint.setTypeface(mTypeface); in drawGlyphs_SameToDrawText()
92 textCanvas.drawText("abcde", 0, 5, DRAW_ORIGIN_X, DRAW_ORIGIN_Y, paint); in drawGlyphs_SameToDrawText()
99 Paint paint = new Paint(); in drawGlyphs_glyphOffset() local
100 paint.setTextSize(TEXT_SIZE); in drawGlyphs_glyphOffset()
115 paint in drawGlyphs_glyphOffset()
[all …]
DComposePathEffectTest.java63 Paint paint = makePaint(); in testComposePathEffect() local
64 paint.setPathEffect(composedEffect); in testComposePathEffect()
65 canvas.drawPath(path, paint); in testComposePathEffect()
69 paint = makePaint(); in testComposePathEffect()
70 paint.setPathEffect(expectedEffect); in testComposePathEffect()
71 canvas.drawPath(path, paint); in testComposePathEffect()
81 Paint paint = new Paint(); in makePaint() local
82 paint.setColor(Color.GREEN); in makePaint()
83 paint.setStyle(Paint.Style.STROKE); in makePaint()
84 paint.setStrokeWidth(0); in makePaint()
[all …]
DSumPathEffectTest.java58 Paint paint = new Paint(); in testSumPathEffect() local
59 paint.setColor(Color.GREEN); in testSumPathEffect()
60 paint.setPathEffect(first); in testSumPathEffect()
61 paint.setStyle(Paint.Style.STROKE); in testSumPathEffect()
62 paint.setStrokeWidth(0); // 1-pixel hairline in testSumPathEffect()
63 paint.setAntiAlias(false); in testSumPathEffect()
64 canvas.drawPath(path, paint); in testSumPathEffect()
67 paint.setPathEffect(second); in testSumPathEffect()
68 canvas.drawPath(path, paint); in testSumPathEffect()
71 paint.setPathEffect(sumPathEffect); in testSumPathEffect()
[all …]
DBitmapShaderTest.java71 Paint paint = new Paint(); in testBitmapShader() local
72 paint.setShader(shader); in testBitmapShader()
78 canvas.drawPaint(paint); in testBitmapShader()
127 Paint paint = new Paint(); in testClamp() local
128 paint.setShader(shader); in testClamp()
129 canvas.drawRect(0, 0, 4, 1, paint); in testClamp()
150 Paint paint = new Paint(); in testRepeat() local
151 paint.setShader(shader); in testRepeat()
152 canvas.drawRect(0, 0, 4, 1, paint); in testRepeat()
173 Paint paint = new Paint(); in testMirror() local
[all …]
DPaintFontMetricsForLocaleTest.kt54 val paint = Paint(PAINT).apply { in testExtentForLocale() constant
58 paint.getFontMetricsForLocale(metrics) in testExtentForLocale()
66 val paint = Paint(PAINT).apply { in testExtentIntForLocale() constant
70 paint.getFontMetricsIntForLocale(metrics) in testExtentIntForLocale()
78 val paint = Paint(PAINT).apply { in testExtentForRoboto() constant
83 paint.getFontMetrics(expectedMetrics) in testExtentForRoboto()
86 paint.getFontMetricsForLocale(metrics) in testExtentForRoboto()
95 val paint = Paint(PAINT).apply { in testExtentIntForRoboto() constant
100 paint.getFontMetricsInt(expectedMetrics) in testExtentIntForRoboto()
103 paint.getFontMetricsIntForLocale(metrics) in testExtentIntForRoboto()
DPictureTest.java76 Paint paint = new Paint(); in createImbalance() local
77 paint.setColor(Color.GREEN); in createImbalance()
78 canvas.drawRect(0, 0, 10, 10, paint); in createImbalance()
140 Paint paint = new Paint(); in drawPicture() local
142 paint.setColor(Color.GREEN); in drawPicture()
143 paint.setStyle(Style.FILL); in drawPicture()
144 paint.setAntiAlias(false); in drawPicture()
145 canvas.drawRect(0, 0, TEST_WIDTH, TEST_HEIGHT, paint); in drawPicture()
147 paint.setColor(Color.RED); in drawPicture()
148 canvas.drawLine(0, 0, TEST_WIDTH, 0, paint); in drawPicture()
[all …]
/cts/tests/tests/widget/src/android/widget/cts/
DTextViewPrecomputedTextTest.java73 final TextPaint paint = new TextPaint(params.getTextPaint()); in makeDifferentParams() local
77 paint.setTextSize(paint.getTextSize() * 2.0f + 1.0f); in makeDifferentParams()
81 paint.setTextScaleX(paint.getTextScaleX() * 2.0f + 1.0f); in makeDifferentParams()
85 paint.setTextSkewX(paint.getTextSkewX() * 2.0f + 1.0f); in makeDifferentParams()
89 paint.setLetterSpacing(paint.getLetterSpacing() * 2.0f + 1.0f); in makeDifferentParams()
93 paint.setTextLocale(Locale.US.equals(paint.getTextLocale()) ? Locale.JAPAN : Locale.US); in makeDifferentParams()
96 final Typeface tf = paint.getTypeface(); in makeDifferentParams()
98 paint.setTypeface(Typeface.SERIF); in makeDifferentParams()
100 paint.setTypeface(Typeface.DEFAULT); in makeDifferentParams()
108 final String varSettings = paint.getFontVariationSettings(); in makeDifferentParams()
[all …]
/cts/tests/tests/uirendering27/src/android/uirendering/cts/testclasses/
DExpandingClipTest.java52 Paint paint = new Paint(); in testClipReplace() local
53 paint.setColor(Color.WHITE); in testClipReplace()
54 canvas.drawRect(0, 0, width, height, paint); in testClipReplace()
62 paint.setColor(Color.BLUE); in testClipReplace()
63 canvas.drawRect(0, 0, width, height, paint); in testClipReplace()
78 Paint paint = new Paint(); in testClipUnsupportedExpandingOps() local
79 paint.setColor(Color.RED); in testClipUnsupportedExpandingOps()
80 canvas.drawRect(0, 0, width, height, paint); in testClipUnsupportedExpandingOps()

12345