diff options
author | 2014-10-24 07:12:51 -0700 | |
---|---|---|
committer | 2014-10-24 07:12:51 -0700 | |
commit | b3eb687f8a89eb1eacd1afb4016401eb392f66ab (patch) | |
tree | b652c3a0eb4250f720237f292d6e8233da0bc1d5 /src/core/SkDraw.cpp | |
parent | 3ceef9a66aa1ae8db896b8e75496194978708476 (diff) |
Set temporary paths volatile so we don't cache them.
Any path that is generated frame-to-frame should not be rendered by using the
DistanceFieldPathRenderer, because generating the initial distance field,
uploading it and rendering it takes longer than the SoftwarePathRenderer.
BUG=skia:2935
Review URL: https://codereview.chromium.org/677463002
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r-- | src/core/SkDraw.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 929088df17..67fd2770b4 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -595,12 +595,13 @@ void SkDraw::drawPoints(SkCanvas::PointMode mode, size_t count, if (newPaint.getStrokeCap() == SkPaint::kRound_Cap) { SkPath path; SkMatrix preMatrix; - + path.addCircle(0, 0, radius); for (size_t i = 0; i < count; i++) { preMatrix.setTranslate(pts[i].fX, pts[i].fY); // pass true for the last point, since we can modify // then path then + path.setIsVolatile((count-1) == i); if (fDevice) { fDevice->drawPath(*this, path, newPaint, &preMatrix, (count-1) == i); @@ -719,6 +720,7 @@ void SkDraw::drawPoints(SkCanvas::PointMode mode, size_t count, SkPaint p(paint); p.setStyle(SkPaint::kStroke_Style); size_t inc = (SkCanvas::kLines_PointMode == mode) ? 2 : 1; + path.setIsVolatile(true); for (size_t i = 0; i < count; i += inc) { path.moveTo(pts[i]); path.lineTo(pts[i+1]); @@ -1011,6 +1013,7 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint, SkPath tmpPath; SkMatrix tmpMatrix; const SkMatrix* matrix = fMatrix; + tmpPath.setIsVolatile(true); if (prePathMatrix) { if (origPaint.getPathEffect() || origPaint.getStyle() != SkPaint::kFill_Style || @@ -1962,7 +1965,8 @@ void SkDraw::drawTextOnPath(const char text[], size_t byteLength, if (iterPath) { SkPath tmp; SkMatrix m(scaledMatrix); - + + tmp.setIsVolatile(true); m.postTranslate(xpos + hOffset, 0); if (matrix) { m.postConcat(*matrix); |