Lines Matching refs:bitmap

102 static FromColorProc ChooseFromColorProc(const SkBitmap& bitmap) {
103 switch (bitmap.colorType()) {
105 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D32 : FromColor_D32_Raw;
107 return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D4444 :
334 SkBitmap bitmap;
335 bitmap.setInfo(SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType));
337 jbyteArray buff = GraphicsJNI::allocateJavaPixelRef(env, &bitmap, NULL);
344 0, 0, width, height, bitmap);
347 return GraphicsJNI::createBitmap(env, new SkBitmap(bitmap), buff,
366 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
369 android::uirenderer::ResourceCache::getInstance().destructor(bitmap);
373 delete bitmap;
377 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
381 result = android::uirenderer::ResourceCache::getInstance().recycle(bitmap);
385 bitmap->setPixels(NULL, NULL);
392 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
405 SkPixelRef* ref = bitmap->pixelRef();
408 if (bitmap->colorType() != kRGB_565_SkColorType
409 && bitmap->alphaType() == kOpaque_SkAlphaType) {
410 // If the original bitmap was set to opaque, keep that setting, unless it
417 bitmap->setInfo(SkImageInfo::Make(width, height, colorType, alphaType));
425 info = bitmap->info();
426 bitmap->setPixelRef(ref);
429 // hasn't been touched. This signals the renderer that the bitmap (including width, height,
445 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
463 if (NULL != bitmap) {
464 SkAutoLockPixels alp(*bitmap);
466 if (NULL == bitmap->getPixels()) {
477 success = encoder->encodeStream(strm, *bitmap, quality);
486 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
487 bitmap->eraseColor(color);
491 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
492 return static_cast<jint>(bitmap->rowBytes());
496 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
497 return GraphicsJNI::colorTypeToLegacyBitmapConfig(bitmap->colorType());
501 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
502 return static_cast<jint>(bitmap->getGenerationID());
506 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
507 if (bitmap->alphaType() == kPremul_SkAlphaType) {
514 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
515 return !bitmap->isOpaque() ? JNI_TRUE : JNI_FALSE;
520 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
522 bitmap->setAlphaType(requestPremul ? kPremul_SkAlphaType : kUnpremul_SkAlphaType);
524 bitmap->setAlphaType(kOpaque_SkAlphaType);
530 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
531 if (!bitmap->isOpaque()) {
533 bitmap->setAlphaType(kPremul_SkAlphaType);
535 bitmap->setAlphaType(kUnpremul_SkAlphaType);
541 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
542 return bitmap->hasHardwareMipMap() ? JNI_TRUE : JNI_FALSE;
547 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
548 bitmap->setHasHardwareMipMap(hasMipMap);
578 SkBitmap* bitmap = new SkBitmap;
580 bitmap->setInfo(SkImageInfo::Make(width, height, colorType, alphaType), rowBytes);
592 jbyteArray buffer = GraphicsJNI::allocateJavaPixelRef(env, bitmap, ctable);
595 delete bitmap;
601 size_t size = bitmap->getSize();
606 doThrowRE(env, "Could not read bitmap from parcel blob.");
607 delete bitmap;
611 bitmap->lockPixels();
612 memcpy(bitmap->getPixels(), blob.data(), size);
613 bitmap->unlockPixels();
617 return GraphicsJNI::createBitmap(env, bitmap, buffer, getPremulBitmapCreateFlags(isMutable),
625 const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
634 p->writeInt32(bitmap->colorType());
635 p->writeInt32(bitmap->alphaType());
636 p->writeInt32(bitmap->width());
637 p->writeInt32(bitmap->height());
638 p->writeInt32(bitmap->rowBytes());
641 if (bitmap->colorType() == kIndex_8_SkColorType) {
642 SkColorTable* ctable = bitmap->getColorTable();
654 size_t size = bitmap->getSize();
659 doThrowRE(env, "Could not write bitmap to parcel blob.");
663 bitmap->lockPixels();
664 const void* pSrc = bitmap->getPixels();
670 bitmap->unlockPixels();
686 // If Skia can't allocate pixels for destination bitmap, it resets
708 const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
709 SkAutoLockPixels alp(*bitmap);
711 ToColorProc proc = ChooseToColorProc(*bitmap);
715 const void* src = bitmap->getAddr(x, y);
721 proc(dst, src, 1, bitmap->getColorTable());
728 const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
729 SkAutoLockPixels alp(*bitmap);
731 ToColorProc proc = ChooseToColorProc(*bitmap);
735 const void* src = bitmap->getAddr(x, y);
740 SkColorTable* ctable = bitmap->getColorTable();
746 src = (void*)((const char*)src + bitmap->rowBytes());
755 const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
757 SkAutoLockPixels alp(*bitmap);
758 if (NULL == bitmap->getPixels()) {
762 FromColorProc proc = ChooseFromColorProc(*bitmap);
767 proc(bitmap->getAddr(x, y), &color, 1, x, y);
768 bitmap->notifyPixelsChanged();
774 const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
776 x, y, width, height, *bitmap);
781 const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
782 SkAutoLockPixels alp(*bitmap);
783 const void* src = bitmap->getPixels();
789 memcpy(abp.pointer(), src, bitmap->getSize());
795 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
796 SkAutoLockPixels alp(*bitmap);
797 void* dst = bitmap->getPixels();
802 memcpy(dst, abp.pointer(), bitmap->getSize());
803 bitmap->notifyPixelsChanged();
869 SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
870 bitmap->lockPixels();
871 bitmap->unlockPixels();