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

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

Issue 1291803006: Simplify parameters passed to path renderers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add more validate methods Created 5 years, 4 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/GrStencilAndCoverPathRenderer.h ('k') | src/gpu/GrTessellatingPathRenderer.h » ('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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (!args.fPipelineBuilder->getStencil().isDisabled()) { 52 if (!args.fPipelineBuilder->getStencil().isDisabled()) {
53 return false; 53 return false;
54 } 54 }
55 if (args.fAntiAlias) { 55 if (args.fAntiAlias) {
56 return args.fPipelineBuilder->getRenderTarget()->isStencilBufferMultisam pled(); 56 return args.fPipelineBuilder->getRenderTarget()->isStencilBufferMultisam pled();
57 } else { 57 } else {
58 return true; // doesn't do per-path AA, relies on the target having MSAA 58 return true; // doesn't do per-path AA, relies on the target having MSAA
59 } 59 }
60 } 60 }
61 61
62 GrPathRenderer::StencilSupport
63 GrStencilAndCoverPathRenderer::onGetStencilSupport(const GrDrawTarget*,
64 const GrPipelineBuilder*,
65 const SkPath&,
66 const GrStrokeInfo&) const {
67 return GrPathRenderer::kStencilOnly_StencilSupport;
68 }
69
70 static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s kPath, 62 static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s kPath,
71 const GrStrokeInfo& stroke) { 63 const GrStrokeInfo& stroke) {
72 GrUniqueKey key; 64 GrUniqueKey key;
73 bool isVolatile; 65 bool isVolatile;
74 GrPath::ComputeKey(skPath, stroke, &key, &isVolatile); 66 GrPath::ComputeKey(skPath, stroke, &key, &isVolatile);
75 SkAutoTUnref<GrPath> path( 67 SkAutoTUnref<GrPath> path(
76 static_cast<GrPath*>(resourceProvider->findAndRefResourceByUniqueKey(key ))); 68 static_cast<GrPath*>(resourceProvider->findAndRefResourceByUniqueKey(key )));
77 if (!path) { 69 if (!path) {
78 path.reset(resourceProvider->createPath(skPath, stroke)); 70 path.reset(resourceProvider->createPath(skPath, stroke));
79 if (!isVolatile) { 71 if (!isVolatile) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 149
158 pipelineBuilder->setStencil(kStencilPass); 150 pipelineBuilder->setStencil(kStencilPass);
159 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(args.fColor, vi ewMatrix)); 151 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(args.fColor, vi ewMatrix));
160 args.fTarget->drawPath(*pipelineBuilder, pp, p, 152 args.fTarget->drawPath(*pipelineBuilder, pp, p,
161 convert_skpath_filltype(path.getFillType())); 153 convert_skpath_filltype(path.getFillType()));
162 } 154 }
163 155
164 pipelineBuilder->stencil()->setDisabled(); 156 pipelineBuilder->stencil()->setDisabled();
165 return true; 157 return true;
166 } 158 }
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverPathRenderer.h ('k') | src/gpu/GrTessellatingPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698