aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-07 16:27:57 +0000
committerGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-07 16:27:57 +0000
commit1f9767c03bad1ef85e5388d84e23e4b5dff4bc1a (patch)
treee6ea138a19024226eec416fec1959d8a16ed5c81 /include
parent4bcb0c6e0377557d326344f4bd2bbab4e8b1bc3a (diff)
Fixing backing store access in SkDeferredCanvas.
Chromium CL required for rolling skia DEPS past this change is posted here: https://chromiumcodereview.appspot.com/9341003/ BUG=http://code.google.com/p/skia/issues/detail?id=475 REVIEW=http://codereview.appspot.com/5626047/ TEST=DeferredCanvas unit test git-svn-id: http://skia.googlecode.com/svn/trunk@3147 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkDevice.h11
-rw-r--r--include/utils/SkDeferredCanvas.h3
2 files changed, 9 insertions, 5 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 6259fe419b..3303981c74 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -279,11 +279,14 @@ protected:
///////////////////////////////////////////////////////////////////////////
- /** Update as needed the pixel value in the bitmap, so that the caller can access
- the pixels directly. Note: only the pixels field should be altered. The config/width/height/rowbytes
- must remain unchanged.
+ /** Update as needed the pixel value in the bitmap, so that the caller can
+ access the pixels directly. Note: only the pixels field should be
+ altered. The config/width/height/rowbytes must remain unchanged.
+ @param bitmap The device's bitmap
+ @return Echo the bitmap parameter, or an alternate (shadow) bitmap
+ maintained by the subclass.
*/
- virtual void onAccessBitmap(SkBitmap*);
+ virtual const SkBitmap& onAccessBitmap(SkBitmap*);
SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); }
// just for subclasses, to assign a custom pixelref
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index b1241bdb6e..19d7141bc8 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -199,7 +199,7 @@ public:
SkCanvas::Config8888 config8888) SK_OVERRIDE;
protected:
- virtual void onAccessBitmap(SkBitmap*) SK_OVERRIDE;
+ virtual const SkBitmap& onAccessBitmap(SkBitmap*) SK_OVERRIDE;
virtual bool onReadPixels(const SkBitmap& bitmap,
int x, int y,
SkCanvas::Config8888 config8888) SK_OVERRIDE;
@@ -275,6 +275,7 @@ public:
SkCanvas* fImmediateCanvas;
SkCanvas* fRecordingCanvas;
DeviceContext* fDeviceContext;
+ bool fBitmapInitialized;
};
DeferredDevice* getDeferredDevice() const;