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

Unified Diff: src/core/SkBlitter.h

Issue 399593007: Let blitters be notified when they're done being used (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Allocate memory from blitter. Created 6 years, 5 months 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/SkBlitter.cpp » ('j') | src/core/SkBlitter.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter.h
diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h
index 0f1006fcfb70909e640f47b735771dea1b796e5a..8d7df76842d8c254d55c00779d204ed3abc51ee9 100644
--- a/src/core/SkBlitter.h
+++ b/src/core/SkBlitter.h
@@ -25,6 +25,7 @@
*/
class SkBlitter {
public:
+ SkBlitter() : fBlitMemory(NULL) { }
virtual ~SkBlitter();
/// Blit a horizontal run of one or more pixels.
@@ -76,6 +77,14 @@ public:
*/
virtual int requestRowsPreserved() const { return 1; }
+ /**
+ * This function allocates memory for the blitter that the blitter then owns.
+ * The memory can be used by the calling function at will, but it will be
+ * released when the blitter's destructor is called. This function returns
+ * NULL if no persistent memory is needed by the blitter.
+ */
+ void* allocBlitMemory(size_t);
+
///@name non-virtual helpers
void blitMaskRegion(const SkMask& mask, const SkRegion& clip);
void blitRectRegion(const SkIRect& rect, const SkRegion& clip);
@@ -98,6 +107,10 @@ public:
SkTBlitterAllocator*);
///@}
+protected:
+
+ void* fBlitMemory;
+
private:
};
« no previous file with comments | « no previous file | src/core/SkBlitter.cpp » ('j') | src/core/SkBlitter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698