aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-07-24 12:30:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-24 12:30:34 -0700
commitb560b5c8c03fe1b9b1b8a90c546481b8db7f043e (patch)
tree927eb3da7eb8715af13fcc174de583af71e63423
parent057ae8a15ddd2af639a829d63aca29cbc6b1bb57 (diff)
lockPixelsAreWritable is deprecated
-rw-r--r--include/core/SkBitmap.h1
-rw-r--r--src/core/SkBitmapDevice.cpp10
-rw-r--r--tests/ReadPixelsTest.cpp1
3 files changed, 4 insertions, 8 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 5406f94328..64ce60a0e2 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -455,6 +455,7 @@ public:
* not be used as targets for a raster device/canvas (since all pixels
* modifications will be lost when unlockPixels() is called.)
*/
+ // DEPRECATED
bool lockPixelsAreWritable() const;
bool requestLock(SkAutoPixmapUnlock* result) const;
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 36afe42f3a..dcdc55bbfb 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -142,7 +142,7 @@ const SkBitmap& SkBitmapDevice::onAccessBitmap() {
}
bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) {
- if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) {
+ if (this->onPeekPixels(pmap)) {
fBitmap.notifyPixelsChanged();
return true;
}
@@ -185,16 +185,12 @@ bool SkBitmapDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, s
void SkBitmapDevice::onAttachToCanvas(SkCanvas* canvas) {
INHERITED::onAttachToCanvas(canvas);
- if (fBitmap.lockPixelsAreWritable()) {
- fBitmap.lockPixels();
- }
+ fBitmap.lockPixels();
}
void SkBitmapDevice::onDetachFromCanvas() {
INHERITED::onDetachFromCanvas();
- if (fBitmap.lockPixelsAreWritable()) {
- fBitmap.unlockPixels();
- }
+ fBitmap.unlockPixels();
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 6aebe6effa..5d3bfc9902 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -130,7 +130,6 @@ static void fill_src_texture(GrTexture* texture) {
#endif
static void fill_dst_bmp_with_init_data(SkBitmap* bitmap) {
- SkASSERT(bitmap->lockPixelsAreWritable());
SkAutoLockPixels alp(*bitmap);
int w = bitmap->width();
int h = bitmap->height();