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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 818233002: Remove coordchanges from drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@coord-change-off-paint
Patch Set: adding test to ignore 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/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.h » ('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 98e69657b344b1a543377f65fe1116fca26b12e9..319228e146a4f42a408298acebce968f5bea788b 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -832,18 +832,30 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
lineCnt = lines.count() / 2;
conicCnt = conics.count() / 3;
+ // createGeom transforms the geometry to device space when the matrix does not have
+ // perspective.
+ GrDrawState::AutoViewMatrixRestore avmr;
+ SkMatrix invert = SkMatrix::I();
+ if (!drawState->getViewMatrix().hasPerspective()) {
+ avmr.setIdentity(drawState);
+ if (!drawState->getViewMatrix().invert(&invert)) {
+ return false;
+ }
+ }
+
// do lines first
if (lineCnt) {
GrDrawTarget::AutoReleaseGeometry arg;
SkRect devBounds;
+ GrDrawState::AutoRestoreEffects are(drawState);
uint32_t gpFlags = GrDefaultGeoProcFactory::kPosition_GPType |
GrDefaultGeoProcFactory::kCoverage_GPType;
- GrDrawState::AutoRestoreEffects are(drawState);
SkAutoTUnref<const GrGeometryProcessor> gp(GrDefaultGeoProcFactory::Create(color,
gpFlags,
false,
- newCoverage));
+ newCoverage,
+ invert));
if (!this->createLineGeom(target,
drawState,
@@ -857,13 +869,6 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
return false;
}
- // createLineGeom transforms the geometry to device space when the matrix does not have
- // perspective.
- GrDrawState::AutoViewMatrixRestore avmr;
- if (!drawState->getViewMatrix().hasPerspective() && !avmr.setIdentity(drawState)) {
- return false;
- }
-
// Check devBounds
SkASSERT(check_bounds<LineVertex>(drawState, devBounds, arg.vertices(),
kLineSegNumVertices * lineCnt));
@@ -906,14 +911,6 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
return false;
}
- // createGeom transforms the geometry to device space when the matrix does not have
- // perspective.
- GrDrawState::AutoViewMatrixRestore avmr;
- if (!drawState->getViewMatrix().hasPerspective() && !avmr.setIdentity(drawState)) {
- return false;
- }
-
-
// Check devBounds
SkASSERT(check_bounds<BezierVertex>(drawState, devBounds, arg.vertices(),
kQuadNumVertices * quadCnt + kQuadNumVertices * conicCnt));
@@ -923,6 +920,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
GrQuadEffect::Create(color,
kHairlineAA_GrProcessorEdgeType,
*target->caps(),
+ invert,
newCoverage));
SkASSERT(hairQuadProcessor);
GrDrawState::AutoRestoreEffects are(drawState);
@@ -946,7 +944,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
if (conicCnt > 0) {
SkAutoTUnref<GrGeometryProcessor> hairConicProcessor(
GrConicEffect::Create(color, kHairlineAA_GrProcessorEdgeType, *target->caps(),
- newCoverage));
+ invert, newCoverage));
SkASSERT(hairConicProcessor);
GrDrawState::AutoRestoreEffects are(drawState);
target->setIndexSourceToBuffer(fQuadsIndexBuffer);
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698