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

Unified Diff: src/gpu/GrFragmentProcessor.cpp

Issue 2351753002: Revert of Stop flattening GrCoordTransforms in parent GrFragmentProcessors. (Closed)
Patch Set: Created 4 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/GrDefaultGeoProcFactory.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/GrFragmentProcessor.cpp
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 3dfe25ea28517e4eb14ad4edcb137a90db73b71a..a9d4a5e8a18bcb4ec6b976b154b732ae3d9c718a 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -8,7 +8,6 @@
#include "GrFragmentProcessor.h"
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
-#include "GrPipeline.h"
#include "GrProcOptInfo.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
@@ -82,10 +81,16 @@
fCoordTransforms.push_back(transform);
fUsesLocalCoords = fUsesLocalCoords || transform->sourceCoords() == kLocal_GrCoordSet;
SkDEBUGCODE(transform->setInProcessor();)
+ fNumTransformsExclChildren++;
}
int GrFragmentProcessor::registerChildProcessor(sk_sp<GrFragmentProcessor> child) {
- // Append the child's textures array to our textures array
+ // 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());
@@ -115,10 +120,10 @@
}
bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) const {
- if (this->numCoordTransforms() != that.numCoordTransforms()) {
+ if (this->numTransforms() != that.numTransforms()) {
return false;
}
- int count = this->numCoordTransforms();
+ int count = this->numTransforms();
for (int i = 0; i < count; ++i) {
if (this->coordTransform(i) != that.coordTransform(i)) {
return false;
@@ -403,39 +408,3 @@
}
return sk_sp<GrFragmentProcessor>(new SeriesFragmentProcessor(series, cnt));
}
-
-//////////////////////////////////////////////////////////////////////////////
-
-GrFragmentProcessor::Iter::Iter(const GrPipeline& pipeline) {
- for (int i = pipeline.numFragmentProcessors() - 1; i >= 0; --i) {
- fFPStack.push_back(&pipeline.getFragmentProcessor(i));
- }
-}
-
-const GrFragmentProcessor* GrFragmentProcessor::Iter::next() {
- if (fFPStack.empty()) {
- return nullptr;
- }
- const GrFragmentProcessor* back = fFPStack.back();
- fFPStack.pop_back();
- for (int i = back->numChildProcessors() - 1; i >= 0; --i) {
- fFPStack.push_back(&back->childProcessor(i));
- }
- return back;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-const GrCoordTransform* GrFragmentProcessor::CoordTransformIter::next() {
- if (!fCurrFP) {
- return nullptr;
- }
- while (fCTIdx == fCurrFP->numCoordTransforms()) {
- fCTIdx = 0;
- fCurrFP = fFPIter.next();
- if (!fCurrFP) {
- return nullptr;
- }
- }
- return &fCurrFP->coordTransform(fCTIdx++);
-}
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698