diff options
Diffstat (limited to 'include/core/SkBitmap.h')
-rw-r--r-- | include/core/SkBitmap.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 2d5fc41..e125924 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -551,6 +551,17 @@ public: void flatten(SkFlattenableWriteBuffer&) const; void unflatten(SkFlattenableReadBuffer&); + /** Get the unscaled version of this SkBitmap (may be null; in fact it usually will be) + */ + SkBitmap* unscaledBitmap() const { return fUnscaledBitmap; } + + /** Assign an unscaled bitmap so we can do some transforms with it + * TODO do some basic error-checking (make sure URIs match?) + */ + SkBitmap* setUnscaledBitmap(SkBitmap* unscaledBitmap) { return fUnscaledBitmap = unscaledBitmap; } + + void freeUnscaledBitmap(); + SkDEBUGCODE(void validate() const;) class Allocator : public SkRefCnt { @@ -611,6 +622,11 @@ private: // pixels (e.g. as a gpu texture) mutable int fRawPixelGenerationID; + // Holds shadow copy of this bitmap in cases where it was pre-upscaled, and + // we want to retain the original for possible performance improvements in + // later transformations + mutable SkBitmap* fUnscaledBitmap; + enum Flags { kImageIsOpaque_Flag = 0x01, kImageIsVolatile_Flag = 0x02, |