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

Unified Diff: src/gpu/GrProcessor.cpp

Issue 1275853005: All child GrFragmentProcs' transforms and textures will be stored in the root GrFragmentProc in pre… (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: child procs keep copy of their arrays 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 | « include/gpu/GrStagedProcessor.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrProcessor.cpp
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index b990f9b2859b8806b2370dc79acda30840c0340e..6cc2a20d719b4c2b69e0064e1cc7e681beb6ffc5 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -135,17 +135,34 @@ void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) {
SkDEBUGCODE(transform->setInProcessor();)
}
-void GrFragmentProcessor::registerChildProcessor(GrFragmentProcessor* child) {
- fChildProcessors.push_back(child);
+int GrFragmentProcessor::registerChildProcessor(const GrFragmentProcessor* child) {
+ // Append the child's transforms to our transforms array and the child's textures array to our
+ // textures array
+ if (!child->fCoordTransforms.empty()) {
+ fCoordTransforms.push_back_n(child->fCoordTransforms.count(),
+ child->fCoordTransforms.begin());
+ }
+ if (!child->fTextureAccesses.empty()) {
+ fTextureAccesses.push_back_n(child->fTextureAccesses.count(),
+ child->fTextureAccesses.begin());
+ }
+
+ int index = fChildProcessors.count();
+ fChildProcessors.push_back(GrFragmentStage(child));
+
+ if (child->willReadFragmentPosition())
+ this->setWillReadFragmentPosition();
+
+ return index;
}
bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) const {
- if (fCoordTransforms.count() != that.fCoordTransforms.count()) {
+ if (this->numTransforms() != that.numTransforms()) {
return false;
}
- int count = fCoordTransforms.count();
+ int count = this->numTransforms();
for (int i = 0; i < count; ++i) {
- if (*fCoordTransforms[i] != *that.fCoordTransforms[i]) {
+ if (this->coordTransform(i) != that.coordTransform(i)) {
return false;
}
}
« no previous file with comments | « include/gpu/GrStagedProcessor.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698