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

Unified Diff: src/gpu/GrEffect.cpp

Issue 24853002: Make GPU coord transforms automatic (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrOvalRenderer.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 53dabb619c063e30dbf842c8d9df6e22ed7f03c6..653a1da33cb4c2226cf340e7d2e780871d18de39 100644
--- a/src/gpu/GrEffect.cpp
+++ b/src/gpu/GrEffect.cpp
@@ -8,6 +8,7 @@
#include "GrEffect.h"
#include "GrBackendEffectFactory.h"
#include "GrContext.h"
+#include "GrCoordTransform.h"
#include "GrMemoryPool.h"
#include "SkTLS.h"
@@ -86,6 +87,10 @@ const char* GrEffect::name() const {
return this->getFactory().name();
}
+void GrEffect::addCoordTransform(const GrCoordTransform* transform) {
+ fCoordTransforms.push_back(transform);
+}
+
void GrEffect::addTextureAccess(const GrTextureAccess* access) {
fTextureAccesses.push_back(access);
}
@@ -97,3 +102,16 @@ void* GrEffect::operator new(size_t size) {
void GrEffect::operator delete(void* target) {
GrEffect_Globals::GetTLS()->release(target);
}
+
+#ifdef SK_DEBUG
+void GrEffect::assertEquality(const GrEffect& other) const {
+ SkASSERT(this->numTransforms() == other.numTransforms());
+ for (int i = 0; i < this->numTransforms(); ++i) {
+ SkASSERT(this->coordTransform(i) == other.coordTransform(i));
+ }
+ SkASSERT(this->numTextures() == other.numTextures());
+ for (int i = 0; i < this->numTextures(); ++i) {
+ SkASSERT(this->textureAccess(i) == other.textureAccess(i));
+ }
+}
+#endif
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698