Loading cmds/bootanimation/BootAnimation.cpp +0 −8 Original line number Diff line number Diff line Loading @@ -158,10 +158,6 @@ status_t BootAnimation::initTexture(Texture* texture, AssetManager& assets, asset->close(); delete asset; // ensure we can call getPixels(). No need to call unlock, since the // bitmap will go out of scope when we return from this method. bitmap.lockPixels(); const int w = bitmap.width(); const int h = bitmap.height(); const void* p = bitmap.getPixels(); Loading Loading @@ -216,10 +212,6 @@ status_t BootAnimation::initTexture(FileMap* map, int* width, int* height) // the packed resource can be released. delete map; // ensure we can call getPixels(). No need to call unlock, since the // bitmap will go out of scope when we return from this method. bitmap.lockPixels(); const int w = bitmap.width(); const int h = bitmap.height(); const void* p = bitmap.getPixels(); Loading core/jni/android/graphics/Bitmap.cpp +2 −20 Original line number Diff line number Diff line Loading @@ -278,9 +278,7 @@ void* lockPixels(JNIEnv* env, jobject bitmap) { if (!localBitmap->valid()) return nullptr; SkPixelRef& pixelRef = localBitmap->bitmap(); pixelRef.lockPixels(); if (!pixelRef.pixels()) { pixelRef.unlockPixels(); return nullptr; } pixelRef.ref(); Loading @@ -298,7 +296,6 @@ bool unlockPixels(JNIEnv* env, jobject bitmap) { SkPixelRef& pixelRef = localBitmap->bitmap(); pixelRef.notifyPixelsChanged(); pixelRef.unlockPixels(); pixelRef.unref(); return true; } Loading Loading @@ -438,7 +435,6 @@ static FromColorProc ChooseFromColorProc(const SkBitmap& bitmap) { bool GraphicsJNI::SetPixels(JNIEnv* env, jintArray srcColors, int srcOffset, int srcStride, int x, int y, int width, int height, const SkBitmap& dstBitmap) { SkAutoLockPixels alp(dstBitmap); void* dst = dstBitmap.getPixels(); FromColorProc proc = ChooseFromColorProc(dstBitmap); Loading Loading @@ -758,11 +754,10 @@ static bool bitmapCopyTo(SkBitmap* dst, SkColorType dstCT, const SkBitmap& src, // Skia does not support copying from kAlpha8 to types that are not alpha only. // We will handle this case here. if (kAlpha_8_SkColorType == src.colorType() && kAlpha_8_SkColorType != dstCT) { SkAutoPixmapUnlock srcUnlocker; if (!src.requestLock(&srcUnlocker)) { SkPixmap srcPixmap; if (!src.peekPixels(&srcPixmap)) { return false; } SkPixmap srcPixmap = srcUnlocker.pixmap(); SkImageInfo dstInfo = src.info().makeColorType(dstCT); if (dstCT == kRGBA_F16_SkColorType) { Loading Loading @@ -1138,9 +1133,7 @@ static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) { doThrowRE(env, "Could not allocate java pixel ref."); return NULL; } bitmap->lockPixels(); memcpy(bitmap->getPixels(), blob.data(), size); bitmap->unlockPixels(); // Release the blob handle. blob.release(); Loading Loading @@ -1186,7 +1179,6 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject, if (bitmap.colorType() == kIndex_8_SkColorType) { // The bitmap needs to be locked to access its color table. SkAutoLockPixels alp(bitmap); SkColorTable* ctable = bitmap.getColorTable(); if (ctable != NULL) { int count = ctable->count(); Loading Loading @@ -1233,14 +1225,12 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject, return JNI_FALSE; } bitmap.lockPixels(); const void* pSrc = bitmap.getPixels(); if (pSrc == NULL) { memset(blob.data(), 0, size); } else { memcpy(blob.data(), pSrc, size); } bitmap.unlockPixels(); blob.release(); return JNI_TRUE; Loading Loading @@ -1330,7 +1320,6 @@ static jint Bitmap_getPixel(JNIEnv* env, jobject, jlong bitmapHandle, jint x, jint y) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); ToColorProc proc = ChooseToColorProc(bitmap); if (NULL == proc) { Loading Loading @@ -1362,7 +1351,6 @@ static void Bitmap_getPixels(JNIEnv* env, jobject, jlong bitmapHandle, jint x, jint y, jint width, jint height) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); ToColorProc proc = ChooseToColorProc(bitmap); if (NULL == proc) { Loading Loading @@ -1411,7 +1399,6 @@ static void Bitmap_setPixel(JNIEnv* env, jobject, jlong bitmapHandle, SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkColor color = static_cast<SkColor>(colorHandle); SkAutoLockPixels alp(bitmap); if (NULL == bitmap.getPixels()) { return; } Loading Loading @@ -1448,7 +1435,6 @@ static void Bitmap_copyPixelsToBuffer(JNIEnv* env, jobject, jlong bitmapHandle, jobject jbuffer) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); const void* src = bitmap.getPixels(); if (NULL != src) { Loading @@ -1463,7 +1449,6 @@ static void Bitmap_copyPixelsFromBuffer(JNIEnv* env, jobject, jlong bitmapHandle, jobject jbuffer) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); void* dst = bitmap.getPixels(); if (NULL != dst) { Loading Loading @@ -1498,9 +1483,6 @@ static jboolean Bitmap_sameAs(JNIEnv* env, jobject, jlong bm0Handle, jlong bm1Ha return JNI_FALSE; } SkAutoLockPixels alp0(bm0); SkAutoLockPixels alp1(bm1); // if we can't load the pixels, return false if (NULL == bm0.getPixels() || NULL == bm1.getPixels()) { return JNI_FALSE; Loading core/jni/android/graphics/BitmapFactory.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -197,10 +197,6 @@ public: mBitmap->reconfigure(info, bitmap->rowBytes(), sk_ref_sp(ctable)); bitmap->setPixelRef(sk_ref_sp(mBitmap), 0, 0); // since we're already allocated, we lockPixels right away // HeapAllocator behaves this way too bitmap->lockPixels(); return true; } Loading core/jni/android/graphics/Graphics.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -461,10 +461,6 @@ android::Bitmap* GraphicsJNI::mapAshmemBitmap(JNIEnv* env, SkBitmap* bitmap, if (readOnly) { bitmap->pixelRef()->setImmutable(); } // since we're already allocated, we lockPixels right away // HeapAllocator behaves this way too bitmap->lockPixels(); return wrapper; } Loading Loading @@ -674,7 +670,6 @@ bool RecyclingClippingPixelAllocator::allocPixelRef(SkBitmap* bitmap, SkColorTab mRecycledBitmap->setAlphaType(bitmap->alphaType()); bitmap->notifyPixelsChanged(); bitmap->lockPixels(); mNeedsCopy = false; // TODO: If the dimensions of the SkBitmap are smaller than those of Loading core/jni/android/graphics/pdf/PdfRenderer.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -83,8 +83,6 @@ static void nativeRenderPage(JNIEnv* env, jclass thiz, jlong documentPtr, jlong SkBitmap skBitmap; GraphicsJNI::getSkBitmap(env, jbitmap, &skBitmap); SkAutoLockPixels alp(skBitmap); const int stride = skBitmap.width() * 4; FPDF_BITMAP bitmap = FPDFBitmap_CreateEx(skBitmap.width(), skBitmap.height(), Loading Loading
cmds/bootanimation/BootAnimation.cpp +0 −8 Original line number Diff line number Diff line Loading @@ -158,10 +158,6 @@ status_t BootAnimation::initTexture(Texture* texture, AssetManager& assets, asset->close(); delete asset; // ensure we can call getPixels(). No need to call unlock, since the // bitmap will go out of scope when we return from this method. bitmap.lockPixels(); const int w = bitmap.width(); const int h = bitmap.height(); const void* p = bitmap.getPixels(); Loading Loading @@ -216,10 +212,6 @@ status_t BootAnimation::initTexture(FileMap* map, int* width, int* height) // the packed resource can be released. delete map; // ensure we can call getPixels(). No need to call unlock, since the // bitmap will go out of scope when we return from this method. bitmap.lockPixels(); const int w = bitmap.width(); const int h = bitmap.height(); const void* p = bitmap.getPixels(); Loading
core/jni/android/graphics/Bitmap.cpp +2 −20 Original line number Diff line number Diff line Loading @@ -278,9 +278,7 @@ void* lockPixels(JNIEnv* env, jobject bitmap) { if (!localBitmap->valid()) return nullptr; SkPixelRef& pixelRef = localBitmap->bitmap(); pixelRef.lockPixels(); if (!pixelRef.pixels()) { pixelRef.unlockPixels(); return nullptr; } pixelRef.ref(); Loading @@ -298,7 +296,6 @@ bool unlockPixels(JNIEnv* env, jobject bitmap) { SkPixelRef& pixelRef = localBitmap->bitmap(); pixelRef.notifyPixelsChanged(); pixelRef.unlockPixels(); pixelRef.unref(); return true; } Loading Loading @@ -438,7 +435,6 @@ static FromColorProc ChooseFromColorProc(const SkBitmap& bitmap) { bool GraphicsJNI::SetPixels(JNIEnv* env, jintArray srcColors, int srcOffset, int srcStride, int x, int y, int width, int height, const SkBitmap& dstBitmap) { SkAutoLockPixels alp(dstBitmap); void* dst = dstBitmap.getPixels(); FromColorProc proc = ChooseFromColorProc(dstBitmap); Loading Loading @@ -758,11 +754,10 @@ static bool bitmapCopyTo(SkBitmap* dst, SkColorType dstCT, const SkBitmap& src, // Skia does not support copying from kAlpha8 to types that are not alpha only. // We will handle this case here. if (kAlpha_8_SkColorType == src.colorType() && kAlpha_8_SkColorType != dstCT) { SkAutoPixmapUnlock srcUnlocker; if (!src.requestLock(&srcUnlocker)) { SkPixmap srcPixmap; if (!src.peekPixels(&srcPixmap)) { return false; } SkPixmap srcPixmap = srcUnlocker.pixmap(); SkImageInfo dstInfo = src.info().makeColorType(dstCT); if (dstCT == kRGBA_F16_SkColorType) { Loading Loading @@ -1138,9 +1133,7 @@ static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) { doThrowRE(env, "Could not allocate java pixel ref."); return NULL; } bitmap->lockPixels(); memcpy(bitmap->getPixels(), blob.data(), size); bitmap->unlockPixels(); // Release the blob handle. blob.release(); Loading Loading @@ -1186,7 +1179,6 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject, if (bitmap.colorType() == kIndex_8_SkColorType) { // The bitmap needs to be locked to access its color table. SkAutoLockPixels alp(bitmap); SkColorTable* ctable = bitmap.getColorTable(); if (ctable != NULL) { int count = ctable->count(); Loading Loading @@ -1233,14 +1225,12 @@ static jboolean Bitmap_writeToParcel(JNIEnv* env, jobject, return JNI_FALSE; } bitmap.lockPixels(); const void* pSrc = bitmap.getPixels(); if (pSrc == NULL) { memset(blob.data(), 0, size); } else { memcpy(blob.data(), pSrc, size); } bitmap.unlockPixels(); blob.release(); return JNI_TRUE; Loading Loading @@ -1330,7 +1320,6 @@ static jint Bitmap_getPixel(JNIEnv* env, jobject, jlong bitmapHandle, jint x, jint y) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); ToColorProc proc = ChooseToColorProc(bitmap); if (NULL == proc) { Loading Loading @@ -1362,7 +1351,6 @@ static void Bitmap_getPixels(JNIEnv* env, jobject, jlong bitmapHandle, jint x, jint y, jint width, jint height) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); ToColorProc proc = ChooseToColorProc(bitmap); if (NULL == proc) { Loading Loading @@ -1411,7 +1399,6 @@ static void Bitmap_setPixel(JNIEnv* env, jobject, jlong bitmapHandle, SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkColor color = static_cast<SkColor>(colorHandle); SkAutoLockPixels alp(bitmap); if (NULL == bitmap.getPixels()) { return; } Loading Loading @@ -1448,7 +1435,6 @@ static void Bitmap_copyPixelsToBuffer(JNIEnv* env, jobject, jlong bitmapHandle, jobject jbuffer) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); const void* src = bitmap.getPixels(); if (NULL != src) { Loading @@ -1463,7 +1449,6 @@ static void Bitmap_copyPixelsFromBuffer(JNIEnv* env, jobject, jlong bitmapHandle, jobject jbuffer) { SkBitmap bitmap; reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap); SkAutoLockPixels alp(bitmap); void* dst = bitmap.getPixels(); if (NULL != dst) { Loading Loading @@ -1498,9 +1483,6 @@ static jboolean Bitmap_sameAs(JNIEnv* env, jobject, jlong bm0Handle, jlong bm1Ha return JNI_FALSE; } SkAutoLockPixels alp0(bm0); SkAutoLockPixels alp1(bm1); // if we can't load the pixels, return false if (NULL == bm0.getPixels() || NULL == bm1.getPixels()) { return JNI_FALSE; Loading
core/jni/android/graphics/BitmapFactory.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -197,10 +197,6 @@ public: mBitmap->reconfigure(info, bitmap->rowBytes(), sk_ref_sp(ctable)); bitmap->setPixelRef(sk_ref_sp(mBitmap), 0, 0); // since we're already allocated, we lockPixels right away // HeapAllocator behaves this way too bitmap->lockPixels(); return true; } Loading
core/jni/android/graphics/Graphics.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -461,10 +461,6 @@ android::Bitmap* GraphicsJNI::mapAshmemBitmap(JNIEnv* env, SkBitmap* bitmap, if (readOnly) { bitmap->pixelRef()->setImmutable(); } // since we're already allocated, we lockPixels right away // HeapAllocator behaves this way too bitmap->lockPixels(); return wrapper; } Loading Loading @@ -674,7 +670,6 @@ bool RecyclingClippingPixelAllocator::allocPixelRef(SkBitmap* bitmap, SkColorTab mRecycledBitmap->setAlphaType(bitmap->alphaType()); bitmap->notifyPixelsChanged(); bitmap->lockPixels(); mNeedsCopy = false; // TODO: If the dimensions of the SkBitmap are smaller than those of Loading
core/jni/android/graphics/pdf/PdfRenderer.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -83,8 +83,6 @@ static void nativeRenderPage(JNIEnv* env, jclass thiz, jlong documentPtr, jlong SkBitmap skBitmap; GraphicsJNI::getSkBitmap(env, jbitmap, &skBitmap); SkAutoLockPixels alp(skBitmap); const int stride = skBitmap.width() * 4; FPDF_BITMAP bitmap = FPDFBitmap_CreateEx(skBitmap.width(), skBitmap.height(), Loading