Lines Matching refs:bitmap

105     virtual bool allocPixelRef(SkBitmap* bitmap) {
107 const int bytesPerPixel = SkColorTypeBytesPerPixel(bitmap->colorType());
109 int(bitmap->width() * mScale + 0.5f) *
110 int(bitmap->height() * mScale + 0.5f);
112 ALOGW("bitmap for alloc reuse (%d bytes) can't fit scaled bitmap (%d bytes)",
116 return SkBitmap::HeapAllocator::allocPixelRef(bitmap);
125 RecyclingPixelAllocator(android::Bitmap* bitmap, unsigned int size)
126 : mBitmap(bitmap), mSize(size) {
132 virtual bool allocPixelRef(SkBitmap* bitmap) {
133 const SkImageInfo& info = bitmap->info();
135 ALOGW("unable to reuse a bitmap as the target has an unknown bitmap configuration");
139 const size_t size = info.computeByteSize(bitmap->rowBytes());
141 ALOGW("bitmap is too large");
146 ALOGW("bitmap marked for reuse (%u bytes) can't fit new bitmap "
151 mBitmap->reconfigure(info, bitmap->rowBytes());
152 bitmap->setPixelRef(sk_ref_sp(mBitmap), 0, 0);
235 return nullObjectReturn("Cannot create mutable hardware bitmap");
323 reuseBitmap = &bitmap::toBitmap(env, javaBitmap);
325 ALOGW("Unable to reuse an immutable bitmap as an image decoder target.");
329 existingBufferSize = bitmap::getBitmapAllocationByteCount(env, javaBitmap);
369 // recognizes kGray8, we need to decode into a kAlpha8 bitmap
460 return nullObjectReturn("allocation failed for scaled bitmap");
493 bitmap::reinitBitmap(env, javaBitmap, outputBitmap.info(), isPremultiplied);
495 // If a java bitmap was passed in for reuse, pass it back
500 if (isMutable) bitmapCreateFlags |= android::bitmap::kBitmapCreateFlag_Mutable;
501 if (isPremultiplied) bitmapCreateFlags |= android::bitmap::kBitmapCreateFlag_Premultiplied;
506 return nullObjectReturn("Failed to allocate a hardware bitmap");
508 return bitmap::createBitmap(env, hardwareBitmap.release(), bitmapCreateFlags,
512 // now create the java bitmap
513 return bitmap::createBitmap(env, defaultAllocator.getStorageObjAndReset(),
520 jobject bitmap = NULL;
527 bitmap = doDecode(env, std::move(bufferedStream), padding, options);
529 return bitmap;