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

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

Issue 563963004: Make templated GrProgramTResource subclass of GrProgramResource (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrRODrawState.h » ('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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return this->getFactory().name(); 65 return this->getFactory().name();
66 } 66 }
67 67
68 void GrEffect::addCoordTransform(const GrCoordTransform* transform) { 68 void GrEffect::addCoordTransform(const GrCoordTransform* transform) {
69 fCoordTransforms.push_back(transform); 69 fCoordTransforms.push_back(transform);
70 SkDEBUGCODE(transform->setInEffect();) 70 SkDEBUGCODE(transform->setInEffect();)
71 } 71 }
72 72
73 void GrEffect::addTextureAccess(const GrTextureAccess* access) { 73 void GrEffect::addTextureAccess(const GrTextureAccess* access) {
74 fTextureAccesses.push_back(access); 74 fTextureAccesses.push_back(access);
75 this->addProgramResource(access->getTextureProgramResource()); 75 this->addProgramResource(access->getProgramTexture());
76 } 76 }
77 77
78 void* GrEffect::operator new(size_t size) { 78 void* GrEffect::operator new(size_t size) {
79 return GrEffect_Globals::GetTLS()->allocate(size); 79 return GrEffect_Globals::GetTLS()->allocate(size);
80 } 80 }
81 81
82 void GrEffect::operator delete(void* target) { 82 void GrEffect::operator delete(void* target) {
83 GrEffect_Globals::GetTLS()->release(target); 83 GrEffect_Globals::GetTLS()->release(target);
84 } 84 }
85 85
86 #ifdef SK_DEBUG 86 #ifdef SK_DEBUG
87 void GrEffect::assertEquality(const GrEffect& other) const { 87 void GrEffect::assertEquality(const GrEffect& other) const {
88 SkASSERT(this->numTransforms() == other.numTransforms()); 88 SkASSERT(this->numTransforms() == other.numTransforms());
89 for (int i = 0; i < this->numTransforms(); ++i) { 89 for (int i = 0; i < this->numTransforms(); ++i) {
90 SkASSERT(this->coordTransform(i) == other.coordTransform(i)); 90 SkASSERT(this->coordTransform(i) == other.coordTransform(i));
91 } 91 }
92 SkASSERT(this->numTextures() == other.numTextures()); 92 SkASSERT(this->numTextures() == other.numTextures());
93 for (int i = 0; i < this->numTextures(); ++i) { 93 for (int i = 0; i < this->numTextures(); ++i) {
94 SkASSERT(this->textureAccess(i) == other.textureAccess(i)); 94 SkASSERT(this->textureAccess(i) == other.textureAccess(i));
95 } 95 }
96 } 96 }
97 #endif 97 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrRODrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698