diff options
author | 2012-07-26 14:48:52 +0000 | |
---|---|---|
committer | 2012-07-26 14:48:52 +0000 | |
commit | 56f8f338b6d2f9c75bfb045db51405fcab351cd0 (patch) | |
tree | 1787c9201f4bb05f03cd08d3db4c548533974b79 /include | |
parent | 84d67151538e2c465f552121896d211b136aa150 (diff) |
Revert "Remove Bitmaps Raw Pixel Support."
BUG=
TEST=
Review URL: https://codereview.appspot.com/6449049
git-svn-id: http://skia.googlecode.com/svn/trunk@4780 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkBitmap.h | 16 | ||||
-rw-r--r-- | include/core/SkMallocPixelRef.h | 3 |
2 files changed, 11 insertions, 8 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 9ddd702a1f..5673fb289f 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -94,10 +94,10 @@ public: */ bool empty() const { return 0 == fWidth || 0 == fHeight; } - /** Return true iff the bitmap has no pixelref. Note: this can return true even if the - dimensions of the bitmap are > 0 (see empty()). + /** Return true iff the bitmap has no pixels nor a pixelref. Note: this can + return true even if the dimensions of the bitmap are > 0 (see empty()). */ - bool isNull() const { return NULL == fPixelRef; } + bool isNull() const { return NULL == fPixels && NULL == fPixelRef; } /** Return the config for the bitmap. */ @@ -361,9 +361,9 @@ public: SkColorTable* getColorTable() const { return fColorTable; } /** Returns a non-zero, unique value corresponding to the pixels in our - pixelref. Each time the pixels are changed (and notifyPixelsChanged - is called), a different generation ID will be returned. Finally, if - their is no pixelRef then zero is returned. + pixelref (or raw pixels set via setPixels). Each time the pixels are + changed (and notifyPixelsChanged is called), a different generation ID + will be returned. */ uint32_t getGenerationID() const; @@ -612,6 +612,10 @@ private: // or a cache of the returned value from fPixelRef->lockPixels() mutable void* fPixels; mutable SkColorTable* fColorTable; // only meaningful for kIndex8 + // When there is no pixel ref (setPixels was called) we still need a + // gen id for SkDevice implementations that may cache a copy of the + // pixels (e.g. as a gpu texture) + mutable int fRawPixelGenerationID; enum Flags { kImageIsOpaque_Flag = 0x01, diff --git a/include/core/SkMallocPixelRef.h b/include/core/SkMallocPixelRef.h index 1bf1afc694..802e2b2e36 100644 --- a/include/core/SkMallocPixelRef.h +++ b/include/core/SkMallocPixelRef.h @@ -21,7 +21,7 @@ public: last owner of this pixelref is gone. If addr is NULL, sk_malloc_throw() is called to allocate it. */ - SkMallocPixelRef(void* addr, size_t size, SkColorTable* ctable, bool ownPixels = true); + SkMallocPixelRef(void* addr, size_t size, SkColorTable* ctable); virtual ~SkMallocPixelRef(); //! Return the allocation size for the pixels @@ -42,7 +42,6 @@ private: void* fStorage; size_t fSize; SkColorTable* fCTable; - bool fOwnPixels; typedef SkPixelRef INHERITED; }; |