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

Side by Side Diff: src/gpu/GrStencilAndCoverPathRenderer.cpp

Issue 940463006: Rename GrContentKey to GrUniqueKey (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrResourceCache.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrStencilAndCoverPathRenderer.h" 10 #include "GrStencilAndCoverPathRenderer.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GrPathRenderer::StencilSupport 65 GrPathRenderer::StencilSupport
66 GrStencilAndCoverPathRenderer::onGetStencilSupport(const GrDrawTarget*, 66 GrStencilAndCoverPathRenderer::onGetStencilSupport(const GrDrawTarget*,
67 const GrPipelineBuilder*, 67 const GrPipelineBuilder*,
68 const SkPath&, 68 const SkPath&,
69 const SkStrokeRec&) const { 69 const SkStrokeRec&) const {
70 return GrPathRenderer::kStencilOnly_StencilSupport; 70 return GrPathRenderer::kStencilOnly_StencilSupport;
71 } 71 }
72 72
73 static GrPath* get_gr_path(GrGpu* gpu, const SkPath& skPath, const SkStrokeRec& stroke) { 73 static GrPath* get_gr_path(GrGpu* gpu, const SkPath& skPath, const SkStrokeRec& stroke) {
74 GrContext* ctx = gpu->getContext(); 74 GrContext* ctx = gpu->getContext();
75 GrContentKey key; 75 GrUniqueKey key;
76 GrPath::ComputeKey(skPath, stroke, &key); 76 GrPath::ComputeKey(skPath, stroke, &key);
77 SkAutoTUnref<GrPath> path(static_cast<GrPath*>(ctx->findAndRefCachedResource (key))); 77 SkAutoTUnref<GrPath> path(static_cast<GrPath*>(ctx->findAndRefCachedResource (key)));
78 if (NULL == path || !path->isEqualTo(skPath, stroke)) { 78 if (NULL == path || !path->isEqualTo(skPath, stroke)) {
79 path.reset(gpu->pathRendering()->createPath(skPath, stroke)); 79 path.reset(gpu->pathRendering()->createPath(skPath, stroke));
80 ctx->addResourceToCache(key, path); 80 ctx->addResourceToCache(key, path);
81 } 81 }
82 return path.detach(); 82 return path.detach();
83 } 83 }
84 84
85 void GrStencilAndCoverPathRenderer::onStencilPath(GrDrawTarget* target, 85 void GrStencilAndCoverPathRenderer::onStencilPath(GrDrawTarget* target,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 0xffff); 154 0xffff);
155 155
156 pipelineBuilder->setStencil(kStencilPass); 156 pipelineBuilder->setStencil(kStencilPass);
157 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(color, viewMatr ix)); 157 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(color, viewMatr ix));
158 target->drawPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.ge tFillType())); 158 target->drawPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.ge tFillType()));
159 } 159 }
160 160
161 pipelineBuilder->stencil()->setDisabled(); 161 pipelineBuilder->stencil()->setDisabled();
162 return true; 162 return true;
163 } 163 }
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698