summaryrefslogtreecommitdiff
path: root/gpu/GrStencilAndCoverPathRenderer.cpp
diff options
context:
space:
mode:
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-01 15:23:44 +0000
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-01 15:23:44 +0000
commit09af991708bb73d5e1c8bff9c1e7f8423bde09dd (patch)
treedc5bdfbcad256623ffa63e187525d88ce96d5f89 /gpu/GrStencilAndCoverPathRenderer.cpp
parent75739bcc162002a8e62c3201978cbfbdf88a524e (diff)
downloadsrc-09af991708bb73d5e1c8bff9c1e7f8423bde09dd.tar.gz
Make GrContext cache the gpu paths
Creating paths for nv_path_rendering is costly. Try to reduce this cost by caching paths based on the SkPath "hash" (i.e. SkPathRef generation id) and stroke properties. Adds the paths to GrContext::fTextureCache instance. Later this should be renamed and the GrContext API should reflect the nature of the cache better. R=bsalomon@google.com, mtklein@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/26557003 git-svn-id: http://skia.googlecode.com/svn/trunk/src@12083 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/GrStencilAndCoverPathRenderer.cpp')
-rw-r--r--gpu/GrStencilAndCoverPathRenderer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gpu/GrStencilAndCoverPathRenderer.cpp b/gpu/GrStencilAndCoverPathRenderer.cpp
index 0271b22a..273c01b8 100644
--- a/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -55,7 +55,7 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const SkPath& path,
const SkStrokeRec& stroke,
GrDrawTarget* target) {
SkASSERT(!path.isInverseFillType());
- SkAutoTUnref<GrPath> p(fGpu->createPath(path, stroke));
+ SkAutoTUnref<GrPath> p(fGpu->getContext()->createPath(path, stroke));
target->stencilPath(p, path.getFillType());
}
@@ -69,7 +69,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const SkPath& path,
GrDrawState* drawState = target->drawState();
SkASSERT(drawState->getStencil().isDisabled());
- SkAutoTUnref<GrPath> p(fGpu->createPath(path, stroke));
+ SkAutoTUnref<GrPath> p(fGpu->getContext()->createPath(path, stroke));
if (path.isInverseFillType()) {
GR_STATIC_CONST_SAME_STENCIL(kInvertedStencilPass,