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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 699023003: remove separate color from coverage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 1 month 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/GrDrawState.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index c82c5adad1f771354e711e1ce149234d8ee77acf..1f9f6967c2d717ce8c1a0083de8d3c1f3871ebea 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -185,7 +185,7 @@ void GrDrawState::onReset(const SkMatrix* initialViewMatrix) {
}
bool GrDrawState::setIdentityViewMatrix() {
- if (this->numTotalStages()) {
+ if (this->numFragmentStages()) {
SkMatrix invVM;
if (!fViewMatrix.invert(&invVM)) {
// sad trombone sound
@@ -378,6 +378,10 @@ bool GrDrawState::hasSolidCoverage() const {
return true;
}
+ if (this->numCoverageStages() > 0) {
+ return false;
+ }
+
GrProcessor::InvariantOutput inout;
inout.fIsSingleComponent = true;
// Initialize to an unknown starting coverage if per-vertex coverage is specified.
@@ -388,15 +392,11 @@ bool GrDrawState::hasSolidCoverage() const {
inout.fValidFlags = kRGBA_GrColorComponentFlags;
}
- // Run through the coverage stages and see if the coverage will be all ones at the end.
+ // check the coverage output from the GP
if (this->hasGeometryProcessor()) {
fGeometryProcessor->computeInvariantOutput(&inout);
}
- for (int s = 0; s < this->numCoverageStages(); ++s) {
- const GrProcessor* processor = this->getCoverageStage(s).getProcessor();
- processor->computeInvariantOutput(&inout);
- }
return inout.isSolidWhite();
}
@@ -533,7 +533,7 @@ bool GrDrawState::AutoViewMatrixRestore::setIdentity(GrDrawState* drawState) {
}
fViewMatrix = drawState->getViewMatrix();
- if (0 == drawState->numTotalStages()) {
+ if (0 == drawState->numFragmentStages()) {
drawState->fViewMatrix.reset();
fDrawState = drawState;
fNumColorStages = 0;
@@ -554,7 +554,7 @@ bool GrDrawState::AutoViewMatrixRestore::setIdentity(GrDrawState* drawState) {
}
void GrDrawState::AutoViewMatrixRestore::doEffectCoordChanges(const SkMatrix& coordChangeMatrix) {
- fSavedCoordChanges.reset(fDrawState->numTotalStages());
+ fSavedCoordChanges.reset(fDrawState->numFragmentStages());
int i = 0;
fNumColorStages = fDrawState->numColorStages();
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698