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

Unified Diff: include/gpu/GrFragmentProcessor.h

Issue 1275603002: Expose coord transforms from GrPipeline (Closed) Base URL: https://skia.googlesource.com/skia.git@lccleanup4
Patch Set: feedback inc Created 5 years, 4 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 | « no previous file | src/gpu/GrPipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrFragmentProcessor.h
diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h
index 8fc3ec1d4b3fe9aed42f228a37065dfa8c99ccdd..2dc79809647758e9e6d3eac4498b31fa996cdffe 100644
--- a/include/gpu/GrFragmentProcessor.h
+++ b/include/gpu/GrFragmentProcessor.h
@@ -60,6 +60,15 @@ public:
return fCoordTransforms;
}
+ /** Gather the coord transforms into an array. We use preorder traversal */
+ void gatherCoordTransforms(SkTArray<const GrCoordTransform*, true>* outTransforms) const {
+ SkASSERT(outTransforms);
+ outTransforms->push_back_n(fCoordTransforms.count(), fCoordTransforms.begin());
+ for (int i = 0; i < fChildProcessors.count(); ++i) {
+ fChildProcessors[i]->gatherCoordTransforms(outTransforms);
+ }
+ }
+
int numChildProcessors() const { return fChildProcessors.count(); }
GrFragmentProcessor* childProcessor(int index) const { return fChildProcessors[index]; }
@@ -85,12 +94,18 @@ public:
A return value of true from isEqual() should not be used to test whether the processor would
generate the same shader code. To test for identical code generation use getGLProcessorKey*/
- bool isEqual(const GrFragmentProcessor& that) const {
+ bool isEqual(const GrFragmentProcessor& that, bool ignoreCoordTransforms) const {
if (this->classID() != that.classID() ||
- !this->hasSameTransforms(that) ||
!this->hasSameTextureAccesses(that)) {
return false;
}
+ if (ignoreCoordTransforms) {
+ if (this->numTransforms() != that.numTransforms()) {
+ return false;
+ }
+ } else if (!this->hasSameTransforms(that)) {
+ return false;
+ }
return this->onIsEqual(that);
}
« no previous file with comments | « no previous file | src/gpu/GrPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698