Home
last modified time | relevance | path

Searched refs:bitmap (Results 1 – 25 of 99) sorted by relevance

1234

/cts/tests/tests/view/src/android/view/cts/
DPixelCopyTest.java168 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerFullsize() local
169 int result = mCopyHelper.request(activity.getView(), bitmap); in testGlProducerFullsize()
171 assertEquals(100, bitmap.getWidth()); in testGlProducerFullsize()
172 assertEquals(100, bitmap.getHeight()); in testGlProducerFullsize()
173 assertEquals(Config.ARGB_8888, bitmap.getConfig()); in testGlProducerFullsize()
174 assertBitmapQuadColor(bitmap, in testGlProducerFullsize()
181 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerCropTopLeft() local
182 int result = mCopyHelper.request(activity.getView(), new Rect(0, 0, 50, 50), bitmap); in testGlProducerCropTopLeft()
184 assertBitmapQuadColor(bitmap, in testGlProducerCropTopLeft()
191 Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888); in testGlProducerCropCenter() local
[all …]
DTextureViewSnapshotTestActivity.java84 Bitmap bitmap = mTexView.getBitmap(); in onSurfaceTextureUpdated() local
85 Assert.assertNotNull(bitmap); in onSurfaceTextureUpdated()
86 Assert.assertEquals(mTexView.getWidth(), bitmap.getWidth()); in onSurfaceTextureUpdated()
87 Assert.assertEquals(mTexView.getHeight(), bitmap.getHeight()); in onSurfaceTextureUpdated()
88 Assert.assertEquals(Color.RED, bitmap.getPixel(0, 0)); in onSurfaceTextureUpdated()
/cts/tests/tests/graphics/src/android/graphics/cts/
DBitmapTest.java116 Bitmap bitmap = mBitmap.copy(Config.ARGB_8888, false); in testCopy() local
117 WidgetTestUtils.assertEquals(mBitmap, bitmap); in testCopy()
184 Bitmap bitmap = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), in testCopyPixelsToBuffer() local
187 bitmap.copyPixelsFromBuffer(intBuf1); in testCopyPixelsToBuffer()
189 bitmap.copyPixelsToBuffer(intBuf2); in testCopyPixelsToBuffer()
204 Bitmap bitmap = Bitmap.createBitmap(colors, 10, 10, Config.RGB_565); in testCreateBitmap1() local
205 Bitmap ret = Bitmap.createBitmap(bitmap); in testCreateBitmap1()
387 Bitmap bitmap; in testCreateBitmap_displayMetrics_mutable() local
388 bitmap = Bitmap.createBitmap(metrics, 10, 10, Config.ARGB_8888); in testCreateBitmap_displayMetrics_mutable()
389 assertTrue(bitmap.isMutable()); in testCreateBitmap_displayMetrics_mutable()
[all …]
DBitmapShaderTest.java75 private void verifyTile(Bitmap bitmap, int tileX, int tileY) { in verifyTile() argument
80 verifyColor(BORDER_COLOR, bitmap, x + tileX, y + tileY); in verifyTile()
82 verifyColor(CENTER_COLOR, bitmap, x + tileX, y + tileY); in verifyTile()
93 private void verifyColor(int color, Bitmap bitmap, int x, int y) { in verifyColor() argument
94 if (x < bitmap.getWidth() && y < bitmap.getHeight()) { in verifyColor()
95 assertEquals(color, bitmap.getPixel(x, y)); in verifyColor()
101 Bitmap bitmap = Bitmap.createBitmap(2, 1, Config.ARGB_8888); in testClamp() local
102 bitmap.setPixel(0, 0, Color.RED); in testClamp()
103 bitmap.setPixel(1, 0, Color.BLUE); in testClamp()
105 BitmapShader shader = new BitmapShader(bitmap, in testClamp()
[all …]
DPictureTest.java80 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testSaveRestoreBalance() local
81 Canvas drawDest = new Canvas(bitmap); in testSaveRestoreBalance()
97 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in verifyBalance() local
98 Canvas canvas = new Canvas(bitmap); in verifyBalance()
129 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testPicture() local
130 canvas = new Canvas(bitmap); in testPicture()
133 verifyBitmap(bitmap); in testPicture()
139 bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testPicture()
140 canvas = new Canvas(bitmap); in testPicture()
143 verifyBitmap(bitmap); in testPicture()
[all …]
DEmbossMaskFilterTest.java61 Bitmap bitmap = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Config.ARGB_8888); in testEmbossMaskFilter() local
62 bitmap.eraseColor(Color.BLACK); in testEmbossMaskFilter()
64 Canvas c = new Canvas(bitmap); in testEmbossMaskFilter()
72 assertTrue(brightness(bitmap, top) > brightness(bitmap, bottom)); in testEmbossMaskFilter()
73 assertTrue(brightness(bitmap, left) > brightness(bitmap, right)); in testEmbossMaskFilter()
77 assertEquals(0, brightness(bitmap, top)); in testEmbossMaskFilter()
79 assertEquals(0, brightness(bitmap, bottom)); in testEmbossMaskFilter()
81 assertEquals(0, brightness(bitmap, left)); in testEmbossMaskFilter()
83 assertEquals(0, brightness(bitmap, right)); in testEmbossMaskFilter()
DComposeShaderTest.java54 Bitmap bitmap = Bitmap.createBitmap(SIZE, SIZE, Config.ARGB_8888); in testPorterDuff() local
55 Canvas canvas = new Canvas(bitmap); in testPorterDuff()
65 int pixel = bitmap.getPixel(x, y); in testPorterDuff()
93 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testXfermode() local
94 Canvas canvas = new Canvas(bitmap); in testXfermode()
100 assertEquals(Color.WHITE, bitmap.getPixel(0, 0)); in testXfermode()
122 Bitmap bitmap = Bitmap.createBitmap(10, 10, Config.ARGB_8888); in testChildLocalMatrix() local
123 Canvas canvas = new Canvas(bitmap); in testChildLocalMatrix()
128 bitmap.eraseColor(Color.TRANSPARENT); in testChildLocalMatrix()
130 assertEquals(Color.WHITE, bitmap.getPixel(1, 1)); in testChildLocalMatrix()
[all …]
DColorMatrixColorFilterTest.java53 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testColorMatrixColorFilter() local
54 Canvas canvas = new Canvas(bitmap); in testColorMatrixColorFilter()
59 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
62 ColorUtils.verifyColor(Color.GREEN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
65 ColorUtils.verifyColor(Color.RED, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
69 ColorUtils.verifyColor(Color.WHITE, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
80 bitmap.eraseColor(Color.TRANSPARENT); in testColorMatrixColorFilter()
85 ColorUtils.verifyColor(Color.argb(128, 255, 0, 64), bitmap.getPixel(0, 0), 2); in testColorMatrixColorFilter()
89 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
96 ColorUtils.verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
[all …]
DNinePatchTest.java106 Bitmap bitmap = Bitmap.createBitmap(COLOR, 10, 10, Bitmap.Config.ARGB_4444); in testIsNinePatchChunk() local
107 assertFalse(NinePatch.isNinePatchChunk(bitmap.getNinePatchChunk())); in testIsNinePatchChunk()
115 Bitmap bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw() local
117 Canvas c = new Canvas(bitmap); in testDraw()
120 verifyBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
123 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
125 c = new Canvas(bitmap); in testDraw()
128 verifyBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
130 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
132 c = new Canvas(bitmap); in testDraw()
[all …]
DLightingColorFilterTest.java44 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testLightingColorFilter() local
45 Canvas canvas = new Canvas(bitmap); in testLightingColorFilter()
52 verifyColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
57 verifyColor(Color.BLUE, bitmap.getPixel(0, 0)); in testLightingColorFilter()
62 verifyColor(Color.CYAN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
65 bitmap.eraseColor(Color.TRANSPARENT); in testLightingColorFilter()
69 verifyColor(Color.GREEN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
75 verifyColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
82 verifyColor(Color.argb(255, 30, 30, 30), bitmap.getPixel(0, 0)); in testLightingColorFilter()
85 bitmap.eraseColor(Color.TRANSPARENT); in testLightingColorFilter()
[all …]
DRadialGradientTest.java48 Bitmap bitmap = Bitmap.createBitmap(3, 1, Config.ARGB_8888); in testZeroScaleMatrix() local
49 bitmap.eraseColor(Color.BLACK); in testZeroScaleMatrix()
50 Canvas canvas = new Canvas(bitmap); in testZeroScaleMatrix()
56 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(0, 0), 1); in testZeroScaleMatrix()
57 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(1, 0), 1); in testZeroScaleMatrix()
58 ColorUtils.verifyColor(Color.BLACK, bitmap.getPixel(2, 0), 1); in testZeroScaleMatrix()
DBlurMaskFilterTest.java68 private void verifyQuadrants(int color, Bitmap bitmap, int x, int y, int alphaTolerance) { in verifyQuadrants() argument
69 int right = bitmap.getWidth() - 1; in verifyQuadrants()
70 int bottom = bitmap.getHeight() - 1; in verifyQuadrants()
72 verifyColor(color, bitmap.getPixel(x, y), alphaTolerance); in verifyQuadrants()
73 verifyColor(color, bitmap.getPixel(right - x, y), alphaTolerance); in verifyQuadrants()
74 verifyColor(color, bitmap.getPixel(x, bottom - y), alphaTolerance); in verifyQuadrants()
75 verifyColor(color, bitmap.getPixel(right - x, bottom - y), alphaTolerance); in verifyQuadrants()
DPaintFlagsDrawFilterTest.java92 private void verifyUnderline(Bitmap bitmap) { in verifyUnderline() argument
97 int pixel = bitmap.getPixel(x, y); in verifyUnderline()
168 private void verifyContainsNonBW(Bitmap bitmap) { in verifyContainsNonBW() argument
169 for (int i = 0; i < bitmap.getWidth(); ++i) { in verifyContainsNonBW()
170 for (int j = 0; j < bitmap.getHeight(); ++j) { in verifyContainsNonBW()
171 int color = bitmap.getPixel(i, j); in verifyContainsNonBW()
184 private void verifyContainsOnlyBlackAndWhite(Bitmap bitmap) { in verifyContainsOnlyBlackAndWhite() argument
185 for (int i = 0; i < bitmap.getWidth(); ++i) { in verifyContainsOnlyBlackAndWhite()
186 for (int j = 0; j < bitmap.getHeight(); ++j) { in verifyContainsOnlyBlackAndWhite()
187 int color = bitmap.getPixel(i, j); in verifyContainsOnlyBlackAndWhite()
DDashPathEffectTest.java52 Bitmap bitmap = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Config.ARGB_8888); in testDashPathEffect() local
53 bitmap.eraseColor(BACKGROUND); in testDashPathEffect()
65 Canvas canvas = new Canvas(bitmap); in testDashPathEffect()
74 assertEquals(FOREGROUND, bitmap.getPixel(x, y)); in testDashPathEffect()
76 assertEquals(BACKGROUND, bitmap.getPixel(x, y)); in testDashPathEffect()
79 assertEquals(BACKGROUND, bitmap.getPixel(x, y)); in testDashPathEffect()
DShaderTest.java47 Bitmap bitmap = Bitmap.createBitmap(color, width, height, Bitmap.Config.RGB_565); in testAccessLocalMatrix() local
49 Shader shader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); in testAccessLocalMatrix()
74 Bitmap bitmap = Bitmap.createBitmap(10, 10, Bitmap.Config.RGB_565); in testGetSetLocalMatrix() local
75 bitmap.eraseColor(Color.BLUE); in testGetSetLocalMatrix()
76 Shader shader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); in testGetSetLocalMatrix()
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/
DRgba16fTests.java48 Bitmap bitmap = BitmapFactory.decodeStream(in); in testTransferFunctions()
50 width / (float) bitmap.getWidth(), in testTransferFunctions()
51 height / (float) bitmap.getHeight()); in testTransferFunctions()
52 canvas.drawBitmap(bitmap, 0, 0, null); in testTransferFunctions()
69 Bitmap bitmap = BitmapFactory.decodeStream(in); in testAlpha()
71 width / (float) bitmap.getWidth(), in testAlpha()
72 height / (float) bitmap.getHeight()); in testAlpha()
76 canvas.drawBitmap(bitmap, 0, 0, p); in testAlpha()
93 Bitmap bitmap = BitmapFactory.decodeStream(in); in testMasked()
103 p.setShader(new BitmapShader(bitmap, in testMasked()
[all …]
DColorSpaceTests.java80 Bitmap bitmap = loadAsset("green-p3.png", RGB_565); in testDrawDisplayP3Config565() local
82 .addCanvasClient("Draw_DisplayP3_565", (c, w, h) -> drawAsset(c, bitmap), true) in testDrawDisplayP3Config565()
112 Bitmap bitmap = loadAsset("orange-prophotorgb.png", RGB_565); in testDrawProPhotoRGBConfig565() local
115 (c, w, h) -> drawAsset(c, bitmap), true) in testDrawProPhotoRGBConfig565()
140 private void drawAsset(@NonNull Canvas canvas, Bitmap bitmap) { in drawAsset() argument
144 canvas.drawBitmap(bitmap, 0, 0, null); in drawAsset()
149 p.setShader(new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT)); in drawAsset()
164 canvas.drawBitmap(bitmap, 0, 0, p); in drawAsset()
170 Bitmap bitmap; in loadAsset() local
176 bitmap = BitmapFactory.decodeStream(in, null, opts); in loadAsset()
[all …]
DCanvasStateTests.java96 private void testFailureOnBitmapDraw(Bitmap bitmap) { in testFailureOnBitmapDraw() argument
101 canvas.drawBitmap(bitmap, 0, 0, null); in testFailureOnBitmapDraw()
133 Bitmap bitmap = Bitmap.createBitmap(displayMetrics.widthPixels, in testDrawScreenWideBitmap() local
135 bitmap.eraseColor(Color.RED); in testDrawScreenWideBitmap()
136 canvas.drawBitmap(bitmap, 0, 0, null); in testDrawScreenWideBitmap()
153 Bitmap bitmap = Bitmap.createBitmap(bWidth, bHeight, Bitmap.Config.ARGB_8888); in testDrawLargeBitmap() local
154 bitmap.eraseColor(Color.RED); in testDrawLargeBitmap()
155 canvas.drawBitmap(bitmap, 0, 0, null); in testDrawLargeBitmap()
/cts/tests/tests/systemui/src/android/systemui/cts/
DLightBarTests.java74 Bitmap bitmap = takeStatusBarScreenshot(); in testLightStatusBarIcons() local
75 Stats s = evaluateLightBarBitmap(bitmap, Color.RED /* background */); in testLightStatusBarIcons()
76 assertLightStats(bitmap, s); in testLightStatusBarIcons()
101 Bitmap bitmap = takeNavigationBarScreenshot(); in testLightNavigationBar() local
102 Stats s = evaluateLightBarBitmap(bitmap, Color.RED /* background */); in testLightNavigationBar()
103 assertLightStats(bitmap, s); in testLightNavigationBar()
112 private void assertLightStats(Bitmap bitmap, Stats s) { in assertLightStats() argument
136 dumpBitmap(bitmap); in assertLightStats()
190 private Stats evaluateLightBarBitmap(Bitmap bitmap, int background) { in evaluateLightBarBitmap() argument
197 int[] pixels = new int[bitmap.getHeight() * bitmap.getWidth()]; in evaluateLightBarBitmap()
[all …]
/cts/tests/tests/renderscript/src/android/renderscript/cts/refocus/
DRGBZ.java42 private Bitmap bitmap; field in RGBZ
61 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ()
80 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ()
95 return bitmap; in getBitmap()
121 return bitmap.getWidth(); in getWidth()
128 return bitmap.getHeight(); in getHeight()
150 public Bitmap setAlphaChannel(Bitmap bitmap, Bitmap depthBitmap) { in setAlphaChannel() argument
151 if (bitmap == null) { in setAlphaChannel()
152 return bitmap; in setAlphaChannel()
154 Bitmap result = bitmap.copy(Bitmap.Config.ARGB_8888, true); in setAlphaChannel()
[all …]
/cts/common/device-side/util/src/com/android/compatibility/common/util/
DBitmapUtils.java95 private static void logIfBitmapSolidColor(String fileName, Bitmap bitmap) { in logIfBitmapSolidColor() argument
96 int firstColor = bitmap.getPixel(0, 0); in logIfBitmapSolidColor()
97 for (int x = 0; x < bitmap.getWidth(); x++) { in logIfBitmapSolidColor()
98 for (int y = 0; y < bitmap.getHeight(); y++) { in logIfBitmapSolidColor()
99 if (bitmap.getPixel(x, y) != firstColor) { in logIfBitmapSolidColor()
108 public static void saveBitmap(Bitmap bitmap, String directoryName, String fileName) { in saveBitmap() argument
113 if (bitmap == null) { in saveBitmap()
118 logIfBitmapSolidColor(fileName, bitmap); in saveBitmap()
122 bitmap.compress(Bitmap.CompressFormat.PNG, 0 /* ignored for PNG */, fileStream); in saveBitmap()
/cts/tests/tests/uirendering/src/android/uirendering/cts/testinfrastructure/
DResourceModifier.java50 public final Bitmap bitmap; field in ResourceModifier
55 bitmap = BitmapFactory.decodeResource(resources, R.drawable.sunset1); in ResourceModifier()
56 int texWidth = bitmap.getWidth(); in ResourceModifier()
57 int texHeight = bitmap.getHeight(); in ResourceModifier()
62 repeatShader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, in ResourceModifier()
65 translatedShader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, in ResourceModifier()
72 scaledShader = new BitmapShader(bitmap, Shader.TileMode.MIRROR, in ResourceModifier()
98 final float width = bitmap.getWidth() / 8.0f; in ResourceModifier()
99 final float height = bitmap.getHeight() / 8.0f; in ResourceModifier()
/cts/tests/tests/widget/src/android/widget/cts/util/
DTestUtils.java69 final Bitmap bitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, in getCombinedBackgroundBitmap() local
72 final Canvas canvas = new Canvas(bitmap); in getCombinedBackgroundBitmap()
116 return bitmap; in getCombinedBackgroundBitmap()
150 Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), in assertRegionPixelsOfColor() local
153 Canvas canvas = new Canvas(bitmap); in assertRegionPixelsOfColor()
158 assertAllPixelsOfColor(failMessagePrefix, bitmap, region, in assertRegionPixelsOfColor()
161 bitmap.recycle(); in assertRegionPixelsOfColor()
178 Bitmap bitmap = Bitmap.createBitmap(drawableWidth, drawableHeight, in assertAllPixelsOfColor() local
181 Canvas canvas = new Canvas(bitmap); in assertAllPixelsOfColor()
194 assertAllPixelsOfColor(failMessagePrefix, bitmap, in assertAllPixelsOfColor()
[all …]
/cts/tests/tests/graphics/src/android/graphics/drawable/shapes/cts/
DPathShapeTest.java66 Bitmap bitmap = Bitmap.createBitmap(SHAPE_SIZE, SHAPE_SIZE, Config.ARGB_8888); in testDraw() local
67 Canvas canvas = new Canvas(bitmap); in testDraw()
75 assertEquals(TEST_COLOR_1, bitmap.getPixel(50, 50)); in testDraw()
86 if (bitmap.getPixel(25, i) == TEST_COLOR_2) { in testDraw()
89 if (bitmap.getPixel(i, 25) == TEST_COLOR_2) { in testDraw()
92 if (bitmap.getPixel(i, i) == TEST_COLOR_2) { in testDraw()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DByodIconSamplerActivity.java64 Bitmap bitmap = convertToBitmap(drawable); in sampleImage() local
69 bitmap.compress(Bitmap.CompressFormat.PNG, 100, file); in sampleImage()
102 Bitmap bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(), in convertToBitmap() local
104 Canvas canvas = new Canvas(bitmap); in convertToBitmap()
107 return bitmap; in convertToBitmap()

1234