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

Side by Side Diff: src/gpu/GrEffect.cpp

Issue 18770007: Add a 'unique' method to SkRefCnt, document the usage, and add support. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Update comments. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrEffect.h" 8 #include "GrEffect.h"
9 #include "GrBackendEffectFactory.h" 9 #include "GrBackendEffectFactory.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 }; 57 };
58 58
59 int32_t GrBackendEffectFactory::fCurrEffectClassID = GrBackendEffectFactory::kIl legalEffectClassID; 59 int32_t GrBackendEffectFactory::fCurrEffectClassID = GrBackendEffectFactory::kIl legalEffectClassID;
60 60
61 /////////////////////////////////////////////////////////////////////////////// 61 ///////////////////////////////////////////////////////////////////////////////
62 62
63 SK_DEFINE_INST_COUNT(GrEffectRef) 63 SK_DEFINE_INST_COUNT(GrEffectRef)
64 64
65 GrEffectRef::~GrEffectRef() { 65 GrEffectRef::~GrEffectRef() {
66 GrAssert(1 == this->getRefCnt()); 66 GrAssert(this->unique());
67 fEffect->EffectRefDestroyed(); 67 fEffect->EffectRefDestroyed();
68 fEffect->unref(); 68 fEffect->unref();
69 } 69 }
70 70
71 void* GrEffectRef::operator new(size_t size) { 71 void* GrEffectRef::operator new(size_t size) {
72 return GrEffect_Globals::GetTLS()->allocate(size); 72 return GrEffect_Globals::GetTLS()->allocate(size);
73 } 73 }
74 74
75 void GrEffectRef::operator delete(void* target) { 75 void GrEffectRef::operator delete(void* target) {
76 GrEffect_Globals::GetTLS()->release(target); 76 GrEffect_Globals::GetTLS()->release(target);
(...skipping 18 matching lines...) Expand all
95 fVertexAttribTypes.push_back(type); 95 fVertexAttribTypes.push_back(type);
96 } 96 }
97 97
98 void* GrEffect::operator new(size_t size) { 98 void* GrEffect::operator new(size_t size) {
99 return GrEffect_Globals::GetTLS()->allocate(size); 99 return GrEffect_Globals::GetTLS()->allocate(size);
100 } 100 }
101 101
102 void GrEffect::operator delete(void* target) { 102 void GrEffect::operator delete(void* target) {
103 GrEffect_Globals::GetTLS()->release(target); 103 GrEffect_Globals::GetTLS()->release(target);
104 } 104 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698