diff options
author | reed <reed@google.com> | 2014-07-07 14:32:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-07-07 14:32:06 -0700 |
commit | 9a9eae21ed5235869702a66d6decddd6643792c3 (patch) | |
tree | a790837e35bb43388491a095adb69896fdc660bc /src/lazy | |
parent | 620fc60b0486765d5bf9d9d3ea50dabe4f358307 (diff) |
change pixelref to not inherit from SkFlattenable
If I can "inline" MallocPixelRef unflatten, then I think we can delete this code. The only caller today should be unflattening in the legacy path for bitmaps.
R=robertphillips@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/320873003
Diffstat (limited to 'src/lazy')
-rw-r--r-- | src/lazy/SkCachingPixelRef.h | 3 | ||||
-rw-r--r-- | src/lazy/SkDiscardablePixelRef.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/lazy/SkCachingPixelRef.h b/src/lazy/SkCachingPixelRef.h index 9fc71c3616..193fe45482 100644 --- a/src/lazy/SkCachingPixelRef.h +++ b/src/lazy/SkCachingPixelRef.h @@ -48,12 +48,15 @@ protected: virtual SkData* onRefEncodedData() SK_OVERRIDE { return fImageGenerator->refEncodedData(); } + +#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE // No need to flatten this object. When flattening an SkBitmap, // SkWriteBuffer will check the encoded data and write that // instead. // Future implementations of SkWriteBuffer will need to // special case for onRefEncodedData as well. SK_DECLARE_UNFLATTENABLE_OBJECT() +#endif private: SkImageGenerator* const fImageGenerator; diff --git a/src/lazy/SkDiscardablePixelRef.h b/src/lazy/SkDiscardablePixelRef.h index 52a1d6ce37..ae955d6eba 100644 --- a/src/lazy/SkDiscardablePixelRef.h +++ b/src/lazy/SkDiscardablePixelRef.h @@ -21,7 +21,9 @@ class SkDiscardablePixelRef : public SkPixelRef { public: SK_DECLARE_INST_COUNT(SkDiscardablePixelRef) +#ifdef SK_SUPPORT_LEGACY_PIXELREF_UNFLATTENABLE SK_DECLARE_UNFLATTENABLE_OBJECT() +#endif protected: ~SkDiscardablePixelRef(); |