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

Unified Diff: src/core/SkBlitter.cpp

Issue 399593007: Let blitters be notified when they're done being used (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Assert if blitter mem allocation is called twice 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
Index: src/core/SkBlitter.cpp
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index cb84ec7d9db0aaa75f8539f7789fba8a5090bc70..b02f58864ef96fa1b0513471764b53c44daf0747 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -20,7 +20,12 @@
#include "SkUtils.h"
#include "SkXfermode.h"
-SkBlitter::~SkBlitter() {}
+SkBlitter::~SkBlitter() {
+ if (NULL != fBlitMemory) {
+ sk_free(fBlitMemory);
+ fBlitMemory = NULL;
+ }
+}
bool SkBlitter::isNullBlitter() const { return false; }
@@ -193,6 +198,17 @@ void SkBlitter::blitMask(const SkMask& mask, const SkIRect& clip) {
}
}
+void* SkBlitter::allocBlitMemory(size_t sz) {
+ SkASSERT(NULL == fBlitMemory);
+ if (NULL != fBlitMemory) {
+ sk_free(fBlitMemory);
+ fBlitMemory = NULL;
+ }
+
+ fBlitMemory = sk_malloc_throw(sz);
+ return fBlitMemory;
+}
+
/////////////////////// these guys are not virtual, just a helpers
void SkBlitter::blitMaskRegion(const SkMask& mask, const SkRegion& clip) {
« src/core/SkBlitter.h ('K') | « src/core/SkBlitter.h ('k') | src/core/SkScan_AntiPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698