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

Unified Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 787233003: Add XP to handle the cases where we disable color write. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update 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/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultPathRenderer.cpp
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index d8f723eaefdc0fc33b0c1e5cef664fb5acacb14f..7222e628e8e22bdd58664b77e9299cece06a6a3a 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -364,8 +364,8 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target,
tol)) {
return false;
}
-
- bool colorWritesWereDisabled = drawState->isColorWriteDisabled();
+ // Save the current xp on the draw state so we can reset it if needed
+ SkAutoTUnref<const GrXPFactory> backupXPFactory(SkRef(drawState->getXPFactory()));
// face culling doesn't make sense here
SkASSERT(GrDrawState::kBoth_DrawFace == drawState->getDrawFace());
@@ -471,9 +471,8 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target,
}
if (lastPassIsBounds && (p == passCount-1)) {
- if (!colorWritesWereDisabled) {
- drawState->disableState(GrDrawState::kNoColorWrites_StateBit);
- }
+ // Reset the XP Factory on drawState
+ drawState->setXPFactory(backupXPFactory);
SkRect bounds;
GrDrawState::AutoViewMatrixRestore avmr;
if (reverse) {
@@ -495,7 +494,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target,
target->drawSimpleRect(drawState, color, bounds);
} else {
if (passCount > 1) {
- drawState->enableState(GrDrawState::kNoColorWrites_StateBit);
+ drawState->setDisableColorXPFactory();
}
GrDrawState::AutoRestoreEffects are(drawState);
SkAutoTUnref<const GrGeometryProcessor> gp(
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698