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

Unified Diff: src/gpu/GrAAConvexPathRenderer.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 | « no previous file | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index e76f0c805a07c07c682be9fbe00dfdf701faba15..77980e468b6f7e71585f3c16fd9dfcafee3bebae 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -602,23 +602,21 @@ bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath,
return true;
}
- GrDrawTarget::AutoStateRestore asr(target, GrDrawTarget::kPreserve_ASRInit);
- GrDrawState* drawState = target->drawState();
-
- GrDrawState::AutoDeviceCoordDraw adcd(drawState);
- if (!adcd.succeeded()) {
+ SkMatrix viewMatrix = target->getDrawState().getViewMatrix();
+ GrDrawTarget::AutoStateRestore asr;
+ if (!asr.setIdentity(target, GrDrawTarget::kPreserve_ASRInit)) {
return false;
}
- const SkMatrix* vm = &adcd.getOriginalMatrix();
+ GrDrawState* drawState = target->drawState();
// We use the fact that SkPath::transform path does subdivision based on
// perspective. Otherwise, we apply the view matrix when copying to the
// segment representation.
SkPath tmpPath;
- if (vm->hasPerspective()) {
- origPath.transform(*vm, &tmpPath);
+ if (viewMatrix.hasPerspective()) {
+ origPath.transform(viewMatrix, &tmpPath);
path = &tmpPath;
- vm = &SkMatrix::I();
+ viewMatrix = SkMatrix::I();
}
QuadVertex *verts;
@@ -633,7 +631,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath,
SkSTArray<kPreallocSegmentCnt, Segment, true> segments;
SkPoint fanPt;
- if (!get_segments(*path, *vm, &segments, &fanPt, &vCount, &iCount)) {
+ if (!get_segments(*path, viewMatrix, &segments, &fanPt, &vCount, &iCount)) {
return false;
}
@@ -662,8 +660,8 @@ bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath,
// This is valid because all the computed verts are within 1 pixel of the path control points.
SkRect devBounds;
- devBounds = origPath.getBounds();
- adcd.getOriginalMatrix().mapRect(&devBounds);
+ devBounds = path->getBounds();
+ viewMatrix.mapRect(&devBounds);
devBounds.outset(SK_Scalar1, SK_Scalar1);
// Check devBounds
« no previous file with comments | « no previous file | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698