Lines Matching defs:bitmap

64         // to prevent things like a non-opaque RGB565 bitmap
192 "Deleting a bitmap wrapper while there are outstanding strong "
365 "Error, cannot access an invalid/free'd bitmap here!");
480 static FromColorProc ChooseFromColorProc(const SkBitmap& bitmap) {
481 switch (bitmap.colorType()) {
483 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D32 : FromColor_D32_Raw;
485 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D4444 :
722 SkBitmap bitmap;
723 bitmap.setInfo(SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType));
725 Bitmap* nativeBitmap = GraphicsJNI::allocateJavaPixelRef(env, &bitmap, NULL);
732 0, 0, width, height, bitmap);
750 Bitmap* bitmap = allocator.getStorageObjAndReset();
751 return GraphicsJNI::createBitmap(env, bitmap,
762 Bitmap* bitmap = allocator.getStorageObjAndReset();
763 bitmap->peekAtPixelRef()->setImmutable();
764 return bitmap;
771 Bitmap* bitmap = Bitmap_copyAshmemImpl(env, src, dstCT);
772 jobject ret = GraphicsJNI::createBitmap(env, bitmap, getPremulBitmapCreateFlags(false));
780 Bitmap* bitmap = Bitmap_copyAshmemImpl(env, src, dstCT);
781 jobject ret = GraphicsJNI::createBitmap(env, bitmap, getPremulBitmapCreateFlags(false));
785 static void Bitmap_destruct(Bitmap* bitmap) {
786 bitmap->detachFromJava();
794 LocalScopedBitmap bitmap(bitmapHandle);
795 bitmap->freePixels();
802 LocalScopedBitmap bitmap(bitmapHandle);
816 if (bitmap->info().colorType() != kRGB_565_SkColorType
817 && bitmap->info().alphaType() == kOpaque_SkAlphaType) {
818 // If the original bitmap was set to opaque, keep that setting, unless it
825 bitmap->reconfigure(SkImageInfo::Make(width, height, colorType, alphaType));
839 LocalScopedBitmap bitmap(bitmapHandle);
856 if (!bitmap.valid()) {
870 bitmap->getSkBitmap(&skbitmap);
877 LocalScopedBitmap bitmap(bitmapHandle);
879 bitmap->getSkBitmap(&skBitmap);
884 LocalScopedBitmap bitmap(bitmapHandle);
885 return static_cast<jint>(bitmap->rowBytes());
889 LocalScopedBitmap bitmap(bitmapHandle);
890 return GraphicsJNI::colorTypeToLegacyBitmapConfig(bitmap->info().colorType());
894 LocalScopedBitmap bitmap(bitmapHandle);
895 return static_cast<jint>(bitmap->peekAtPixelRef()->getGenerationID());
899 LocalScopedBitmap bitmap(bitmapHandle);
900 if (bitmap->info().alphaType() == kPremul_SkAlphaType) {
907 LocalScopedBitmap bitmap(bitmapHandle);
908 return !bitmap->info().isOpaque() ? JNI_TRUE : JNI_FALSE;
913 LocalScopedBitmap bitmap(bitmapHandle);
915 bitmap->setAlphaType(
918 bitmap->setAlphaType(kOpaque_SkAlphaType);
924 LocalScopedBitmap bitmap(bitmapHandle);
925 if (!bitmap->info().isOpaque()) {
927 bitmap->setAlphaType(kPremul_SkAlphaType);
929 bitmap->setAlphaType(kUnpremul_SkAlphaType);
935 LocalScopedBitmap bitmap(bitmapHandle);
936 return bitmap->hasHardwareMipMap() ? JNI_TRUE : JNI_FALSE;
941 LocalScopedBitmap bitmap(bitmapHandle);
942 bitmap->setHasHardwareMipMap(hasMipMap);
972 std::unique_ptr<SkBitmap> bitmap(new SkBitmap);
974 if (!bitmap->setInfo(SkImageInfo::Make(width, height, colorType, alphaType), rowBytes)) {
996 // Read the bitmap blob.
997 size_t size = bitmap->getSize();
1002 doThrowRE(env, "Could not read bitmap blob.");
1006 // Map the bitmap in place from the ashmem region if possible otherwise copy.
1010 ALOGD("Bitmap.createFromParcel: mapped contents of %s bitmap from %s blob "
1028 nativeBitmap = GraphicsJNI::mapAshmemPixelRef(env, bitmap.get(),
1043 ALOGD("Bitmap.createFromParcel: copied contents of mutable bitmap "
1055 nativeBitmap = GraphicsJNI::allocateJavaPixelRef(env, bitmap.get(), ctable);
1062 bitmap->lockPixels();
1063 memcpy(bitmap->getPixels(), blob.data(), size);
1064 bitmap->unlockPixels();
1084 SkBitmap bitmap;
1087 androidBitmap->getSkBitmap(&bitmap);
1090 p->writeInt32(bitmap.colorType());
1091 p->writeInt32(bitmap.alphaType());
1092 p->writeInt32(bitmap.width());
1093 p->writeInt32(bitmap.height());
1094 p->writeInt32(bitmap.rowBytes());
1097 if (bitmap.colorType() == kIndex_8_SkColorType) {
1098 // The bitmap needs to be locked to access its color table.
1099 SkAutoLockPixels alp(bitmap);
1100 SkColorTable* ctable = bitmap.getColorTable();
1116 ALOGD("Bitmap.writeToParcel: transferring immutable bitmap's ashmem fd as "
1123 doThrowRE(env, "Could not write bitmap blob file descriptor.");
1129 // Copy the bitmap to a new blob.
1132 ALOGD("Bitmap.writeToParcel: copying %s bitmap into new %s blob (fds %s)",
1138 size_t size = bitmap.getSize();
1142 doThrowRE(env, "Could not copy bitmap to parcel blob.");
1146 bitmap.lockPixels();
1147 const void* pSrc = bitmap.getPixels();
1153 bitmap.unlockPixels();
1170 // If Skia can't allocate pixels for destination bitmap, it resets
1191 SkBitmap bitmap;
1192 reinterpret_cast<Bitmap*>(bitmapHandle)->getSkBitmap(&bitmap);
1193 SkAutoLockPixels alp(bitmap);
1195 ToColorProc proc = ChooseToColorProc(bitmap);
1199 const void* src = bitmap.getAddr(x, y);
1205 proc(dst, src, 1, bitmap.getColorTable());
1212 SkBitmap bitmap;
1213 reinterpret_cast<Bitmap*>(bitmapHandle)->getSkBitmap(&bitmap);
1214 SkAutoLockPixels alp(bitmap);
1216 ToColorProc proc = ChooseToColorProc(bitmap);
1220 const void* src = bitmap.getAddr(x, y);
1225 SkColorTable* ctable = bitmap.getColorTable();
1231 src = (void*)((const char*)src + bitmap.rowBytes());
1240 SkBitmap bitmap;
1241 reinterpret_cast<Bitmap*>(bitmapHandle)->getSkBitmap(&bitmap);
1243 SkAutoLockPixels alp(bitmap);
1244 if (NULL == bitmap.getPixels()) {
1248 FromColorProc proc = ChooseFromColorProc(bitmap);
1253 proc(bitmap.getAddr(x, y), &color, 1, x, y);
1254 bitmap.notifyPixelsChanged();
1260 SkBitmap bitmap;
1261 reinterpret_cast<Bitmap*>(bitmapHandle)->getSkBitmap(&bitmap);
1263 x, y, width, height, bitmap);
1268 SkBitmap bitmap;
1269 reinterpret_cast<Bitmap*>(bitmapHandle)->getSkBitmap(&bitmap);
1270 SkAutoLockPixels alp(bitmap);
1271 const void* src = bitmap.getPixels();
1277 memcpy(abp.pointer(), src, bitmap.getSize());
1283 SkBitmap bitmap;
1284 reinterpret_cast<Bitmap*>(bitmapHandle)->getSkBitmap(&bitmap);
1285 SkAutoLockPixels alp(bitmap);
1286 void* dst = bitmap.getPixels();
1291 memcpy(dst, abp.pointer(), bitmap.getSize());
1292 bitmap.notifyPixelsChanged();
1358 LocalScopedBitmap bitmap(bitmapHandle);
1359 SkPixelRef* pixelRef = bitmap.valid() ? bitmap->peekAtPixelRef() : nullptr;