/frameworks/base/opengl/java/android/opengl/ |
D | GLUtils.java | 40 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/ |
D | BitmapCompat.java | 29 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/libs/hwui/ |
D | TextureCache.cpp | 134 bool TextureCache::canMakeTextureFromBitmap(const SkBitmap* bitmap) { in canMakeTextureFromBitmap() argument 135 if (bitmap->width() > mMaxTextureSize || bitmap->height() > mMaxTextureSize) { in canMakeTextureFromBitmap() 137 bitmap->width(), bitmap->height(), mMaxTextureSize, mMaxTextureSize); in canMakeTextureFromBitmap() 145 Texture* TextureCache::getCachedTexture(const SkBitmap* bitmap, AtlasUsageType atlasUsageType) { in getCachedTexture() argument 147 AssetAtlas::Entry* entry = mAssetAtlas->getEntry(bitmap); in getCachedTexture() 153 Texture* texture = mCache.get(bitmap->pixelRef()->getStableID()); in getCachedTexture() 156 if (!canMakeTextureFromBitmap(bitmap)) { in getCachedTexture() 160 const uint32_t size = bitmap->rowBytes() * bitmap->height(); in getCachedTexture() 175 generateTexture(bitmap, texture, false); in getCachedTexture() 179 bitmap, texture->id, size, mSize); in getCachedTexture() [all …]
|
D | TextureCache.h | 76 bool prefetchAndMarkInUse(void* ownerToken, const SkBitmap* bitmap); 82 Texture* get(const SkBitmap* bitmap) { in get() argument 83 return get(bitmap, AtlasUsageType::Use); in get() 90 Texture* getAndBypassAtlas(const SkBitmap* bitmap) { in getAndBypassAtlas() argument 91 return get(bitmap, AtlasUsageType::Bypass); in getAndBypassAtlas() 141 bool canMakeTextureFromBitmap(const SkBitmap* bitmap); 143 Texture* get(const SkBitmap* bitmap, AtlasUsageType atlasUsageType); 144 Texture* getCachedTexture(const SkBitmap* bitmap, AtlasUsageType atlasUsageType); 152 void generateTexture(const SkBitmap* bitmap, Texture* texture, bool regenerate = false); 154 void uploadLoFiTexture(bool resize, const SkBitmap* bitmap, uint32_t width, uint32_t height);
|
D | LayerRenderer.cpp | 353 bool LayerRenderer::copyLayer(RenderState& renderState, Layer* layer, SkBitmap* bitmap) { in copyLayer() argument 356 && bitmap->width() <= caches.maxTextureSize in copyLayer() 357 && bitmap->height() <= caches.maxTextureSize) { in copyLayer() 365 SkAutoLockPixels alp(*bitmap); in copyLayer() 378 switch (bitmap->colorType()) { in copyLayer() 415 glPixelStorei(GL_PACK_ALIGNMENT, bitmap->bytesPerPixel()); in copyLayer() 423 glTexImage2D(GL_TEXTURE_2D, 0, format, bitmap->width(), bitmap->height(), in copyLayer() 433 renderer.setViewport(bitmap->width(), bitmap->height()); in copyLayer() 435 bitmap->width(), bitmap->height(), !layer->isBlend()); in copyLayer() 438 renderer.translate(0.0f, bitmap->height()); in copyLayer() [all …]
|
/frameworks/base/packages/WallpaperCropper/src/com/android/gallery3d/common/ |
D | BitmapUtils.java | 116 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/ |
D | FaceSquareFilterTest.java | 62 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/core/jni/android/graphics/ |
D | Bitmap.cpp | 486 static FromColorProc ChooseFromColorProc(const SkBitmap& bitmap) { in ChooseFromColorProc() argument 487 switch (bitmap.colorType()) { in ChooseFromColorProc() 489 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D32 : FromColor_D32_Raw; in ChooseFromColorProc() 491 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D4444 : in ChooseFromColorProc() 728 SkBitmap bitmap; in Bitmap_creator() local 729 bitmap.setInfo(SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType)); in Bitmap_creator() 731 Bitmap* nativeBitmap = GraphicsJNI::allocateJavaPixelRef(env, &bitmap, NULL); in Bitmap_creator() 738 0, 0, width, height, bitmap); in Bitmap_creator() 756 Bitmap* bitmap = allocator.getStorageObjAndReset(); in Bitmap_copy() local 757 return GraphicsJNI::createBitmap(env, bitmap, in Bitmap_copy() [all …]
|
D | NinePatchImpl.cpp | 36 static bool getColor(const SkBitmap& bitmap, int x, int y, SkColor* c) { in getColor() argument 37 switch (bitmap.colorType()) { in getColor() 39 *c = SkUnPreMultiply::PMColorToColor(*bitmap.getAddr32(x, y)); in getColor() 42 *c = SkPixel16ToPixel32(*bitmap.getAddr16(x, y)); in getColor() 46 SkPixel4444ToPixel32(*bitmap.getAddr16(x, y))); in getColor() 49 SkColorTable* ctable = bitmap.getColorTable(); in getColor() 51 (*ctable)[*bitmap.getAddr8(x, y)]); in getColor() 67 const SkBitmap& bitmap, const SkPaint& paint, in drawStretchyPatch() argument 76 if (!getColor(bitmap, src.fLeft, src.fTop, &c)) { in drawStretchyPatch() 87 canvas->drawBitmapRect(bitmap, &src, dst, &paint); in drawStretchyPatch() [all …]
|
D | Graphics.cpp | 345 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 …]
|
D | NinePatch.cpp | 35 extern void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds, const SkBitmap& bitmap, 91 static void draw(JNIEnv* env, SkCanvas* canvas, SkRect& bounds, const SkBitmap& bitmap, in draw() argument 97 NinePatch_Draw(canvas, bounds, bitmap, *chunk, paint, NULL); in draw() 114 NinePatch_Draw(canvas, bounds, bitmap, *chunk, paint, NULL); in draw() 131 SkBitmap bitmap; in drawF() local 132 GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap); in drawF() 136 draw(env, canvas, bounds, bitmap, chunk, paint, destDensity, srcDensity); in drawF() 150 SkBitmap bitmap; in drawI() local 151 GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap); in drawI() 154 draw(env, canvas, bounds, bitmap, chunk, paint, destDensity, srcDensity); in drawI() [all …]
|
/frameworks/opt/photoviewer/src/com/android/ex/photo/loaders/ |
D | PhotoBitmapLoader.java | 58 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/ |
D | UploadedTexture.java | 124 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 …]
|
D | BitmapTexture.java | 31 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/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/ |
D | FrameImage2D.java | 60 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/v4/java/android/support/v4/app/ |
D | SharedElementCallback.java | 174 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/base/packages/PrintSpooler/src/com/android/printspooler/util/ |
D | BitmapSerializeUtils.java | 43 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/opt/bitmap/src/com/android/bitmap/drawable/ |
D | CircularBitmapDrawable.java | 17 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 …]
|
D | BasicBitmapDrawable.java | 16 package com.android.bitmap.drawable; 28 import com.android.bitmap.BitmapCache; 29 import com.android.bitmap.DecodeTask; 30 import com.android.bitmap.DecodeTask.DecodeCallback; 31 import com.android.bitmap.DecodeTask.DecodeOptions; 32 import com.android.bitmap.NamedThreadFactory; 33 import com.android.bitmap.RequestKey; 34 import com.android.bitmap.RequestKey.Cancelable; 35 import com.android.bitmap.RequestKey.FileDescriptorFactory; 36 import com.android.bitmap.ReusableBitmap; [all …]
|
/frameworks/support/v7/palette/src/main/java/android/support/v7/graphics/ |
D | Palette.java | 93 public static Builder from(Bitmap bitmap) { in from() argument 94 return new Builder(bitmap); in from() 110 public static Palette generate(Bitmap bitmap) { in generate() argument 111 return from(bitmap).generate(); in generate() 118 public static Palette generate(Bitmap bitmap, int numColors) { in generate() argument 119 return from(bitmap).maximumColorCount(numColors).generate(); in generate() 127 Bitmap bitmap, PaletteAsyncListener listener) { in generateAsync() argument 128 return from(bitmap).generate(listener); in generateAsync() 136 final Bitmap bitmap, final int numColors, final PaletteAsyncListener listener) { in generateAsync() argument 137 return from(bitmap).maximumColorCount(numColors).generate(listener); in generateAsync() [all …]
|
/frameworks/base/docs/html/training/displaying-bitmaps/ |
D | manage-memory.jd | 36 <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 …]
|
/frameworks/base/graphics/java/android/graphics/ |
D | Canvas.java | 140 public Canvas(@NonNull Bitmap bitmap) { in Canvas() argument 141 if (!bitmap.isMutable()) { in Canvas() 144 throwIfCannotDraw(bitmap); in Canvas() 145 mNativeCanvasWrapper = initRaster(bitmap); in Canvas() 147 mBitmap = bitmap; in Canvas() 148 mDensity = bitmap.mDensity; in Canvas() 196 public void setBitmap(@Nullable Bitmap bitmap) { in setBitmap() argument 201 if (bitmap == null) { in setBitmap() 205 if (!bitmap.isMutable()) { in setBitmap() 208 throwIfCannotDraw(bitmap); in setBitmap() [all …]
|
/frameworks/support/v4/jellybean-mr2/android/support/v4/graphics/ |
D | BitmapCompatJellybeanMR2.java | 21 public static boolean hasMipMap(Bitmap bitmap) { in hasMipMap() argument 22 return bitmap.hasMipMap(); in hasMipMap() 25 public static void setHasMipMap(Bitmap bitmap, boolean hasMipMap) { in setHasMipMap() argument 26 bitmap.setHasMipMap(hasMipMap); in setHasMipMap()
|
/frameworks/base/media/java/android/media/ |
D | ThumbnailUtils.java | 93 Bitmap bitmap = null; in createImageThumbnail() local 97 bitmap = sizedThumbnailBitmap.mBitmap; in createImageThumbnail() 100 if (bitmap == null) { in createImageThumbnail() 119 bitmap = BitmapFactory.decodeFileDescriptor(fd, null, options); in createImageThumbnail() 138 bitmap = extractThumbnail(bitmap, in createImageThumbnail() 142 return bitmap; in createImageThumbnail() 153 Bitmap bitmap = null; in createVideoThumbnail() local 157 bitmap = retriever.getFrameAtTime(-1); in createVideoThumbnail() 170 if (bitmap == null) return null; in createVideoThumbnail() 174 int width = bitmap.getWidth(); in createVideoThumbnail() [all …]
|
/frameworks/base/core/java/android/app/ |
D | SharedElementCallback.java | 176 Bitmap bitmap = TransitionUtils.createDrawableBitmap(d); in onCaptureSharedElementSnapshot() local 177 if (bitmap != null) { in onCaptureSharedElementSnapshot() 179 bundle.putParcelable(BUNDLE_SNAPSHOT_BITMAP, bitmap); in onCaptureSharedElementSnapshot() 221 Bitmap bitmap = (Bitmap) bundle.getParcelable(BUNDLE_SNAPSHOT_BITMAP); in onCreateSnapshotView() local 222 if (bitmap == null) { in onCreateSnapshotView() 227 imageView.setImageBitmap(bitmap); in onCreateSnapshotView() 237 Bitmap bitmap = (Bitmap) snapshot; in onCreateSnapshotView() local 240 view.setBackground(new BitmapDrawable(resources, bitmap)); in onCreateSnapshotView()
|