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

Unified Diff: src/gpu/GrEffect.cpp

Issue 372053003: Revert of Make GrDrawState and GrPaint take GrEffect* instead of GrEffectRef*. (Closed) Base URL: https://skia.googlesource.com/skia.git@no_ref
Patch Set: 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/gpu/GrDrawState.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrEffect.cpp
diff --git a/src/gpu/GrEffect.cpp b/src/gpu/GrEffect.cpp
index f952483562766fdb3e5d7f1fe1eb578cd794432a..986e80a57ee0196d04354e4a4bbfb56857c1e70e 100644
--- a/src/gpu/GrEffect.cpp
+++ b/src/gpu/GrEffect.cpp
@@ -59,7 +59,25 @@
///////////////////////////////////////////////////////////////////////////////
-GrEffect::~GrEffect() {}
+GrEffectRef::~GrEffectRef() {
+ SkASSERT(this->unique());
+ fEffect->EffectRefDestroyed();
+ fEffect->unref();
+}
+
+void* GrEffectRef::operator new(size_t size) {
+ return GrEffect_Globals::GetTLS()->allocate(size);
+}
+
+void GrEffectRef::operator delete(void* target) {
+ GrEffect_Globals::GetTLS()->release(target);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+GrEffect::~GrEffect() {
+ SkASSERT(NULL == fEffectRef);
+}
const char* GrEffect::name() const {
return this->getFactory().name();
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698