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

Unified Diff: src/gpu/GrOptDrawState.cpp

Issue 820523002: initial changes to add local matrix to primitive processor (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup-ccm-above-context
Patch Set: cleanup Created 6 years 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/GrGeometryProcessor.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/GrOptDrawState.cpp
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index d12cf0cad5f2aa0bea47218ba1ab9cc3e0222776..95d5984a3fb505ee35d6deb2c0cebac6de926b59 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -110,11 +110,15 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
fDescInfo.fRequiresLocalCoordAttrib = hasLocalCoords;
+ bool usesLocalCoords = false;
+
// Copy Stages from DS to ODS
for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) {
SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
GrPendingFragmentStage,
(drawState.fColorStages[i], hasLocalCoords));
+ usesLocalCoords = usesLocalCoords ||
+ drawState.fColorStages[i].getProcessor()->usesLocalCoords();
}
fNumColorStages = fFragmentStages.count();
@@ -122,6 +126,8 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
GrPendingFragmentStage,
(drawState.fCoverageStages[i], hasLocalCoords));
+ usesLocalCoords = usesLocalCoords ||
+ drawState.fCoverageStages[i].getProcessor()->usesLocalCoords();
}
// let the GP init the batch tracker
@@ -129,6 +135,7 @@ GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
init.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag);
init.fOverrideColor = init.fColorIgnored ? GrColor_ILLEGAL : overrideColor;
init.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag);
+ init.fUsesLocalCoords = usesLocalCoords;
fPrimitiveProcessor->initBatchTracker(&fBatchTracker, init);
}
« no previous file with comments | « src/gpu/GrGeometryProcessor.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698