Merge "SurfaceControl: free ref when not used anymore" into lmp-dev

This commit is contained in:
Pat Tjin
2014-08-22 22:04:35 +00:00
committed by Android (Google) Code Review

View File

@@ -180,7 +180,8 @@ static jobject nativeScreenshotBitmap(JNIEnv* env, jclass clazz,
// takes ownership of ScreenshotClient
SkMallocPixelRef* pixels = SkMallocPixelRef::NewWithProc(screenshotInfo,
(size_t) rowBytes, NULL, (void*) screenshot->getPixels(), &DeleteScreenshot,
(void*) (screenshot.detach()));
(void*) (screenshot.get()));
screenshot.detach();
pixels->setImmutable();
bitmap->setPixelRef(pixels)->unref();
bitmap->lockPixels();