OLD | NEW |
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 Loading... |
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->getProgramTexture()); | 75 this->addGpuResource(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 |
OLD | NEW |