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

Unified Diff: src/gpu/GrAADistanceFieldPathRenderer.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/core/SkStroke.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAADistanceFieldPathRenderer.cpp
diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp
index 95e4e7ac98d5a6f418220f959ce628c1841d6c17..e2cee650dc1fbf6b6ec020161b32a7ead3dd34a8 100755
--- a/src/gpu/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp
@@ -31,6 +31,11 @@
SK_CONF_DECLARE(bool, c_DumpPathCache, "gpu.dumpPathCache", false,
"Dump the contents of the path cache before every purge.");
+#ifdef DF_PATH_TRACKING
+static int g_NumCachedPaths = 0;
+static int g_NumFreedPaths = 0;
+#endif
+
////////////////////////////////////////////////////////////////////////////////
GrAADistanceFieldPathRenderer::~GrAADistanceFieldPathRenderer() {
PathDataList::Iter iter;
@@ -43,6 +48,10 @@ GrAADistanceFieldPathRenderer::~GrAADistanceFieldPathRenderer() {
}
SkDELETE(fAtlas);
+
+#ifdef DF_PATH_TRACKING
+ SkDebugf("Cached paths: %d, freed paths: %d\n", g_NumCachedPaths, g_NumFreedPaths);
+#endif
}
////////////////////////////////////////////////////////////////////////////////
@@ -50,10 +59,11 @@ bool GrAADistanceFieldPathRenderer::canDrawPath(const SkPath& path,
const SkStrokeRec& stroke,
const GrDrawTarget* target,
bool antiAlias) const {
+
// TODO: Support inverse fill
// TODO: Support strokes
if (!target->caps()->shaderDerivativeSupport() || !antiAlias || path.isInverseFillType()
- || SkStrokeRec::kFill_Style != stroke.getStyle()) {
+ || path.isVolatile() || SkStrokeRec::kFill_Style != stroke.getStyle()) {
return false;
}
@@ -230,7 +240,10 @@ HAS_ATLAS:
fPathCache.add(pathData);
fPathList.addToTail(pathData);
-
+#ifdef DF_PATH_TRACKING
+ ++g_NumCachedPaths;
+#endif
+
return pathData;
}
@@ -252,6 +265,9 @@ bool GrAADistanceFieldPathRenderer::freeUnusedPlot() {
fPathCache.remove(pathData->fGenID);
fPathList.remove(pathData);
SkDELETE(pathData);
+#ifdef DF_PATH_TRACKING
+ ++g_NumFreedPaths;
+#endif
}
}
« no previous file with comments | « src/core/SkStroke.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698