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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 641223002: Store color and coverage stages in a single array in GrOptDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove trailing whitespace Created 6 years, 2 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/GrOptDrawState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOptDrawState.cpp
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index c8218d7a9020a617d2cc4ffae75dc497d885916f..b3d90f7310204f7958a2a29fb42050e640c11a0c 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -61,23 +61,20 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
// Copy Color Stages from DS to ODS
if (firstColorStageIdx < drawState.numColorStages()) {
- fColorStages.reset(&drawState.getColorStage(firstColorStageIdx),
- drawState.numColorStages() - firstColorStageIdx);
+ fFragmentStages.reset(&drawState.getColorStage(firstColorStageIdx),
+ drawState.numColorStages() - firstColorStageIdx);
} else {
- fColorStages.reset();
+ fFragmentStages.reset();
}
+ fNumColorStages = fFragmentStages.count();
+
// Copy Coverage Stages from DS to ODS
- if (firstCoverageStageIdx < drawState.numCoverageStages() && separateCoverageFromColor) {
- fCoverageStages.reset(&drawState.getCoverageStage(firstCoverageStageIdx),
- drawState.numCoverageStages() - firstCoverageStageIdx);
- } else {
- fCoverageStages.reset();
- if (firstCoverageStageIdx < drawState.numCoverageStages()) {
- // TODO: Once we have flag to know if we only multiply on stages, only push coverage
- // into color stages if everything is multiply
- fColorStages.push_back_n(drawState.numCoverageStages() - firstCoverageStageIdx,
- &drawState.getCoverageStage(firstCoverageStageIdx));
+ if (firstCoverageStageIdx < drawState.numCoverageStages()) {
+ fFragmentStages.push_back_n(drawState.numCoverageStages() - firstCoverageStageIdx,
+ &drawState.getCoverageStage(firstCoverageStageIdx));
+ if (!separateCoverageFromColor) {
+ fNumColorStages = fFragmentStages.count();
}
}
};
@@ -326,8 +323,8 @@ bool GrOptDrawState::isEqual(const GrOptDrawState& that) const {
}
if (this->getRenderTarget() != that.getRenderTarget() ||
- this->fColorStages.count() != that.fColorStages.count() ||
- this->fCoverageStages.count() != that.fCoverageStages.count() ||
+ this->fFragmentStages.count() != that.fFragmentStages.count() ||
+ this->fNumColorStages != that.fNumColorStages ||
!this->fViewMatrix.cheapEqualTo(that.fViewMatrix) ||
this->fSrcBlend != that.fSrcBlend ||
this->fDstBlend != that.fDstBlend ||
@@ -366,14 +363,8 @@ bool GrOptDrawState::isEqual(const GrOptDrawState& that) const {
return false;
}
- for (int i = 0; i < this->numColorStages(); i++) {
- if (!GrProcessorStage::AreCompatible(this->getColorStage(i), that.getColorStage(i),
- explicitLocalCoords)) {
- return false;
- }
- }
- for (int i = 0; i < this->numCoverageStages(); i++) {
- if (!GrProcessorStage::AreCompatible(this->getCoverageStage(i), that.getCoverageStage(i),
+ for (int i = 0; i < this->numFragmentStages(); i++) {
+ if (!GrProcessorStage::AreCompatible(this->getFragmentStage(i), that.getFragmentStage(i),
explicitLocalCoords)) {
return false;
}
« no previous file with comments | « src/gpu/GrOptDrawState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698