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

Unified Diff: include/core/SkPixelRef.h

Issue 320873003: change pixelref to not inherit from SkFlattenable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « include/core/SkMallocPixelRef.h ('k') | include/core/SkReadBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPixelRef.h
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 842f493d47bb4470db512b9ea0e8581d3471e692..a997993eb11e1d7f0a570c6e899deea66320c8a8 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -31,6 +31,13 @@
// #define SK_IGNORE_PIXELREF_SETPRELOCKED
#endif
+#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
+ // we only support unflattening, not flattening
+ #define SK_PIXELREF_BASECLASS SkFlattenable
+#else
+ #define SK_PIXELREF_BASECLASS SkRefCnt
+#endif
+
class SkColorTable;
class SkData;
struct SkIRect;
@@ -46,7 +53,7 @@ class GrTexture;
This class can be shared/accessed between multiple threads.
*/
-class SK_API SkPixelRef : public SkFlattenable {
+class SK_API SkPixelRef : public SK_PIXELREF_BASECLASS {
public:
SK_DECLARE_INST_COUNT(SkPixelRef)
@@ -250,7 +257,9 @@ public:
virtual void globalUnref();
#endif
+#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
SK_DEFINE_FLATTENABLE_TYPE(SkPixelRef)
+#endif
// Register a listener that may be called the next time our generation ID changes.
//
@@ -324,7 +333,6 @@ protected:
// serialization
SkPixelRef(SkReadBuffer&, SkBaseMutex*);
- virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
// only call from constructor. Flags this to always be locked, removing
// the need to grab the mutex and call onLockPixels/onUnlockPixels.
@@ -363,7 +371,11 @@ private:
friend class SkBitmap; // only for cloneGenID
void cloneGenID(const SkPixelRef&);
- typedef SkFlattenable INHERITED;
+#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE
+ virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE { sk_throw(); }
+#endif
+
+ typedef SK_PIXELREF_BASECLASS INHERITED;
};
class SkPixelRefFactory : public SkRefCnt {
« no previous file with comments | « include/core/SkMallocPixelRef.h ('k') | include/core/SkReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698