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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 15780002: Replace GrDrawState::AutoDeviceCoordDraw with GrDrawState::AutoViewMatrixRestore::setIdentity(). s (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update based on comments Created 7 years, 7 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/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 51d5a79003f2eb85f85076cd2f2559cabde17af8..1a1552130e24ff9e6ea86ee4917c70ff6d15871a 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -816,18 +816,16 @@ bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
return false;
}
- GrDrawTarget::AutoStateRestore asr(target, GrDrawTarget::kPreserve_ASRInit);
- GrDrawState* drawState = target->drawState();
+ GrDrawTarget::AutoStateRestore asr;
- GrDrawState::AutoDeviceCoordDraw adcd;
// createGeom transforms the geometry to device space when the matrix does not have
// perspective.
- if (!drawState->getViewMatrix().hasPerspective()) {
- adcd.set(drawState);
- if (!adcd.succeeded()) {
- return false;
- }
+ if (target->getDrawState().getViewMatrix().hasPerspective()) {
+ asr.set(target, GrDrawTarget::kPreserve_ASRInit);
+ } else if (!asr.setIdentity(target, GrDrawTarget::kPreserve_ASRInit)) {
+ return false;
}
+ GrDrawState* drawState = target->drawState();
// TODO: See whether rendering lines as degenerate quads improves perf
// when we have a mix
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698