Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: include/core/SkDevice.h

Issue 2168483003: Deprecate SkDevice::accessBitmap method (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/core/SkDevice.h
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index f06abdeee438515071b542287d17dc047423d77e..4a2d656e978a735fd27121291d26b184da668425 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -77,6 +77,7 @@ public:
return this->imageInfo().isOpaque();
}
+#ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP
/** Return the bitmap associated with this device. Call this each time you need
to access the bitmap, as it notifies the subclass to perform any flushing
etc. before you examine the pixels.
@@ -84,6 +85,7 @@ public:
@return the device's bitmap
*/
const SkBitmap& accessBitmap(bool changePixels);
+#endif
bool writePixels(const SkImageInfo&, const void*, size_t rowBytes, int x, int y);
@@ -276,11 +278,16 @@ protected:
///////////////////////////////////////////////////////////////////////////
+#ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP
/** Update as needed the pixel value in the bitmap, so that the caller can
access the pixels directly.
@return The device contents as a bitmap
*/
- virtual const SkBitmap& onAccessBitmap() = 0;
+ virtual const SkBitmap& onAccessBitmap() {
+ SkASSERT(0);
+ return fLegacyBitmap;
+ }
+#endif
virtual GrContext* context() const { return nullptr; }
@@ -387,6 +394,10 @@ private:
SkMetaData* fMetaData;
SkSurfaceProps fSurfaceProps;
+#ifdef SK_SUPPORT_LEGACY_ACCESSBITMAP
+ SkBitmap fLegacyBitmap;
+#endif
+
#ifdef SK_DEBUG
bool fAttachedToCanvas;
#endif
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | src/core/SkDevice.cpp » ('j') | src/gpu/SkGpuDevice.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698