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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 22043006: Separate quad UV calculation from bloat_quad (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 | no next file » | 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 ecd938961e478c5d31d98a566cf76a46f3ee099b..c1f951ab7f91832d95ece209f71b377794c68e48 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -472,6 +472,12 @@ void intersect_lines(const SkPoint& ptA, const SkVector& normA,
result->fY = SkScalarMul(result->fY, wInv);
}
+void set_uv_quad(const SkPoint qpts[3], Vertex verts[kVertsPerQuad]) {
+ // this should be in the src space, not dev coords, when we have perspective
+ GrPathUtils::QuadUVMatrix DevToUV(qpts);
+ DevToUV.apply<kVertsPerQuad, sizeof(Vertex), sizeof(GrPoint)>(verts);
+}
+
void bloat_quad(const SkPoint qpts[3], const SkMatrix* toDevice,
const SkMatrix* toSrc, Vertex verts[kVertsPerQuad],
SkRect* devBounds) {
@@ -481,9 +487,6 @@ void bloat_quad(const SkPoint qpts[3], const SkMatrix* toDevice,
SkPoint b = qpts[1];
SkPoint c = qpts[2];
- // this should be in the src space, not dev coords, when we have perspective
- GrPathUtils::QuadUVMatrix DevToUV(qpts);
-
if (toDevice) {
toDevice->mapPoints(&a, 1);
toDevice->mapPoints(&b, 1);
@@ -549,7 +552,6 @@ void bloat_quad(const SkPoint qpts[3], const SkMatrix* toDevice,
if (toSrc) {
toSrc->mapPointsWithStride(&verts[0].fPos, sizeof(Vertex), kVertsPerQuad);
}
- DevToUV.apply<kVertsPerQuad, sizeof(Vertex), sizeof(GrPoint)>(verts);
}
// Input:
@@ -641,6 +643,7 @@ void add_quads(const SkPoint p[3],
add_quads(newP + 2, subdiv-1, toDevice, toSrc, vert, devBounds);
} else {
bloat_quad(p, toDevice, toSrc, *vert, devBounds);
+ set_uv_quad(p, *vert);
*vert += kVertsPerQuad;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698