Home
last modified time | relevance | path

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

12345678910>>...16

/frameworks/base/opengl/java/android/opengl/
DGLUtils.java40 public static int getInternalFormat(Bitmap bitmap) { in getInternalFormat() argument
41 if (bitmap == null) { in getInternalFormat()
44 if (bitmap.isRecycled()) { in getInternalFormat()
47 int result = native_getInternalFormat(bitmap); in getInternalFormat()
62 public static int getType(Bitmap bitmap) { in getType() argument
63 if (bitmap == null) { in getType()
66 if (bitmap.isRecycled()) { in getType()
69 int result = native_getType(bitmap); in getType()
99 Bitmap bitmap, int border) { in texImage2D() argument
100 if (bitmap == null) { in texImage2D()
[all …]
/frameworks/support/v4/java/android/support/v4/graphics/
DBitmapCompat.java29 public boolean hasMipMap(Bitmap bitmap); in hasMipMap() argument
30 public void setHasMipMap(Bitmap bitmap, boolean hasMipMap); in setHasMipMap() argument
31 public int getAllocationByteCount(Bitmap bitmap); in getAllocationByteCount() argument
36 public boolean hasMipMap(Bitmap bitmap) { in hasMipMap() argument
41 public void setHasMipMap(Bitmap bitmap, boolean hasMipMap) { in setHasMipMap() argument
45 public int getAllocationByteCount(Bitmap bitmap) { in getAllocationByteCount() argument
46 return bitmap.getRowBytes() * bitmap.getHeight(); in getAllocationByteCount()
52 public int getAllocationByteCount(Bitmap bitmap) { in getAllocationByteCount() argument
53 return BitmapCompatHoneycombMr1.getAllocationByteCount(bitmap); in getAllocationByteCount()
59 public boolean hasMipMap(Bitmap bitmap){ in hasMipMap() argument
[all …]
/frameworks/base/packages/WallpaperCropper/src/com/android/gallery3d/common/
DBitmapUtils.java116 Bitmap bitmap, float scale, boolean recycle) { in resizeBitmapByScale() argument
117 int width = Math.round(bitmap.getWidth() * scale); in resizeBitmapByScale()
118 int height = Math.round(bitmap.getHeight() * scale); in resizeBitmapByScale()
119 if (width == bitmap.getWidth() in resizeBitmapByScale()
120 && height == bitmap.getHeight()) return bitmap; in resizeBitmapByScale()
121 Bitmap target = Bitmap.createBitmap(width, height, getConfig(bitmap)); in resizeBitmapByScale()
125 canvas.drawBitmap(bitmap, 0, 0, paint); in resizeBitmapByScale()
126 if (recycle) bitmap.recycle(); in resizeBitmapByScale()
130 private static Bitmap.Config getConfig(Bitmap bitmap) { in getConfig() argument
131 Bitmap.Config config = bitmap.getConfig(); in getConfig()
[all …]
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/tests/src/androidx/media/filterfw/samples/simplecamera/
DFaceSquareFilterTest.java62 Bitmap bitmap = BitmapFactory.decodeStream(assetMgr.open("XZZ019.jpg")); in testFaceSquareFilter() local
63 image.setBitmap(bitmap); in testFaceSquareFilter()
79 int[] pixels = new int[bitmap.getByteCount()]; in testFaceSquareFilter()
80 bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), in testFaceSquareFilter()
81 bitmap.getHeight()); in testFaceSquareFilter()
87 int top = (faceRect.top+HEIGHT_OFFSET)*bitmap.getHeight()/FACE_X_RANGE; in testFaceSquareFilter()
88 int bottom = (faceRect.bottom+HEIGHT_OFFSET)*bitmap.getHeight()/FACE_X_RANGE; in testFaceSquareFilter()
89 int left = (faceRect.left+WIDTH_OFFSET)*bitmap.getWidth()/FACE_X_RANGE; in testFaceSquareFilter()
90 int right = (faceRect.right+WIDTH_OFFSET)*bitmap.getWidth()/FACE_X_RANGE; in testFaceSquareFilter()
94 } else if (top > bitmap.getHeight()) { in testFaceSquareFilter()
[all …]
/frameworks/base/libs/hwui/
DTextureCache.cpp100 bool TextureCache::canMakeTextureFromBitmap(const SkBitmap* bitmap) { in canMakeTextureFromBitmap() argument
101 if (bitmap->width() > mMaxTextureSize || bitmap->height() > mMaxTextureSize) { in canMakeTextureFromBitmap()
103 bitmap->width(), bitmap->height(), mMaxTextureSize, mMaxTextureSize); in canMakeTextureFromBitmap()
111 Texture* TextureCache::getCachedTexture(const SkBitmap* bitmap, AtlasUsageType atlasUsageType) { in getCachedTexture() argument
113 AssetAtlas::Entry* entry = mAssetAtlas->getEntry(bitmap->pixelRef()); in getCachedTexture()
119 Texture* texture = mCache.get(bitmap->pixelRef()->getStableID()); in getCachedTexture()
122 if (!canMakeTextureFromBitmap(bitmap)) { in getCachedTexture()
126 const uint32_t size = bitmap->rowBytes() * bitmap->height(); in getCachedTexture()
141 texture->generation = bitmap->getGenerationID(); in getCachedTexture()
142 texture->upload(*bitmap); in getCachedTexture()
[all …]
DTexture.cpp168 static void uploadSkBitmapToTexture(const SkBitmap& bitmap, in uploadSkBitmapToTexture() argument
170 uploadToTexture(resize, format, type, bitmap.rowBytesAsPixels(), bitmap.bytesPerPixel(), in uploadSkBitmapToTexture()
171 bitmap.width(), bitmap.height(), bitmap.getPixels()); in uploadSkBitmapToTexture()
202 void Texture::upload(const SkBitmap& bitmap) { in upload() argument
203 SkAutoLockPixels alp(bitmap); in upload()
205 if (!bitmap.readyToDraw()) { in upload()
210 ATRACE_FORMAT("Upload %ux%u Texture", bitmap.width(), bitmap.height()); in upload()
218 bool needsAlloc = canMipMap && mipMap && !bitmap.hasHardwareMipMap(); in upload()
228 colorTypeToGlFormatAndType(bitmap.colorType(), &format, &type); in upload()
230 if (updateSize(bitmap.width(), bitmap.height(), format)) { in upload()
[all …]
DTextureCache.h78 bool prefetchAndMarkInUse(void* ownerToken, const SkBitmap* bitmap);
84 Texture* get(const SkBitmap* bitmap) { in get() argument
85 return get(bitmap, AtlasUsageType::Use); in get()
92 Texture* getAndBypassAtlas(const SkBitmap* bitmap) { in getAndBypassAtlas() argument
93 return get(bitmap, AtlasUsageType::Bypass); in getAndBypassAtlas()
134 bool canMakeTextureFromBitmap(const SkBitmap* bitmap);
136 Texture* get(const SkBitmap* bitmap, AtlasUsageType atlasUsageType);
137 Texture* getCachedTexture(const SkBitmap* bitmap, AtlasUsageType atlasUsageType);
/frameworks/base/core/jni/android/graphics/
DBitmap.cpp480 static FromColorProc ChooseFromColorProc(const SkBitmap& bitmap) { in ChooseFromColorProc() argument
481 switch (bitmap.colorType()) { in ChooseFromColorProc()
483 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D32 : FromColor_D32_Raw; in ChooseFromColorProc()
485 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D4444 : in ChooseFromColorProc()
722 SkBitmap bitmap; in Bitmap_creator() local
723 bitmap.setInfo(SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType)); in Bitmap_creator()
725 Bitmap* nativeBitmap = GraphicsJNI::allocateJavaPixelRef(env, &bitmap, NULL); in Bitmap_creator()
732 0, 0, width, height, bitmap); in Bitmap_creator()
750 Bitmap* bitmap = allocator.getStorageObjAndReset(); in Bitmap_copy() local
751 return GraphicsJNI::createBitmap(env, bitmap, in Bitmap_copy()
[all …]
DGraphics.cpp345 android::Bitmap* GraphicsJNI::getBitmap(JNIEnv* env, jobject bitmap) { in getBitmap() argument
347 SkASSERT(bitmap); in getBitmap()
348 SkASSERT(env->IsInstanceOf(bitmap, gBitmap_class)); in getBitmap()
349 jlong bitmapHandle = env->GetLongField(bitmap, gBitmap_nativePtr); in getBitmap()
355 void GraphicsJNI::getSkBitmap(JNIEnv* env, jobject bitmap, SkBitmap* outBitmap) { in getSkBitmap() argument
356 getBitmap(env, bitmap)->getSkBitmap(outBitmap); in getSkBitmap()
359 SkPixelRef* GraphicsJNI::refSkPixelRef(JNIEnv* env, jobject bitmap) { in refSkPixelRef() argument
360 return getBitmap(env, bitmap)->refPixelRef(); in refSkPixelRef()
409 jobject GraphicsJNI::createBitmap(JNIEnv* env, android::Bitmap* bitmap, in createBitmap() argument
416 assert_premultiplied(bitmap->info(), isPremultiplied); in createBitmap()
[all …]
/frameworks/opt/setupwizard/library/full-support/test/src/com/android/setupwizardlib/test/
DDividerItemDecorationTest.java62 Bitmap bitmap = drawDecoration(decoration, true, true); in testShouldDrawDividerBelowWithEitherCondition() local
73 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition()
75 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition()
76 bitmap = drawDecoration(decoration, false, true); in testShouldDrawDividerBelowWithEitherCondition()
78 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition()
80 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition()
81 bitmap = drawDecoration(decoration, true, false); in testShouldDrawDividerBelowWithEitherCondition()
86 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition()
88 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition()
89 bitmap = drawDecoration(decoration, false, false); in testShouldDrawDividerBelowWithEitherCondition()
[all …]
/frameworks/opt/photoviewer/src/com/android/ex/photo/loaders/
DPhotoBitmapLoader.java58 if (result.bitmap != null) { in loadInBackground()
59 result.bitmap.setDensity(DisplayMetrics.DENSITY_MEDIUM); in loadInBackground()
77 Bitmap bitmap = result != null ? result.bitmap : null; in deliverResult() local
81 if (bitmap != null) { in deliverResult()
82 onReleaseResources(bitmap); in deliverResult()
87 mBitmap = bitmap; in deliverResult()
98 if (oldBitmap != null && oldBitmap != bitmap && !oldBitmap.isRecycled()) { in deliverResult()
113 result.bitmap = mBitmap; in onStartLoading()
142 onReleaseResources(result.bitmap); in onCanceled()
168 protected void onReleaseResources(Bitmap bitmap) { in onReleaseResources() argument
[all …]
/frameworks/base/packages/WallpaperCropper/src/com/android/gallery3d/glrenderer/
DUploadedTexture.java124 Bitmap bitmap = sBorderLines.get(key); in getBorderLine() local
125 if (bitmap == null) { in getBorderLine()
126 bitmap = vertical in getBorderLine()
129 sBorderLines.put(key.clone(), bitmap); in getBorderLine() local
131 return bitmap; in getBorderLine()
166 protected abstract void onFreeBitmap(Bitmap bitmap); in onFreeBitmap() argument
193 Bitmap bitmap = getBitmap(); in updateContent() local
194 int format = GLUtils.getInternalFormat(bitmap); in updateContent()
195 int type = GLUtils.getType(bitmap); in updateContent()
196 canvas.texSubImage2D(this, mBorder, mBorder, bitmap, format, type); in updateContent()
[all …]
DBitmapTexture.java31 public BitmapTexture(Bitmap bitmap) { in BitmapTexture() argument
32 this(bitmap, false); in BitmapTexture()
35 public BitmapTexture(Bitmap bitmap, boolean hasBorder) { in BitmapTexture() argument
37 Assert.assertTrue(bitmap != null && !bitmap.isRecycled()); in BitmapTexture()
38 mContentBitmap = bitmap; in BitmapTexture()
42 protected void onFreeBitmap(Bitmap bitmap) { in onFreeBitmap() argument
/frameworks/base/libs/hwui/utils/
DNinePatchImpl.cpp34 static bool getColor(const SkBitmap& bitmap, int x, int y, SkColor* c) { in getColor() argument
35 switch (bitmap.colorType()) { in getColor()
37 *c = SkUnPreMultiply::PMColorToColor(*bitmap.getAddr32(x, y)); in getColor()
40 *c = SkPixel16ToPixel32(*bitmap.getAddr16(x, y)); in getColor()
44 SkPixel4444ToPixel32(*bitmap.getAddr16(x, y))); in getColor()
47 SkColorTable* ctable = bitmap.getColorTable(); in getColor()
49 (*ctable)[*bitmap.getAddr8(x, y)]); in getColor()
65 const SkBitmap& bitmap, const SkPaint& paint, in drawStretchyPatch() argument
74 if (!getColor(bitmap, src.fLeft, src.fTop, &c)) { in drawStretchyPatch()
85 canvas->drawBitmapRect(bitmap, SkRect::Make(src), dst, &paint); in drawStretchyPatch()
[all …]
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/
DFrameImage2D.java60 public void setBitmap(Bitmap bitmap) { in setBitmap() argument
61 bitmap = convertToFrameType(bitmap, mBackingStore.getFrameType()); in setBitmap()
62 validateBitmapSize(bitmap, mBackingStore.getDimensions()); in setBitmap()
64 backing.setData(bitmap); in setBitmap()
116 private static Bitmap convertToFrameType(Bitmap bitmap, FrameType type) { in convertToFrameType() argument
117 Bitmap.Config config = bitmap.getConfig(); in convertToFrameType()
118 Bitmap result = bitmap; in convertToFrameType()
122 result = bitmap.copy(Bitmap.Config.ARGB_8888, false); in convertToFrameType()
136 private void validateBitmapSize(Bitmap bitmap, int[] dimensions) { in validateBitmapSize() argument
137 if (bitmap.getWidth() != dimensions[0] || bitmap.getHeight() != dimensions[1]) { in validateBitmapSize()
[all …]
/frameworks/support/v7/palette/src/main/java/android/support/v7/graphics/
DPalette.java99 public static Builder from(Bitmap bitmap) { in from() argument
100 return new Builder(bitmap); in from()
116 public static Palette generate(Bitmap bitmap) { in generate() argument
117 return from(bitmap).generate(); in generate()
124 public static Palette generate(Bitmap bitmap, int numColors) { in generate() argument
125 return from(bitmap).maximumColorCount(numColors).generate(); in generate()
133 Bitmap bitmap, PaletteAsyncListener listener) { in generateAsync() argument
134 return from(bitmap).generate(listener); in generateAsync()
142 final Bitmap bitmap, final int numColors, final PaletteAsyncListener listener) { in generateAsync() argument
143 return from(bitmap).maximumColorCount(numColors).generate(listener); in generateAsync()
[all …]
/frameworks/support/v4/java/android/support/v4/app/
DSharedElementCallback.java174 Bitmap bitmap = createDrawableBitmap(d); in onCaptureSharedElementSnapshot() local
175 if (bitmap != null) { in onCaptureSharedElementSnapshot()
177 bundle.putParcelable(BUNDLE_SNAPSHOT_BITMAP, bitmap); in onCaptureSharedElementSnapshot()
192 Bitmap bitmap = null; in onCaptureSharedElementSnapshot() local
203 bitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Bitmap.Config.ARGB_8888); in onCaptureSharedElementSnapshot()
204 Canvas canvas = new Canvas(bitmap); in onCaptureSharedElementSnapshot()
208 return bitmap; in onCaptureSharedElementSnapshot()
227 Bitmap bitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Bitmap.Config.ARGB_8888); in createDrawableBitmap() local
228 Canvas canvas = new Canvas(bitmap); in createDrawableBitmap()
237 return bitmap; in createDrawableBitmap()
[all …]
/frameworks/support/v7/palette/src/androidTest/java/android/support/v7/graphics/
DBucketTests.java102 final Bitmap bitmap = Bitmap.createBitmap(1000, 1, Bitmap.Config.ARGB_8888); in testOnePixelTallBitmap() local
104 Palette.Builder b = new Palette.Builder(bitmap); in testOnePixelTallBitmap()
111 final Bitmap bitmap = Bitmap.createBitmap(1, 1000, Bitmap.Config.ARGB_8888); in testOnePixelWideBitmap() local
113 Palette.Builder b = new Palette.Builder(bitmap); in testOnePixelWideBitmap()
120 final Bitmap bitmap = Bitmap.createBitmap(300, 300, Bitmap.Config.ARGB_8888); in testBlueBitmapReturnsBlueSwatch() local
121 Canvas canvas = new Canvas(bitmap); in testBlueBitmapReturnsBlueSwatch()
124 final Palette palette = Palette.from(bitmap).generate(); in testBlueBitmapReturnsBlueSwatch()
135 final Bitmap bitmap = Bitmap.createBitmap(300, 300, Bitmap.Config.ARGB_8888); in testBlueBitmapWithRegionReturnsBlueSwatch() local
136 Canvas canvas = new Canvas(bitmap); in testBlueBitmapWithRegionReturnsBlueSwatch()
139 final Palette palette = Palette.from(bitmap) in testBlueBitmapWithRegionReturnsBlueSwatch()
[all …]
/frameworks/opt/setupwizard/library/test/src/com/android/setupwizardlib/test/
DGlifPatternDrawableTest.java33 final Bitmap bitmap = Bitmap.createBitmap(1366, 768, Bitmap.Config.ARGB_8888); in testDraw() local
34 final Canvas canvas = new Canvas(bitmap); in testDraw()
40 assertEquals("Top left pixel should be #ed0000", 0xffed0000, bitmap.getPixel(0, 0)); in testDraw()
41 assertEquals("Center pixel should be #d30000", 0xffd30000, bitmap.getPixel(683, 384)); in testDraw()
43 bitmap.getPixel(1365, 767)); in testDraw()
51 final Bitmap bitmap = Bitmap.createBitmap(1366, 768, Bitmap.Config.ARGB_8888); in testDrawTwice() local
52 final Canvas canvas = new Canvas(bitmap); in testDrawTwice()
64 assertEquals("Top left pixel should be #ed0000", 0xffed0000, bitmap.getPixel(0, 0)); in testDrawTwice()
65 assertEquals("Center pixel should be #d30000", 0xffd30000, bitmap.getPixel(683, 384)); in testDrawTwice()
67 bitmap.getPixel(1365, 767)); in testDrawTwice()
/frameworks/rs/java/tests/Refocus/src/com/android/rs/test/
DRGBZ.java27 private Bitmap bitmap; field in RGBZ
46 this.bitmap = setAlphaChannel(preview, this.depthBitmap); in RGBZ()
61 return bitmap; in getBitmap()
87 return bitmap.getWidth(); in getWidth()
94 return bitmap.getHeight(); in getHeight()
116 public Bitmap setAlphaChannel(Bitmap bitmap, Bitmap depthBitmap) { in setAlphaChannel() argument
117 if (bitmap == null) { in setAlphaChannel()
118 return bitmap; in setAlphaChannel()
120 Bitmap result = bitmap.copy(Bitmap.Config.ARGB_8888, true); in setAlphaChannel()
122 result = setAlphaChannelFromBitmap(depthBitmap, bitmap, result); in setAlphaChannel()
/frameworks/base/packages/PrintSpooler/src/com/android/printspooler/util/
DBitmapSerializeUtils.java43 public static void readBitmapPixels(Bitmap bitmap, ParcelFileDescriptor source) { in readBitmapPixels() argument
44 nativeReadBitmapPixels(bitmap, source.getFd()); in readBitmapPixels()
53 public static void writeBitmapPixels(Bitmap bitmap, ParcelFileDescriptor destination) { in writeBitmapPixels() argument
54 nativeWriteBitmapPixels(bitmap, destination.getFd()); in writeBitmapPixels()
57 private static native void nativeReadBitmapPixels(Bitmap bitmap, int fd); in nativeReadBitmapPixels() argument
59 private static native void nativeWriteBitmapPixels(Bitmap bitmap, int fd); in nativeWriteBitmapPixels() argument
/frameworks/base/core/java/android/view/
DAppTransitionAnimationSpec.java18 public final Bitmap bitmap; field in AppTransitionAnimationSpec
21 public AppTransitionAnimationSpec(int taskId, Bitmap bitmap, Rect rect) { in AppTransitionAnimationSpec() argument
23 this.bitmap = bitmap; in AppTransitionAnimationSpec()
29 bitmap = in.readParcelable(null); in AppTransitionAnimationSpec()
41 dest.writeParcelable(bitmap, 0 /* flags */); in writeToParcel()
59 return "{taskId: " + taskId + ", bitmap: " + bitmap + ", rect: " + rect + "}"; in toString()
/frameworks/opt/bitmap/src/com/android/bitmap/drawable/
DCircularBitmapDrawable.java17 package com.android.bitmap.drawable;
32 import com.android.bitmap.BitmapCache;
105 Bitmap bitmap = placeholder.getBitmap(); in onDrawPlaceholderOrProgress() local
107 mRect.set(0, 0, bitmap.getWidth(), bitmap.getHeight()); in onDrawPlaceholderOrProgress()
108 onDrawCircularBitmap(bitmap, canvas, mRect, bounds, alpha); in onDrawPlaceholderOrProgress()
122 protected void onDrawCircularBitmap(final Bitmap bitmap, final Canvas canvas, in onDrawCircularBitmap() argument
124 onDrawCircularBitmap(bitmap, canvas, src, dst, 1f); in onDrawCircularBitmap()
131 protected void onDrawCircularBitmap(final Bitmap bitmap, final Canvas canvas, in onDrawCircularBitmap() argument
135 if (shader == null || mShaderBitmap != bitmap) { in onDrawCircularBitmap()
136 shader = new BitmapShader(bitmap, TileMode.CLAMP, TileMode.CLAMP); in onDrawCircularBitmap()
[all …]
/frameworks/base/libs/hwui/tests/unit/
DSkiaBehaviorTests.cpp37 SkBitmap bitmap; in TEST() local
39 ASSERT_TRUE(s->isABitmap(&bitmap, nullptr, xy)) in TEST()
43 EXPECT_EQ(origBitmap.pixelRef(), bitmap.pixelRef()); in TEST()
47 SkBitmap bitmap = TestUtils::createSkBitmap(100, 100); in TEST() local
48 uint32_t genId = bitmap.getGenerationID(); in TEST()
49 bitmap.notifyPixelsChanged(); in TEST()
50 EXPECT_NE(genId, bitmap.getGenerationID()); in TEST()
/frameworks/base/docs/html/training/displaying-bitmaps/
Dmanage-memory.jd36 <p>In addition to the steps described in <a href="cache-bitmap.html">Caching Bitmaps</a>,
38 and bitmap reuse. The recommended strategy depends on which version(s)
44 bitmap memory has evolved:</p>
51 the memory is reclaimed soon after a bitmap is no longer referenced.</strong>
55 bitmap is stored in native memory. It is separate from the bitmap itself,
60 Dalvik heap along with the associated bitmap.</strong></li>
64 <p>The following sections describe how to optimize bitmap memory
71 is recommended. If you're displaying large amounts of bitmap data in your app,
79 bitmap is no longer being used. If you call {@link android.graphics.Bitmap#recycle recycle()}
80 and later attempt to draw the bitmap, you will get the error:
[all …]

12345678910>>...16