Index: src/core/SkBitmapDevice.cpp |
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp |
index 5b2fc38e321cc48f6e6aff68f822e92fd8bcf727..995b427697f5ff6ca3ae632da3a9af3a5be9d44e 100644 |
--- a/src/core/SkBitmapDevice.cpp |
+++ b/src/core/SkBitmapDevice.cpp |
@@ -120,18 +120,6 @@ SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa |
return SkBitmapDevice::Create(cinfo.fInfo, &leaky); |
} |
-void SkBitmapDevice::lockPixels() { |
- if (fBitmap.lockPixelsAreWritable()) { |
- fBitmap.lockPixels(); |
- } |
-} |
- |
-void SkBitmapDevice::unlockPixels() { |
- if (fBitmap.lockPixelsAreWritable()) { |
- fBitmap.unlockPixels(); |
- } |
-} |
- |
const SkBitmap& SkBitmapDevice::onAccessBitmap() { |
return fBitmap; |
} |
@@ -172,6 +160,20 @@ bool SkBitmapDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, s |
return fBitmap.readPixels(dstInfo, dstPixels, dstRowBytes, x, y); |
} |
+void SkBitmapDevice::onAttachToCanvas(SkCanvas* canvas) { |
+ INHERITED::onAttachToCanvas(canvas); |
+ if (fBitmap.lockPixelsAreWritable()) { |
+ fBitmap.lockPixels(); |
+ } |
+} |
+ |
+void SkBitmapDevice::onDetachFromCanvas() { |
+ INHERITED::onDetachFromCanvas(); |
+ if (fBitmap.lockPixelsAreWritable()) { |
+ fBitmap.unlockPixels(); |
+ } |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
void SkBitmapDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { |