Home
last modified time | relevance | path

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

12345678910>>...15

/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/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/
DNotificationMemoryViewWalkerTest.kt77 icon.bitmap.allocationByteCount, in testViewWalker_plainNotification_withPublicView()
82 icon.bitmap.allocationByteCount in testViewWalker_plainNotification_withPublicView()
89 icon.bitmap.allocationByteCount, in testViewWalker_plainNotification_withPublicView()
94 icon.bitmap.allocationByteCount in testViewWalker_plainNotification_withPublicView()
101 publicIcon.bitmap.allocationByteCount, in testViewWalker_plainNotification_withPublicView()
106 publicIcon.bitmap.allocationByteCount in testViewWalker_plainNotification_withPublicView()
113 icon.bitmap.allocationByteCount + publicIcon.bitmap.allocationByteCount, in testViewWalker_plainNotification_withPublicView()
118 icon.bitmap.allocationByteCount + publicIcon.bitmap.allocationByteCount in testViewWalker_plainNotification_withPublicView()
144 icon.bitmap.allocationByteCount, in testViewWalker_bigPictureNotification()
145 largeIcon.bitmap.allocationByteCount, in testViewWalker_bigPictureNotification()
[all …]
DNotificationMemoryMeterTest.kt49 smallIcon = notification.smallIcon.bitmap.allocationByteCount, in currentNotificationMemoryUse_plainNotification()
50 largeIcon = notification.getLargeIcon().bitmap.allocationByteCount, in currentNotificationMemoryUse_plainNotification()
69 smallIcon = notification.smallIcon.bitmap.allocationByteCount, in currentNotificationMemoryUse_rankerGroupNotification()
70 largeIcon = notification.getLargeIcon().bitmap.allocationByteCount, in currentNotificationMemoryUse_rankerGroupNotification()
88 smallIcon = notification.smallIcon.bitmap.allocationByteCount, in currentNotificationMemoryUse_plainNotification_dontDoubleCountSameBitmap()
111 smallIcon = notification.smallIcon.bitmap.allocationByteCount, in currentNotificationMemoryUse_customViewNotification_marksTrue()
112 largeIcon = notification.getLargeIcon().bitmap.allocationByteCount, in currentNotificationMemoryUse_customViewNotification_marksTrue()
160 smallIcon = notification.smallIcon.bitmap.allocationByteCount, in currentNotificationMemoryUse_bigPictureStyle()
161 largeIcon = notification.getLargeIcon().bitmap.allocationByteCount, in currentNotificationMemoryUse_bigPictureStyle()
163 bigPicture = bigPicture.bitmap.allocationByteCount, in currentNotificationMemoryUse_bigPictureStyle()
[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/libs/hwui/jni/
DBitmap.cpp51 explicit BitmapWrapper(Bitmap* bitmap) in BitmapWrapper() argument
52 : mBitmap(bitmap) { } in BitmapWrapper()
68 Bitmap& bitmap() { in bitmap() function in android::BitmapWrapper
163 return mBitmapWrapper->bitmap().pixels(); in pixels()
174 namespace bitmap { namespace
199 jobject createBitmap(JNIEnv* env, Bitmap* bitmap, in createBitmap() argument
206 assert_premultiplied(bitmap->info(), isPremultiplied); in createBitmap()
207 bool fromMalloc = bitmap->pixelStorageType() == PixelStorageType::Heap; in createBitmap()
208 BitmapWrapper* bitmapWrapper = new BitmapWrapper(bitmap); in createBitmap()
210 bitmapWrapper->bitmap().setImmutable(); in createBitmap()
[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/
DReadback.cpp41 SkBitmap* bitmap) { in copySurfaceInto() argument
54 return copySurfaceIntoLegacy(window, inSrcRect, bitmap); in copySurfaceInto()
145 bitmap->info(), 0, kTopLeft_GrSurfaceOrigin, nullptr); in copySurfaceInto()
150 SkImageInfo tmpInfo = bitmap->info().makeColorType(SkColorType::kN32_SkColorType); in copySurfaceInto()
197 SK_RECT_ARGS(SkRect::MakeWH(bitmap->width(), bitmap->height()))); in copySurfaceInto()
199 SkRect::MakeWH(bitmap->width(), bitmap->height()), in copySurfaceInto()
201 if (srcRect.width() != bitmap->width() || srcRect.height() != bitmap->height()) { in copySurfaceInto()
217 if (!tmpSurface->readPixels(*bitmap, 0, 0)) { in copySurfaceInto()
221 SkImageInfo tmpInfo = bitmap->info().makeColorType(SkColorType::kN32_SkColorType); in copySurfaceInto()
222 if (bitmap->info().colorType() == SkColorType::kN32_SkColorType || in copySurfaceInto()
[all …]
DHardwareBitmapUploader.cpp70 bool uploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in uploadHardwareBitmap() argument
74 bool result = onUploadHardwareBitmap(bitmap, format, ahb); in uploadHardwareBitmap()
91 virtual bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format,
162 bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in onUploadHardwareBitmap() argument
181 ATRACE_FORMAT("CPU -> gralloc transfer (%dx%d)", bitmap.width(), bitmap.height()); in onUploadHardwareBitmap()
193 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap.width(), bitmap.height(), in onUploadHardwareBitmap()
194 format.format, format.type, bitmap.getPixels()); in onUploadHardwareBitmap()
237 bool onUploadHardwareBitmap(const SkBitmap& bitmap, const FormatInfo& format, in onUploadHardwareBitmap() argument
240 mUploadThread->queue().runSync([this, &uploadSucceeded, bitmap, ahb]() { in onUploadHardwareBitmap()
260 SkImage::MakeFromAHardwareBufferWithData(mGrContext.get(), bitmap.pixmap(), ahb); in onUploadHardwareBitmap()
[all …]
DReadback.h50 CopyResult copySurfaceInto(ANativeWindow* window, const Rect& srcRect, SkBitmap* bitmap);
52 CopyResult copyHWBitmapInto(Bitmap* hwBitmap, SkBitmap* bitmap);
53 CopyResult copyImageInto(const sk_sp<SkImage>& image, SkBitmap* bitmap);
55 CopyResult copyLayerInto(DeferredLayerUpdater* layer, SkBitmap* bitmap);
58 CopyResult copySurfaceIntoLegacy(ANativeWindow* window, const Rect& srcRect, SkBitmap* bitmap);
59 CopyResult copyImageInto(const sk_sp<SkImage>& image, const Rect& srcRect, SkBitmap* bitmap);
62 SkBitmap* bitmap);
/frameworks/base/native/graphics/jni/
Dbitmap.cpp39 android::graphics::Bitmap bitmap(env, jbitmap); in AndroidBitmap_getDataSpace() local
40 if (!bitmap.isValid()) { in AndroidBitmap_getDataSpace()
44 return bitmap.getDataSpace(); in AndroidBitmap_getDataSpace()
52 android::graphics::Bitmap bitmap(env, jbitmap); in AndroidBitmap_lockPixels() local
53 void* addr = bitmap.isValid() ? bitmap.getPixels() : nullptr; in AndroidBitmap_lockPixels()
59 ABitmap_acquireRef(bitmap.get()); in AndroidBitmap_lockPixels()
72 android::graphics::Bitmap bitmap(env, jbitmap); in AndroidBitmap_unlockPixels() local
74 if (!bitmap.isValid()) { in AndroidBitmap_unlockPixels()
78 bitmap.notifyPixelsChanged(); in AndroidBitmap_unlockPixels()
79 ABitmap_releaseRef(bitmap.get()); in AndroidBitmap_unlockPixels()
[all …]
/frameworks/base/libs/input/
DSpriteIcon.h30 inline SpriteIcon(const graphics::Bitmap& bitmap, int32_t style, float hotSpotX, float hotSpotY) in SpriteIcon()
31 : bitmap(bitmap), style(style), hotSpotX(hotSpotX), hotSpotY(hotSpotY) {} in SpriteIcon()
33 graphics::Bitmap bitmap; member
39 return SpriteIcon(bitmap.copy(ANDROID_BITMAP_FORMAT_RGBA_8888), style, hotSpotX, hotSpotY); in copy()
43 bitmap.reset(); in reset()
49 inline bool isValid() const { return bitmap.isValid() && !bitmap.isEmpty(); } in isValid()
51 inline int32_t width() const { return bitmap.getInfo().width; } in width()
52 inline int32_t height() const { return bitmap.getInfo().height; } in height()
/frameworks/base/libs/hwui/tests/unit/
DABitmapTests.cpp29 sk_sp<Bitmap> bitmap(TestUtils::createBitmap(1, 1)); in TEST() local
30 ABitmap* abmp = android::TypeCast::toABitmap(bitmap.get()); in TEST()
33 uint32_t genID = bitmap->getGenerationID(); in TEST()
35 ASSERT_TRUE(bitmap->getGenerationID() != genID); in TEST()
38 ASSERT_FALSE(bitmap->isImmutable()); in TEST()
39 bitmap->setImmutable(); in TEST()
40 ASSERT_TRUE(bitmap->isImmutable()); in TEST()
43 genID = bitmap->getGenerationID(); in TEST()
45 ASSERT_TRUE(bitmap->getGenerationID() == genID); in TEST()
DSkiaBehaviorTests.cpp30 SkBitmap bitmap; in createSkBitmap() local
32 bitmap.setInfo(info); in createSkBitmap()
33 bitmap.allocPixels(info); in createSkBitmap()
34 return bitmap; in createSkBitmap()
38 SkBitmap bitmap = createSkBitmap(100, 100); in TEST() local
39 uint32_t genId = bitmap.getGenerationID(); in TEST()
40 bitmap.notifyPixelsChanged(); in TEST()
41 EXPECT_NE(genId, bitmap.getGenerationID()); in TEST()
/frameworks/opt/setupwizard/library/recyclerview/test/instrumentation/src/com/android/setupwizardlib/test/
DDividerItemDecorationTest.java69 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/base/libs/hwui/apex/
Dandroid_bitmap.cpp32 Bitmap* bitmap = GraphicsJNI::getNativeBitmap(env, bitmapObj); in ABitmap_acquireBitmapFromJava() local
33 if (bitmap) { in ABitmap_acquireBitmapFromJava()
34 bitmap->ref(); in ABitmap_acquireBitmapFromJava()
35 return TypeCast::toABitmap(bitmap); in ABitmap_acquireBitmapFromJava()
40 void ABitmap_acquireRef(ABitmap* bitmap) { in ABitmap_acquireRef() argument
41 SkSafeRef(TypeCast::toBitmap(bitmap)); in ABitmap_acquireRef()
44 void ABitmap_releaseRef(ABitmap* bitmap) { in ABitmap_releaseRef() argument
45 SkSafeUnref(TypeCast::toBitmap(bitmap)); in ABitmap_releaseRef()
135 Bitmap* bitmap = TypeCast::toBitmap(bitmapHandle); in ABitmap_getInfo() local
136 return getInfo(bitmap->info(), bitmap->rowBytes(), bitmap->isHardware()); in ABitmap_getInfo()
[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/core/java/com/android/internal/graphics/palette/
DPalette.java73 public static Builder from(@NonNull Bitmap bitmap, @NonNull Quantizer quantizer) { in from() argument
74 return new Builder(bitmap, quantizer); in from()
200 public Builder(@NonNull Bitmap bitmap, @NonNull Quantizer quantizer) { in Builder() argument
201 if (bitmap == null || bitmap.isRecycled()) { in Builder()
205 mBitmap = bitmap; in Builder()
327 Bitmap bitmap = scaleBitmapDown(mBitmap); in generate() local
330 if (bitmap != mBitmap && region != null) { in generate()
333 double scale = bitmap.getWidth() / (double) mBitmap.getWidth(); in generate()
337 bitmap.getWidth()); in generate()
339 bitmap.getHeight()); in generate()
[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 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/
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/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/rs/toolkit/test/
DAllTests.kt76 private fun validateTestImage(bitmap: Bitmap) { in <lambda>()
77 require(bitmap.config == Bitmap.Config.ARGB_8888) in <lambda>()
78 require(bitmap.rowBytes == bitmap.width * 4) { in <lambda>()
81 require(bitmap.byteCount == bitmap.rowBytes * bitmap.height) in <lambda>()
262 bitmap: Bitmap, in <lambda>()
267 intrinsicBlur(renderscriptContext, bitmap, radius, restriction) in <lambda>()
271 toolkit.blur(bitmap, radius, restriction) in <lambda>()
277 getBitmapBytes(bitmap), in <lambda>()
278 vectorSizeOfBitmap(bitmap), in <lambda>()
279 bitmap.width, in <lambda>()
[all …]
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/
DGlifPatternDrawable.java107 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/core/java/android/app/
DSharedElementCallback.java182 Bitmap bitmap = TransitionUtils.createDrawableBitmap(d, imageView); in onCaptureSharedElementSnapshot() local
183 if (bitmap != null) { in onCaptureSharedElementSnapshot()
185 if (bitmap.getConfig() != Bitmap.Config.HARDWARE) { in onCaptureSharedElementSnapshot()
186 bundle.putParcelable(BUNDLE_SNAPSHOT_BITMAP, bitmap); in onCaptureSharedElementSnapshot()
188 HardwareBuffer hardwareBuffer = bitmap.getHardwareBuffer(); in onCaptureSharedElementSnapshot()
190 ColorSpace cs = bitmap.getColorSpace(); in onCaptureSharedElementSnapshot()
238 Bitmap bitmap = bundle.getParcelable(BUNDLE_SNAPSHOT_BITMAP); in onCreateSnapshotView() local
239 if (buffer == null && bitmap == null) { in onCreateSnapshotView()
242 if (bitmap == null) { in onCreateSnapshotView()
248 bitmap = Bitmap.wrapHardwareBuffer(buffer, colorSpace); in onCreateSnapshotView()
[all …]
/frameworks/base/tests/UiBench/src/com/android/test/uibench/leanback/
DBitmapLoader.java94 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()

12345678910>>...15