Home
last modified time | relevance | path

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

123

/cts/tests/tests/graphics/src/android/graphics/cts/
DPictureTest.java71 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testSaveRestoreBalance() local
72 Canvas drawDest = new Canvas(bitmap); in testSaveRestoreBalance()
88 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in checkBalance() local
89 Canvas canvas = new Canvas(bitmap); in checkBalance()
119 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testPicture() local
120 canvas = new Canvas(bitmap); in testPicture()
123 checkBitmap(bitmap); in testPicture()
129 bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Bitmap.Config.ARGB_8888); in testPicture()
130 canvas = new Canvas(bitmap); in testPicture()
133 checkBitmap(bitmap); in testPicture()
[all …]
DEmbossMaskFilterTest.java53 Bitmap bitmap = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Config.ARGB_8888); in testEmbossMaskFilter() local
54 bitmap.eraseColor(Color.BLACK); in testEmbossMaskFilter()
56 Canvas c = new Canvas(bitmap); in testEmbossMaskFilter()
64 assertTrue(brightness(bitmap, top) > brightness(bitmap, bottom)); in testEmbossMaskFilter()
65 assertTrue(brightness(bitmap, left) > brightness(bitmap, right)); in testEmbossMaskFilter()
69 assertEquals(0, brightness(bitmap, top)); in testEmbossMaskFilter()
71 assertEquals(0, brightness(bitmap, bottom)); in testEmbossMaskFilter()
73 assertEquals(0, brightness(bitmap, left)); in testEmbossMaskFilter()
75 assertEquals(0, brightness(bitmap, right)); in testEmbossMaskFilter()
DColorMatrixColorFilterTest.java44 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testColorMatrixColorFilter() local
45 Canvas canvas = new Canvas(bitmap); in testColorMatrixColorFilter()
50 assertColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
53 assertColor(Color.GREEN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
56 assertColor(Color.RED, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
60 assertColor(Color.WHITE, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
71 bitmap.eraseColor(Color.TRANSPARENT); in testColorMatrixColorFilter()
76 assertColor(Color.argb(128, 255, 0, 64), bitmap.getPixel(0, 0), 2); in testColorMatrixColorFilter()
80 assertColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
87 assertColor(Color.CYAN, bitmap.getPixel(0, 0)); in testColorMatrixColorFilter()
[all …]
DBitmapTest.java110 Bitmap bitmap = mBitmap.copy(Config.ARGB_8888, false); in testCopy() local
111 WidgetTestUtils.assertEquals(mBitmap, bitmap); in testCopy()
164 Bitmap bitmap = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(), in testCopyPixelsToBuffer() local
167 bitmap.copyPixelsFromBuffer(intBuf1); in testCopyPixelsToBuffer()
169 bitmap.copyPixelsToBuffer(intBuf2); in testCopyPixelsToBuffer()
183 Bitmap bitmap = Bitmap.createBitmap(colors, 10, 10, Config.RGB_565); in testCreateBitmap1() local
184 Bitmap ret = Bitmap.createBitmap(bitmap); in testCreateBitmap1()
547 Bitmap bitmap = Bitmap.createBitmap(10, 10, fromConfig); in testAlphaAndPremul() local
553 assertEquals(bitmap.getConfig(), Config.ARGB_8888); in testAlphaAndPremul()
557 bitmap.setHasAlpha(hasAlpha); in testAlphaAndPremul()
[all …]
DLightingColorFilterTest.java34 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testLightingColorFilter() local
35 Canvas canvas = new Canvas(bitmap); in testLightingColorFilter()
42 assertColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
47 assertColor(Color.BLUE, bitmap.getPixel(0, 0)); in testLightingColorFilter()
52 assertColor(Color.CYAN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
55 bitmap.eraseColor(Color.TRANSPARENT); in testLightingColorFilter()
59 assertColor(Color.GREEN, bitmap.getPixel(0, 0)); in testLightingColorFilter()
65 assertColor(Color.MAGENTA, bitmap.getPixel(0, 0)); in testLightingColorFilter()
72 assertColor(Color.argb(255, 30, 30, 30), bitmap.getPixel(0, 0)); in testLightingColorFilter()
75 bitmap.eraseColor(Color.TRANSPARENT); in testLightingColorFilter()
[all …]
DNinePatchTest.java71 Bitmap bitmap = Bitmap.createBitmap(COLOR, 10, 10, Bitmap.Config.ARGB_4444); in testIsNinePatchChunk() local
72 assertFalse(NinePatch.isNinePatchChunk(bitmap.getNinePatchChunk())); in testIsNinePatchChunk()
80 Bitmap bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw() local
82 Canvas c = new Canvas(bitmap); in testDraw()
85 checkBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
88 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
90 c = new Canvas(bitmap); in testDraw()
93 checkBitmapWithAlpha(expected, bitmap, ALPHA_OPAQUE); in testDraw()
95 bitmap = Bitmap.createBitmap(expected.getWidth(), expected.getHeight(), in testDraw()
97 c = new Canvas(bitmap); in testDraw()
[all …]
DBitmapShaderTest.java68 private void checkTile(Bitmap bitmap, int tileX, int tileY) { in checkTile() argument
73 assertColor(BORDER_COLOR, bitmap, x + tileY, y + tileY); in checkTile()
75 assertColor(CENTER_COLOR, bitmap, x + tileY, y + tileY); in checkTile()
86 private void assertColor(int color, Bitmap bitmap, int x, int y) { in assertColor() argument
87 if (x < bitmap.getWidth() && y < bitmap.getHeight()) { in assertColor()
88 assertEquals(color, bitmap.getPixel(x, y)); in assertColor()
DBlurMaskFilterTest.java62 private void checkQuadrants(int color, Bitmap bitmap, int x, int y, int alphaTolerance) { in checkQuadrants() argument
63 int right = bitmap.getWidth() - 1; in checkQuadrants()
64 int bottom = bitmap.getHeight() - 1; in checkQuadrants()
66 checkColor(color, bitmap.getPixel(x, y), alphaTolerance); in checkQuadrants()
67 checkColor(color, bitmap.getPixel(right - x, y), alphaTolerance); in checkQuadrants()
68 checkColor(color, bitmap.getPixel(x, bottom - y), alphaTolerance); in checkQuadrants()
69 checkColor(color, bitmap.getPixel(right - x, bottom - y), alphaTolerance); in checkQuadrants()
DDashPathEffectTest.java45 Bitmap bitmap = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Config.ARGB_8888); in testDashPathEffect() local
46 bitmap.eraseColor(BACKGROUND); in testDashPathEffect()
58 Canvas canvas = new Canvas(bitmap); in testDashPathEffect()
67 assertEquals(FOREGROUND, bitmap.getPixel(x, y)); in testDashPathEffect()
69 assertEquals(BACKGROUND, bitmap.getPixel(x, y)); in testDashPathEffect()
72 assertEquals(BACKGROUND, bitmap.getPixel(x, y)); in testDashPathEffect()
DPaintFlagsDrawFilterTest.java89 private void assertUnderline(Bitmap bitmap) { in assertUnderline() argument
94 int pixel = bitmap.getPixel(x, y); in assertUnderline()
164 private void assertContainsNonBW(Bitmap bitmap) { in assertContainsNonBW() argument
165 for (int i = 0; i < bitmap.getWidth(); ++i) { in assertContainsNonBW()
166 for (int j = 0; j < bitmap.getHeight(); ++j) { in assertContainsNonBW()
167 int color = bitmap.getPixel(i, j); in assertContainsNonBW()
180 private void assertContainsOnlyBlackAndWhite(Bitmap bitmap) { in assertContainsOnlyBlackAndWhite() argument
181 for (int i = 0; i < bitmap.getWidth(); ++i) { in assertContainsOnlyBlackAndWhite()
182 for (int j = 0; j < bitmap.getHeight(); ++j) { in assertContainsOnlyBlackAndWhite()
183 int color = bitmap.getPixel(i, j); in assertContainsOnlyBlackAndWhite()
DComposeShaderTest.java48 Bitmap bitmap = Bitmap.createBitmap(SIZE, SIZE, Config.ARGB_8888); in testPorterDuff() local
49 Canvas canvas = new Canvas(bitmap); in testPorterDuff()
59 int pixel = bitmap.getPixel(x, y); in testPorterDuff()
86 Bitmap bitmap = Bitmap.createBitmap(1, 1, Config.ARGB_8888); in testXfermode() local
87 Canvas canvas = new Canvas(bitmap); in testXfermode()
93 assertEquals(Color.YELLOW, bitmap.getPixel(0, 0)); in testXfermode()
/cts/tests/tests/uirendering/src/android/uirendering/cts/util/
DBitmapDumper.java94 public static void dumpBitmap(Bitmap bitmap, String testName, String className) { in dumpBitmap() argument
95 if (bitmap == null) { in dumpBitmap()
99 saveFile(className, testName, SINGULAR_FILE_NAME, bitmap); in dumpBitmap()
102 private static void logIfBitmapSolidColor(String bitmapName, Bitmap bitmap) { in logIfBitmapSolidColor() argument
103 int firstColor = bitmap.getPixel(0, 0); in logIfBitmapSolidColor()
104 for (int x = 0; x < bitmap.getWidth(); x++) { in logIfBitmapSolidColor()
105 for (int y = 0; y < bitmap.getHeight(); y++) { in logIfBitmapSolidColor()
106 if (bitmap.getPixel(x, y) != firstColor) { in logIfBitmapSolidColor()
115 … private static void saveFile(String className, String testName, String fileName, Bitmap bitmap) { in saveFile() argument
118 logIfBitmapSolidColor(bitmapName, bitmap); in saveFile()
[all …]
/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()
DActivityTestBase.java126 static int[] getBitmapPixels(Bitmap bitmap) { in getBitmapPixels() argument
127 int[] pixels = new int[bitmap.getWidth() * bitmap.getHeight()]; in getBitmapPixels()
128 bitmap.getPixels(pixels, 0, bitmap.getWidth(), in getBitmapPixels()
129 0, 0, bitmap.getWidth(), bitmap.getHeight()); in getBitmapPixels()
204 protected void assertBitmapIsVerified(Bitmap bitmap, BitmapVerifier bitmapVerifier, in assertBitmapIsVerified() argument
206 bitmap.getPixels(mSoftwareArray, 0, TEST_WIDTH, 0, 0, in assertBitmapIsVerified()
210 Bitmap croppedBitmap = Bitmap.createBitmap(bitmap, 0, 0, TEST_WIDTH, TEST_HEIGHT); in assertBitmapIsVerified()
274 public boolean verify(int[] bitmap, int offset, int stride, int width, int height) { in runWithoutVerification()
/cts/tests/tests/graphics/src/android/graphics/drawable/shapes/cts/
DRoundRectShapeTest.java66 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Config.ARGB_8888); in testDraw() local
67 Canvas canvas = new Canvas(bitmap); in testDraw()
74 assertEquals(0, bitmap.getPixel(0, 0)); in testDraw()
75 assertEquals(TEST_COLOR_1, bitmap.getPixel(TEST_WIDTH / 2, 0)); in testDraw()
79 assertEquals(0, bitmap.getPixel(0, 0)); in testDraw()
80 assertEquals(TEST_COLOR_2, bitmap.getPixel(TEST_WIDTH / 2, 0)); in testDraw()
DPathShapeTest.java55 Bitmap bitmap = Bitmap.createBitmap(SHAPE_SIZE, SHAPE_SIZE, Config.ARGB_8888); in testDraw() local
56 Canvas canvas = new Canvas(bitmap); in testDraw()
64 assertEquals(TEST_COLOR_1, bitmap.getPixel(50, 50)); in testDraw()
75 if (bitmap.getPixel(25, i) == TEST_COLOR_2) { in testDraw()
78 if (bitmap.getPixel(i, 25) == TEST_COLOR_2) { in testDraw()
81 if (bitmap.getPixel(i, i) == TEST_COLOR_2) { in testDraw()
DRectShapeTest.java41 private void assertDrawSuccessfully(Bitmap bitmap, int width, int height, int color) { in assertDrawSuccessfully() argument
44 assertEquals(color, bitmap.getPixel(i, j)); in assertDrawSuccessfully()
51 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Config.ARGB_8888); in testDraw() local
52 Canvas canvas = new Canvas(bitmap); in testDraw()
59 assertDrawSuccessfully(bitmap, TEST_WIDTH, TEST_HEIGHT, TEST_COLOR_1); in testDraw()
63 assertDrawSuccessfully(bitmap, TEST_WIDTH, TEST_HEIGHT, TEST_COLOR_2); in testDraw()
DArcShapeTest.java49 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Config.ARGB_8888); in testDraw() local
50 Canvas canvas = new Canvas(bitmap); in testDraw()
58 assertEquals(TEST_COLOR_1, bitmap.getPixel(TEST_WIDTH / 2, TEST_HEIGHT / 2)); in testDraw()
68 if (bitmap.getPixel(i, i) == TEST_COLOR_2) { in testDraw()
DOvalShapeTest.java44 Bitmap bitmap = Bitmap.createBitmap(TEST_WIDTH, TEST_HEIGHT, Config.ARGB_8888); in testDraw() local
45 Canvas canvas = new Canvas(bitmap); in testDraw()
53 assertEquals(TEST_COLOR_1, bitmap.getPixel(TEST_WIDTH / 2, TEST_HEIGHT / 2)); in testDraw()
62 if (bitmap.getPixel(i, i) == TEST_COLOR_2) { in testDraw()
/cts/tests/tests/textureview/src/android/textureview/cts/
DTextureViewSnapshotTestActivity.java80 Bitmap bitmap = mTexView.getBitmap(); in onSurfaceTextureUpdated() local
81 Assert.assertNotNull(bitmap); in onSurfaceTextureUpdated()
82 Assert.assertEquals(mTexView.getWidth(), bitmap.getWidth()); in onSurfaceTextureUpdated()
83 Assert.assertEquals(mTexView.getHeight(), bitmap.getHeight()); in onSurfaceTextureUpdated()
84 Assert.assertEquals(Color.RED, bitmap.getPixel(0, 0)); in onSurfaceTextureUpdated()
/cts/tests/tests/text/src/android/text/cts/
DEmojiTest.java169 Bitmap bitmap = Bitmap.createBitmap(getDrawingCache()); in capture() local
171 return bitmap; in capture()
192 Bitmap bitmap = Bitmap.createBitmap(getDrawingCache()); in capture() local
194 return bitmap; in capture()
215 Bitmap bitmap = Bitmap.createBitmap(getDrawingCache()); in capture() local
217 return bitmap; in capture()
226 Bitmap bitmap; field in EmojiTest.CaptureWebView
248 bitmap = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), in capture()
250 Canvas canvas = new Canvas(bitmap); in capture()
254 return bitmap; in capture()
/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()
/cts/tests/tests/uirendering/src/android/uirendering/cts/bitmapverifiers/
DSamplePointVerifier.java41 public boolean verify(int[] bitmap, int offset, int stride, int width, int height) { in verify() argument
43 int[] differenceMap = new int[bitmap.length]; in verify()
49 if (!verifyPixel(bitmap[index], mExpectedColors[i])) { in verify()
52 Integer.toHexString(bitmap[index])); in verify()
DGoldenImageVerifier.java35 public boolean verify(int[] bitmap, int offset, int stride, int width, int height) { in verify() argument
36 boolean success = mBitmapComparer.verifySame(mGoldenBitmapArray, bitmap, offset, stride, in verify()
40 int[] differences = new PassFailVisualizer().getDifferences(mGoldenBitmapArray, bitmap); in verify()
/cts/hostsidetests/theme/app/src/android/theme/app/
DGenerateBitmapTask.java66 final Bitmap bitmap = mBitmap; in doInBackground() local
67 if (bitmap == null) { in doInBackground()
82 success = bitmap.compress(CompressFormat.PNG, 100, stream); in doInBackground()
92 bitmap.recycle(); in doInBackground()

123