Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: include/core/SkMallocPixelRef.h

Issue 83663006: Modify SkLazyPixelRef to use SkImageGenerator. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: reupload Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkMallocPixelRef.cpp » ('j') | src/core/SkMallocPixelRef.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | src/core/SkMallocPixelRef.cpp » ('j') | src/core/SkMallocPixelRef.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698