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

Unified Diff: src/gpu/GrStencilAndCoverPathRenderer.cpp

Issue 1120023005: Improve caching of special case paths in GrStencilAndCoverPathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@dashing-nvpr-02
Patch Set: Created 5 years, 7 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/GrPath.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilAndCoverPathRenderer.cpp
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index e60bea215a702fffc7eb56729def2c3acb8048be..97b20773a7e0e6797d1e7f60d38937fe1d749c86 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -75,12 +75,15 @@ GrStencilAndCoverPathRenderer::onGetStencilSupport(const GrDrawTarget*,
static GrPath* get_gr_path(GrGpu* gpu, const SkPath& skPath, const GrStrokeInfo& stroke) {
GrContext* ctx = gpu->getContext();
GrUniqueKey key;
- GrPath::ComputeKey(skPath, stroke, &key);
+ bool isVolatile;
+ GrPath::ComputeKey(skPath, stroke, &key, &isVolatile);
SkAutoTUnref<GrPath> path(
static_cast<GrPath*>(ctx->resourceProvider()->findAndRefResourceByUniqueKey(key)));
if (NULL == path) {
path.reset(gpu->pathRendering()->createPath(skPath, stroke));
- ctx->resourceProvider()->assignUniqueKeyToResource(key, path);
+ if (!isVolatile) {
+ ctx->resourceProvider()->assignUniqueKeyToResource(key, path);
+ }
} else {
SkASSERT(path->isEqualTo(skPath, stroke));
}
« no previous file with comments | « src/gpu/GrPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698