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

Unified Diff: src/gpu/GrPipeline.cpp

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 | « src/gpu/GrPipeline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPipeline.cpp
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index c3b8e77c1aa5317ca7337b0d047535ab5510044a..fbdd84bda5ea1e0066f927fdedc672a6f19c7a81 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -87,20 +87,20 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder,
// Copy Stages from PipelineBuilder to Pipeline
for (int i = firstColorStageIdx; i < pipelineBuilder.numColorFragmentStages(); ++i) {
- SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
- GrPendingFragmentStage,
- (pipelineBuilder.fColorStages[i]));
- usesLocalCoords = usesLocalCoords ||
- pipelineBuilder.fColorStages[i].processor()->usesLocalCoords();
+ const GrFragmentStage& fps = pipelineBuilder.fColorStages[i];
+ const GrFragmentProcessor* fp = fps.processor();
+ SkNEW_APPEND_TO_TARRAY(&fFragmentStages, GrPendingFragmentStage, (fps));
+ usesLocalCoords = usesLocalCoords || fp->usesLocalCoords();
+ fp->gatherCoordTransforms(&fCoordTransforms);
}
fNumColorStages = fFragmentStages.count();
for (int i = firstCoverageStageIdx; i < pipelineBuilder.numCoverageFragmentStages(); ++i) {
- SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
- GrPendingFragmentStage,
- (pipelineBuilder.fCoverageStages[i]));
- usesLocalCoords = usesLocalCoords ||
- pipelineBuilder.fCoverageStages[i].processor()->usesLocalCoords();
+ const GrFragmentStage& fps = pipelineBuilder.fCoverageStages[i];
+ const GrFragmentProcessor* fp = fps.processor();
+ SkNEW_APPEND_TO_TARRAY(&fFragmentStages, GrPendingFragmentStage, (fps));
+ usesLocalCoords = usesLocalCoords || fp->usesLocalCoords();
+ fp->gatherCoordTransforms(&fCoordTransforms);
}
// Setup info we need to pass to GrPrimitiveProcessors that are used with this GrPipeline.
@@ -152,7 +152,7 @@ void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelin
////////////////////////////////////////////////////////////////////////////////
-bool GrPipeline::isEqual(const GrPipeline& that) const {
+bool GrPipeline::isEqual(const GrPipeline& that, bool ignoreCoordTransforms) const {
// If we point to the same pipeline, then we are necessarily equal
if (this == &that) {
return true;
@@ -172,11 +172,9 @@ bool GrPipeline::isEqual(const GrPipeline& that) const {
return false;
}
- // The program desc comparison should have already assured that the stage counts match.
- SkASSERT(this->numFragmentStages() == that.numFragmentStages());
for (int i = 0; i < this->numFragmentStages(); i++) {
-
- if (this->getFragmentStage(i) != that.getFragmentStage(i)) {
+ if (!this->getFragmentStage(i).processor()->isEqual(*that.getFragmentStage(i).processor(),
+ ignoreCoordTransforms)) {
return false;
}
}
« no previous file with comments | « src/gpu/GrPipeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698