lock pixels in image when bitmap is immutable and not-lazy
BUG=skia:
Review URL: https://codereview.chromium.org/1266143003
diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp
index 882871f..eb2263e 100644
--- a/tests/DeferredCanvasTest.cpp
+++ b/tests/DeferredCanvasTest.cpp
@@ -64,7 +64,7 @@
}
SkImage* onNewImageSnapshot(Budgeted) override {
- return SkNewImageFromRasterBitmap(fBitmap, &this->props(), kUnlocked_SharedPixelRefMode);
+ return SkNewImageFromRasterBitmap(fBitmap, &this->props());
}
void onCopyOnWrite(ContentChangeMode mode) override {
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 5da8342..ba071bb 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -245,9 +245,7 @@
const bool sharedID = (image->uniqueID() == bm.getGenerationID());
REPORTER_ASSERT(reporter, sharedID == rec[i].fExpectSharedID);
-#if 0 // TODO: fix so that peek will succeed in the immutable case
const bool peekSuccess = image->peekPixels(&pmap);
REPORTER_ASSERT(reporter, peekSuccess == rec[i].fExpectPeekSuccess);
-#endif
}
}
diff --git a/tests/SkImageTest.cpp b/tests/SkImageTest.cpp
index d5c7eaa..fabc1fd 100644
--- a/tests/SkImageTest.cpp
+++ b/tests/SkImageTest.cpp
@@ -26,7 +26,7 @@
canvas.drawIRect(r, p);
SkBitmap dstBitmap;
srcBitmap.extractSubset(&dstBitmap, r);
- image.reset(SkNewImageFromRasterBitmap(dstBitmap, NULL, kUnlocked_SharedPixelRefMode));
+ image.reset(SkImage::NewFromBitmap(dstBitmap));
}
SkBitmap tgt;