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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 677463002: Set temporary paths volatile so we don't cache them. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Init fIsVolatile Created 6 years, 2 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 | « src/gpu/GrClipMaskManager.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 02766b675753bd29307117c77d6af4099982eb2f..07b7f75e92a2bd2ff9a269855fe526fe39de6287 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -343,6 +343,7 @@ void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
GrPaint grPaint;
SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
SkPath path;
+ path.setIsVolatile(true);
path.moveTo(pts[0]);
path.lineTo(pts[1]);
fContext->drawPath(grPaint, path, strokeInfo);
@@ -419,6 +420,7 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect,
if (usePath) {
SkPath path;
+ path.setIsVolatile(true);
path.addRect(rect);
this->drawPath(draw, path, paint, NULL, true);
return;
@@ -485,6 +487,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
if (usePath) {
SkPath path;
+ path.setIsVolatile(true);
path.addRRect(rect);
this->drawPath(draw, path, paint, NULL, true);
return;
@@ -511,6 +514,7 @@ void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
}
SkPath path;
+ path.setIsVolatile(true);
path.addRRect(outer);
path.addRRect(inner);
path.setFillType(SkPath::kEvenOdd_FillType);
@@ -542,6 +546,7 @@ void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval,
if (usePath) {
SkPath path;
+ path.setIsVolatile(true);
path.addOval(oval);
this->drawPath(draw, path, paint, NULL, true);
return;
@@ -691,6 +696,8 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
CHECK_SHOULD_DRAW(draw, false);
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPath", fContext);
+ SkASSERT(!pathIsMutable || origSrcPath.isVolatile());
+
GrPaint grPaint;
SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
@@ -706,6 +713,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
if (!pathIsMutable) {
result = tmpPath.init();
+ result->setIsVolatile(true);
pathIsMutable = true;
}
// should I push prePathMatrix on our MV stack temporarily, instead
@@ -740,6 +748,9 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
// avoid possibly allocating a new path in transform if we can
SkPath* devPathPtr = pathIsMutable ? pathPtr : tmpPath.init();
+ if (!pathIsMutable) {
+ devPathPtr->setIsVolatile(true);
+ }
// transform the path into device space
pathPtr->transform(fContext->getMatrix(), devPathPtr);
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698