From 5370cd969d8f3957e4306068e6195ac1bca3d6cd Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Wed, 28 Mar 2012 20:47:01 +0000 Subject: Consolidate PixelRef flattables with the standard impl The flatten method on these functions can no longer be const as SkFlattenables declaration is not const and would result in the const methods only being called when the reference to the object was const. Review URL: https://codereview.appspot.com/5941043 git-svn-id: http://skia.googlecode.com/svn/trunk@3533 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/images/SkFlipPixelRef.h | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'include/images/SkFlipPixelRef.h') diff --git a/include/images/SkFlipPixelRef.h b/include/images/SkFlipPixelRef.h index 455a3dace3..c9ba026878 100644 --- a/include/images/SkFlipPixelRef.h +++ b/include/images/SkFlipPixelRef.h @@ -32,6 +32,15 @@ public: const SkRegion& beginUpdate(SkBitmap* device); void endUpdate(); + + virtual void flatten(SkFlattenableWriteBuffer&); + SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFlipPixelRef) + +protected: + virtual void* onLockPixels(SkColorTable**); + virtual void onUnlockPixels(); + + SkFlipPixelRef(SkFlattenableReadBuffer&); private: void getFrontBack(const void** front, void** back) const { @@ -50,22 +59,6 @@ private: static void CopyBitsFromAddr(const SkBitmap& dst, const SkRegion& clip, const void* srcAddr); - // serialization - -public: - virtual Factory getFactory() const { return Create; } - virtual void flatten(SkFlattenableWriteBuffer&) const; - static SkPixelRef* Create(SkFlattenableReadBuffer& buffer); - - SK_DECLARE_PIXEL_REF_REGISTRAR() - -protected: - virtual void* onLockPixels(SkColorTable**); - virtual void onUnlockPixels(); - - SkFlipPixelRef(SkFlattenableReadBuffer&); - -private: SkMutex fMutex; SkPageFlipper fFlipper; -- cgit v1.2.3