diff options
author | Patrick Dubroy <dubroy@google.com> | 2010-12-06 21:08:00 -0800 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2010-12-14 12:22:12 -0800 |
commit | bdc1207aa05f2f1b013e937f9cbe4795768eaa74 (patch) | |
tree | 0596a1cf32a7611bea4eaf83c63d77c1557cc0a9 /include | |
parent | 9717bd93d86e12d2b9a506179493dd50613e99b2 (diff) | |
download | external_skia-bdc1207aa05f2f1b013e937f9cbe4795768eaa74.zip external_skia-bdc1207aa05f2f1b013e937f9cbe4795768eaa74.tar.gz external_skia-bdc1207aa05f2f1b013e937f9cbe4795768eaa74.tar.bz2 |
Changes to support bitmaps allocated in the Java heap.
Change-Id: Ib083409abc4110dafa32b5ee4bfa01c0caeb907b
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkBitmap.h | 7 | ||||
-rw-r--r-- | include/core/SkMallocPixelRef.h | 3 | ||||
-rw-r--r-- | include/core/SkPixelRef.h | 12 |
3 files changed, 20 insertions, 2 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 1c16b78..1def198 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -396,10 +396,15 @@ public: int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy); void extractAlpha(SkBitmap* dst) const { - this->extractAlpha(dst, NULL, NULL); + this->extractAlpha(dst, NULL, NULL, NULL); } void extractAlpha(SkBitmap* dst, const SkPaint* paint, + SkIPoint* offset) const { + this->extractAlpha(dst, paint, NULL, offset); + } + + void extractAlpha(SkBitmap* dst, const SkPaint* paint, Allocator* allocator, SkIPoint* offset) const; void flatten(SkFlattenableWriteBuffer&) const; diff --git a/include/core/SkMallocPixelRef.h b/include/core/SkMallocPixelRef.h index b6a013d..1c36b74 100644 --- a/include/core/SkMallocPixelRef.h +++ b/include/core/SkMallocPixelRef.h @@ -49,8 +49,9 @@ protected: SkMallocPixelRef(SkFlattenableReadBuffer& buffer); -private: void* fStorage; + +private: size_t fSize; SkColorTable* fCTable; diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index 82e5ca7..fceef4d 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -112,6 +112,18 @@ public: virtual Factory getFactory() const { return NULL; } virtual void flatten(SkFlattenableWriteBuffer&) const; + /** Acquire a "global" ref on this object. + * The default implementation just calls ref(), but subclasses can override + * this method to implement additional behavior. + */ + virtual void globalRef(); + + /** Release a "global" ref on this object. + * The default implementation just calls unref(), but subclasses can override + * this method to implement additional behavior. + */ + virtual void globalUnref(); + static Factory NameToFactory(const char name[]); static const char* FactoryToName(Factory); static void Register(const char name[], Factory); |