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

Unified Diff: src/gpu/GrAAConvexPathRenderer.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 | « gm/beziereffects.cpp ('k') | 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 6d69823caf53e8052b32c4bc2be2d0ac6aa40d20..3a344ce0b8130f9f4a90c3f8bdc4641bb345cbcb 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -505,8 +505,8 @@ static void create_vertices(const SegmentArray& segments,
class QuadEdgeEffect : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create(GrColor color) {
- return SkNEW_ARGS(QuadEdgeEffect, (color));
+ static GrGeometryProcessor* Create(GrColor color, const SkMatrix& localMatrix) {
+ return SkNEW_ARGS(QuadEdgeEffect, (color, localMatrix));
}
virtual ~QuadEdgeEffect() {}
@@ -626,7 +626,8 @@ public:
}
private:
- QuadEdgeEffect(GrColor color) : INHERITED(color) {
+ QuadEdgeEffect(GrColor color, const SkMatrix& localMatrix)
+ : INHERITED(color, false, localMatrix) {
this->initClassID<QuadEdgeEffect>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
fInQuadEdge = &this->addVertexAttrib(GrAttribute("inQuadEdge", kVec4f_GrVertexAttribType));
@@ -661,7 +662,9 @@ GrGeometryProcessor* QuadEdgeEffect::TestCreate(SkRandom* random,
const GrDrawTargetCaps& caps,
GrTexture*[]) {
// Doesn't work without derivative instructions.
- return caps.shaderDerivativeSupport() ? QuadEdgeEffect::Create(GrRandomColor(random)) : NULL;
+ return caps.shaderDerivativeSupport() ?
+ QuadEdgeEffect::Create(GrRandomColor(random),
+ GrProcessorUnitTest::TestMatrix(random)) : NULL;
}
///////////////////////////////////////////////////////////////////////////////
@@ -688,11 +691,13 @@ bool GrAAConvexPathRenderer::onDrawPath(GrDrawTarget* target,
}
SkMatrix viewMatrix = drawState->getViewMatrix();
- GrDrawState::AutoViewMatrixRestore avmr;
- if (!avmr.setIdentity(drawState)) {
+ SkMatrix invert;
+ if (!viewMatrix.invert(&invert)) {
return false;
}
+ GrDrawState::AutoViewMatrixRestore avmr(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.
@@ -725,7 +730,7 @@ bool GrAAConvexPathRenderer::onDrawPath(GrDrawTarget* target,
// Our computed verts should all be within one pixel of the segment control points.
devBounds.outset(SK_Scalar1, SK_Scalar1);
- SkAutoTUnref<GrGeometryProcessor> quadProcessor(QuadEdgeEffect::Create(color));
+ SkAutoTUnref<GrGeometryProcessor> quadProcessor(QuadEdgeEffect::Create(color, invert));
GrDrawTarget::AutoReleaseGeometry arg(target, vCount, quadProcessor->getVertexStride(), iCount);
SkASSERT(quadProcessor->getVertexStride() == sizeof(QuadVertex));
« no previous file with comments | « gm/beziereffects.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698