Chromium Code Reviews| Index: include/core/SkMallocPixelRef.h |
| diff --git a/include/core/SkMallocPixelRef.h b/include/core/SkMallocPixelRef.h |
| index 2241a513e7ea223ac8ddeac340bf8f73ee92d2ca..5fce5591ac418cdae64ad6f7ce1123d2a1237773 100644 |
| --- a/include/core/SkMallocPixelRef.h |
| +++ b/include/core/SkMallocPixelRef.h |
| @@ -12,6 +12,9 @@ |
| #include "SkPixelRef.h" |
| +class SkBitmap; |
| +class SkImageGenerator; |
| + |
| /** We explicitly use the same allocator for our pixels that SkMask does, |
| so that we can freely assign memory allocated by one class to the other. |
| */ |
| @@ -24,7 +27,18 @@ public: |
| SkMallocPixelRef(void* addr, size_t size, SkColorTable* ctable, bool ownPixels = true); |
| virtual ~SkMallocPixelRef(); |
| - //! Return the allocation size for the pixels |
| + /** |
| + * Create a new SkMallocPixelRef and install it in the destination |
| + * bitmap, based on the SkImageGenerator. The SkImageGenerator |
| + * will be deleted. |
| + * |
| + * @returns false on any error. |
| + */ |
| + static bool Install(SkImageGenerator* generator, SkBitmap* destination); |
|
scroggo
2013/12/02 19:03:23
Is there a reason these changes aren't included in
|
| + |
| + /** |
| + * Return the allocation size for the pixels |
| + */ |
| size_t getSize() const { return fSize; } |
| void* getAddr() const { return fStorage; } |
| @@ -32,7 +46,7 @@ public: |
| protected: |
| // overrides from SkPixelRef |
| - virtual void* onLockPixels(SkColorTable**); |
| + virtual void* onLockPixels(SkColorTable** colorTable); |
|
reed1
2013/11/25 18:06:56
It is ok to leave off these parameter variable nam
|
| virtual void onUnlockPixels(); |
| SkMallocPixelRef(SkFlattenableReadBuffer& buffer); |