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

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: 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 | « src/core/SkBlitter.h ('k') | src/core/SkScan_AntiPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter.cpp
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index cb84ec7d9db0aaa75f8539f7789fba8a5090bc70..e6d2e11d99b46812333900e62c39a31269cd4cbb 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,16 @@ void SkBlitter::blitMask(const SkMask& mask, const SkIRect& clip) {
}
}
+void* SkBlitter::allocBlitMemory(size_t sz) {
+ if (NULL != fBlitMemory) {
reed1 2014/07/21 14:51:13 Should this happen (we get called twice)?
krajcevski 2014/07/21 15:04:41 Added an assert to catch if it is, but we shouldn'
+ 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) {
« no previous file with comments | « 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