/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.getNativeInstance()); 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.getNativeInstance()); in getType() 99 Bitmap bitmap, int border) { in texImage2D() argument 100 if (bitmap == null) { in texImage2D() [all …]
|
/frameworks/base/core/jni/android/graphics/ |
D | Bitmap.cpp | 47 explicit BitmapWrapper(Bitmap* bitmap) in BitmapWrapper() argument 48 : mBitmap(bitmap) { } in BitmapWrapper() 64 Bitmap& bitmap() { in bitmap() function in android::BitmapWrapper 159 return mBitmapWrapper->bitmap().pixels(); in pixels() 170 namespace bitmap { namespace 195 jobject createBitmap(JNIEnv* env, Bitmap* bitmap, in createBitmap() argument 202 assert_premultiplied(bitmap->info(), isPremultiplied); in createBitmap() 203 bool fromMalloc = bitmap->pixelStorageType() == PixelStorageType::Heap; in createBitmap() 204 BitmapWrapper* bitmapWrapper = new BitmapWrapper(bitmap); in createBitmap() 206 bitmapWrapper->bitmap().setImmutable(); in createBitmap() [all …]
|
D | Bitmap.h | 28 namespace bitmap { 36 jobject createBitmap(JNIEnv* env, Bitmap* bitmap, 43 Bitmap& toBitmap(JNIEnv* env, jobject bitmap); 47 void imageInfo(JNIEnv* env, jobject bitmap, AndroidBitmapInfo* info); 49 void* lockPixels(JNIEnv* env, jobject bitmap); 51 bool unlockPixels(JNIEnv* env, jobject bitmap);
|
/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/libs/hwui/ |
D | Readback.cpp | 38 CopyResult Readback::copySurfaceInto(Surface& surface, const Rect& srcRect, SkBitmap* bitmap) { in copySurfaceInto() argument 72 return copyImageInto(image, texTransform, srcRect, bitmap); in copySurfaceInto() 75 CopyResult Readback::copyHWBitmapInto(Bitmap* hwBitmap, SkBitmap* bitmap) { in copyHWBitmapInto() argument 83 return copyImageInto(hwBitmap->makeImage(), transform, srcRect, bitmap); in copyHWBitmapInto() 86 CopyResult Readback::copyLayerInto(DeferredLayerUpdater* deferredLayer, SkBitmap* bitmap) { in copyLayerInto() argument 95 const SkRect dstRect = SkRect::MakeIWH(bitmap->width(), bitmap->height()); in copyLayerInto() 99 if (copyLayerInto(layer, nullptr, &dstRect, bitmap)) { in copyLayerInto() 107 const Rect& srcRect, SkBitmap* bitmap) { in copyImageInto() argument 121 if (bitmap->colorType() == kRGBA_F16_SkColorType && in copyImageInto() 122 !grContext->colorTypeSupportedAsSurface(bitmap->colorType())) { in copyImageInto() [all …]
|
D | HardwareBitmapUploader.cpp | 73 bool uploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in uploadHardwareBitmap() argument 77 bool result = onUploadHardwareBitmap(bitmap, format, graphicBuffer); in uploadHardwareBitmap() 95 virtual bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, 167 bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in onUploadHardwareBitmap() argument 186 ATRACE_FORMAT("CPU -> gralloc transfer (%dx%d)", bitmap.width(), bitmap.height()); in onUploadHardwareBitmap() 196 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap.width(), bitmap.height(), in onUploadHardwareBitmap() 197 format.format, format.type, bitmap.getPixels()); in onUploadHardwareBitmap() 265 bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in onUploadHardwareBitmap() argument 272 bitmap.pixmap(), reinterpret_cast<AHardwareBuffer*>(graphicBuffer.get())); in onUploadHardwareBitmap() 351 SkBitmap bitmap; in makeHwCompatible() local [all …]
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/glwallpaper/ |
D | ImageProcessHelper.java | 69 void start(Bitmap bitmap) { in start() argument 70 new ThresholdComputeTask(mHandler).execute(bitmap); in start() 87 Bitmap bitmap = bitmaps[0]; in doInBackground() local 88 if (bitmap != null) { in doInBackground() 89 return new Threshold().compute(bitmap); in doInBackground() 103 public float compute(Bitmap bitmap) { in compute() argument 104 Bitmap grayscale = toGrayscale(bitmap); in compute() 115 private Bitmap toGrayscale(Bitmap bitmap) { in toGrayscale() argument 116 int width = bitmap.getWidth(); in toGrayscale() 117 int height = bitmap.getHeight(); in toGrayscale() [all …]
|
/frameworks/base/libs/input/ |
D | SpriteIcon.h | 30 inline SpriteIcon(const SkBitmap& bitmap, int32_t style, float hotSpotX, float hotSpotY) : in SpriteIcon() 31 bitmap(bitmap), style(style), hotSpotX(hotSpotX), hotSpotY(hotSpotY) { } in SpriteIcon() 33 SkBitmap bitmap; member 40 if (bitmapCopy.tryAllocPixels(bitmap.info().makeColorType(kN32_SkColorType))) { in copy() 41 bitmap.readPixels(bitmapCopy.info(), bitmapCopy.getPixels(), bitmapCopy.rowBytes(), in copy() 48 bitmap.reset(); in reset() 54 inline bool isValid() const { return !bitmap.isNull() && !bitmap.empty(); } in isValid() 56 inline int32_t width() const { return bitmap.width(); } in width() 57 inline int32_t height() const { return bitmap.height(); } in height()
|
/frameworks/opt/setupwizard/library/recyclerview/test/instrumentation/src/com/android/setupwizardlib/test/ |
D | DividerItemDecorationTest.java | 69 Bitmap bitmap = drawDecoration(decoration, true, true); in testShouldDrawDividerBelowWithEitherCondition() local 80 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition() 82 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition() 83 bitmap = drawDecoration(decoration, false, true); in testShouldDrawDividerBelowWithEitherCondition() 85 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition() 87 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition() 88 bitmap = drawDecoration(decoration, true, false); in testShouldDrawDividerBelowWithEitherCondition() 93 assertBitmapEquals(expectedBitmap, bitmap); in testShouldDrawDividerBelowWithEitherCondition() 95 bitmap.recycle(); in testShouldDrawDividerBelowWithEitherCondition() 96 bitmap = drawDecoration(decoration, false, false); in testShouldDrawDividerBelowWithEitherCondition() [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 Utils.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/opt/setupwizard/library/main/src/com/android/setupwizardlib/ |
D | GlifPatternDrawable.java | 107 Bitmap bitmap = null; in draw() local 109 bitmap = bitmapCache.get(); in draw() 111 if (bitmap != null) { in draw() 112 final int bitmapWidth = bitmap.getWidth(); in draw() 113 final int bitmapHeight = bitmap.getHeight(); in draw() 117 bitmap = null; in draw() 120 bitmap = null; in draw() 124 if (bitmap == null) { in draw() 128 bitmap = createBitmapCache(drawableWidth, drawableHeight); in draw() 129 bitmapCache = new SoftReference<>(bitmap); in draw() [all …]
|
/frameworks/base/libs/hwui/pipeline/skia/ |
D | SkiaRecordingCanvas.cpp | 188 void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float left, float top, const SkPaint* paint) { in drawBitmap() argument 189 sk_sp<SkImage> image = bitmap.makeImage(); in drawBitmap() 190 mRecorder.drawImage(image, left, top, filterBitmap(paint), bitmap.palette()); in drawBitmap() 194 if (!bitmap.isImmutable() && image.get() && !image->unique()) { in drawBitmap() 199 void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) { in drawBitmap() argument 203 sk_sp<SkImage> image = bitmap.makeImage(); in drawBitmap() 204 mRecorder.drawImage(image, 0, 0, filterBitmap(paint), bitmap.palette()); in drawBitmap() 205 if (!bitmap.isImmutable() && image.get() && !image->unique()) { in drawBitmap() 210 void SkiaRecordingCanvas::drawBitmap(Bitmap& bitmap, float srcLeft, float srcTop, float srcRight, in drawBitmap() argument 216 sk_sp<SkImage> image = bitmap.makeImage(); in drawBitmap() [all …]
|
/frameworks/base/core/java/com/android/internal/graphics/palette/ |
D | Palette.java | 103 public static Palette.Builder from(Bitmap bitmap) { in from() argument 104 return new Palette.Builder(bitmap); in from() 120 public static Palette generate(Bitmap bitmap) { in generate() argument 121 return from(bitmap).generate(); in generate() 128 public static Palette generate(Bitmap bitmap, int numColors) { in generate() argument 129 return from(bitmap).maximumColorCount(numColors).generate(); in generate() 137 Bitmap bitmap, Palette.PaletteAsyncListener listener) { in generateAsync() argument 138 return from(bitmap).generate(listener); in generateAsync() 146 final Bitmap bitmap, final int numColors, final Palette.PaletteAsyncListener listener) { in generateAsync() argument 147 return from(bitmap).maximumColorCount(numColors).generate(listener); in generateAsync() [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/base/tests/UiBench/src/com/android/test/uibench/leanback/ |
D | BitmapLoader.java | 94 Bitmap bitmap = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.ARGB_8888); in doInBackground() local 95 Canvas canvas = new Canvas(bitmap); in doInBackground() 99 bitmap.prepareToDraw(); in doInBackground() 100 return bitmap; in doInBackground() 111 protected void onPostExecute(Bitmap bitmap) { in onPostExecute() argument 114 sLruCache.put(mId, bitmap); in onPostExecute() 115 mImageView.setImageBitmap(bitmap); in onPostExecute() 122 Bitmap bitmap = getLruCache(context).get(id); in loadBitmap() local 123 if (bitmap != null) { in loadBitmap() 124 view.setImageBitmap(bitmap); in loadBitmap()
|
/frameworks/base/core/java/android/app/ |
D | SharedElementCallback.java | 183 Bitmap bitmap = TransitionUtils.createDrawableBitmap(d, imageView); in onCaptureSharedElementSnapshot() local 184 if (bitmap != null) { in onCaptureSharedElementSnapshot() 186 if (bitmap.getConfig() != Bitmap.Config.HARDWARE) { in onCaptureSharedElementSnapshot() 187 bundle.putParcelable(BUNDLE_SNAPSHOT_BITMAP, bitmap); in onCaptureSharedElementSnapshot() 189 GraphicBuffer graphicBuffer = bitmap.createGraphicBufferHandle(); in onCaptureSharedElementSnapshot() 191 ColorSpace cs = bitmap.getColorSpace(); in onCaptureSharedElementSnapshot() 239 Bitmap bitmap = bundle.getParcelable(BUNDLE_SNAPSHOT_BITMAP); in onCreateSnapshotView() local 240 if (buffer == null && bitmap == null) { in onCreateSnapshotView() 243 if (bitmap == null) { in onCreateSnapshotView() 249 bitmap = Bitmap.wrapHardwareBuffer(HardwareBuffer.createFromGraphicBuffer(buffer), in onCreateSnapshotView() [all …]
|
D | WallpaperColors.java | 134 Bitmap bitmap = Bitmap.createBitmap(optimalSize.getWidth(), optimalSize.getHeight(), in fromDrawable() local 136 final Canvas bmpCanvas = new Canvas(bitmap); in fromDrawable() 137 drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight()); in fromDrawable() 140 final WallpaperColors colors = WallpaperColors.fromBitmap(bitmap); in fromDrawable() 141 bitmap.recycle(); in fromDrawable() 154 public static WallpaperColors fromBitmap(@NonNull Bitmap bitmap) { in fromBitmap() argument 155 if (bitmap == null) { in fromBitmap() 159 final int bitmapArea = bitmap.getWidth() * bitmap.getHeight(); in fromBitmap() 163 Size optimalSize = calculateOptimalSize(bitmap.getWidth(), bitmap.getHeight()); in fromBitmap() 164 bitmap = Bitmap.createScaledBitmap(bitmap, optimalSize.getWidth(), in fromBitmap() [all …]
|
/frameworks/base/core/tests/coretests/src/android/content/ |
D | ContentResolverTest.java | 71 final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); in initImage() local 72 final Canvas canvas = new Canvas(bitmap); in initImage() 81 bitmap.compress(Bitmap.CompressFormat.PNG, 90, mImage.getOutputStream()); in initImage() 88 private static void assertImageAspectAndContents(Bitmap bitmap) { in assertImageAspectAndContents() argument 91 final int after = (100 * bitmap.getWidth()) / bitmap.getHeight(); in assertImageAspectAndContents() 95 final int halfX = bitmap.getWidth() / 2; in assertImageAspectAndContents() 96 final int halfY = bitmap.getHeight() / 2; in assertImageAspectAndContents() 97 assertEquals(Color.BLUE, bitmap.getPixel(halfX - 10, halfY - 10)); in assertImageAspectAndContents() 98 assertEquals(Color.RED, bitmap.getPixel(halfX + 10, halfY - 10)); in assertImageAspectAndContents() 99 assertEquals(Color.RED, bitmap.getPixel(halfX - 10, halfY + 10)); in assertImageAspectAndContents() [all …]
|
/frameworks/rs/tests/java_api/Refocus/src/com/android/rs/test/ |
D | RGBZ.java | 41 private Bitmap bitmap; field in RGBZ 61 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ() 80 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ() 89 bitmap = setAlphaChannel(preview, depthBitmap); in RGBZ() 128 return bitmap; in getBitmap() 154 return bitmap.getWidth(); in getWidth() 161 return bitmap.getHeight(); in getHeight() 183 public Bitmap setAlphaChannel(Bitmap bitmap, Bitmap depthBitmap) { in setAlphaChannel() argument 184 if (bitmap == null) { in setAlphaChannel() 185 return bitmap; in setAlphaChannel() [all …]
|
/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 …]
|
/frameworks/base/core/java/com/android/internal/app/ |
D | SimpleIconFactory.java | 181 Bitmap bitmap = createIconBitmap(icon, scale[0]); in createUserBadgedIconBitmap() local 183 mCanvas.setBitmap(bitmap); in createUserBadgedIconBitmap() 184 recreateIcon(Bitmap.createBitmap(bitmap), mCanvas); in createUserBadgedIconBitmap() 190 BitmapDrawable drawable = new FixedSizeBitmapDrawable(bitmap); in createUserBadgedIconBitmap() 198 result = bitmap; in createUserBadgedIconBitmap() 233 Bitmap bitmap = createIconBitmap(icon, scale); in createAppBadgedIconBitmap() local 234 bitmap = maskBitmapToCircle(bitmap); in createAppBadgedIconBitmap() 235 icon = new BitmapDrawable(mContext.getResources(), bitmap); in createAppBadgedIconBitmap() 239 bitmap = createIconBitmap(icon, scale); in createAppBadgedIconBitmap() 241 mCanvas.setBitmap(bitmap); in createAppBadgedIconBitmap() [all …]
|