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

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

Issue 2064753003: Remove style application from GrPathRenderer subclasses (Closed) Base URL: https://chromium.googlesource.com/skia.git@pathshape
Patch Set: rebase Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrStencilAndCoverPathRenderer.h" 9 #include "GrStencilAndCoverPathRenderer.h"
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 15 matching lines...) Expand all
26 } else { 26 } else {
27 return nullptr; 27 return nullptr;
28 } 28 }
29 } 29 }
30 30
31 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider* resourceProvider) 31 GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider* resourceProvider)
32 : fResourceProvider(resourceProvider) { 32 : fResourceProvider(resourceProvider) {
33 } 33 }
34 34
35 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c onst { 35 bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) c onst {
36 // GrPath doesn't support hairline paths. 36 // GrPath doesn't support hairline paths. An arbitrary path effect could pro duce a hairline
37 if (args.fShape->style().couldBeHairline()) { 37 // path.
38 if (args.fShape->style().isSimpleHairline() || args.fShape->style().hasNonDa shPathEffect()) {
38 return false; 39 return false;
39 } 40 }
40 if (args.fHasUserStencilSettings) { 41 if (args.fHasUserStencilSettings) {
41 return false; 42 return false;
42 } 43 }
43 if (args.fAntiAlias) { 44 if (args.fAntiAlias) {
44 return args.fIsStencilBufferMSAA; 45 return args.fIsStencilBufferMSAA;
45 } else { 46 } else {
46 return true; // doesn't do per-path AA, relies on the target having MSAA 47 return true; // doesn't do per-path AA, relies on the target having MSAA
47 } 48 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (args.fAntiAlias) { 171 if (args.fAntiAlias) {
171 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); 172 SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
172 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); 173 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag);
173 } 174 }
174 175
175 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); 176 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
176 } 177 }
177 178
178 return true; 179 return true;
179 } 180 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698