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

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

Issue 1421533007: Fix ClipMaskManager's SW-fallback logic (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up? Created 5 years, 1 month 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/GrDrawContext.cpp ('k') | no next file » | 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 2011 Google Inc. 3 * Copyright 2011 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 "GrPathRendererChain.h" 10 #include "GrPathRendererChain.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 } 34 }
35 35
36 GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) { 36 GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) {
37 fChain.push_back() = pr; 37 fChain.push_back() = pr;
38 pr->ref(); 38 pr->ref();
39 return pr; 39 return pr;
40 } 40 }
41 41
42 GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrShaderCaps* shaderC aps, 42 GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrShaderCaps* shaderC aps,
43 const GrPipelineBuilder* pi pelineBuilder, 43 const GrPipelineBuilder& pi pelineBuilder,
44 const SkMatrix& viewMatrix, 44 const SkMatrix& viewMatrix,
45 const SkPath& path, 45 const SkPath& path,
46 const GrStrokeInfo& stroke, 46 const GrStrokeInfo& stroke,
47 DrawType drawType, 47 DrawType drawType,
48 StencilSupport* stencilSupp ort) { 48 StencilSupport* stencilSupp ort) {
49 if (!fInit) { 49 if (!fInit) {
50 this->init(); 50 this->init();
51 } 51 }
52 bool antiAlias = (kColorAntiAlias_DrawType == drawType || 52 bool antiAlias = (kColorAntiAlias_DrawType == drawType ||
53 kStencilAndColorAntiAlias_DrawType == drawType); 53 kStencilAndColorAntiAlias_DrawType == drawType);
54 54
55 GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport < 55 GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport <
56 GrPathRenderer::kStencilOnly_StencilSupport); 56 GrPathRenderer::kStencilOnly_StencilSupport);
57 GR_STATIC_ASSERT(GrPathRenderer::kStencilOnly_StencilSupport < 57 GR_STATIC_ASSERT(GrPathRenderer::kStencilOnly_StencilSupport <
58 GrPathRenderer::kNoRestriction_StencilSupport); 58 GrPathRenderer::kNoRestriction_StencilSupport);
59 GrPathRenderer::StencilSupport minStencilSupport; 59 GrPathRenderer::StencilSupport minStencilSupport;
60 if (kStencilOnly_DrawType == drawType) { 60 if (kStencilOnly_DrawType == drawType) {
61 minStencilSupport = GrPathRenderer::kStencilOnly_StencilSupport; 61 minStencilSupport = GrPathRenderer::kStencilOnly_StencilSupport;
62 } else if (kStencilAndColor_DrawType == drawType || 62 } else if (kStencilAndColor_DrawType == drawType ||
63 kStencilAndColorAntiAlias_DrawType == drawType) { 63 kStencilAndColorAntiAlias_DrawType == drawType) {
64 minStencilSupport = GrPathRenderer::kNoRestriction_StencilSupport; 64 minStencilSupport = GrPathRenderer::kNoRestriction_StencilSupport;
65 } else { 65 } else {
66 minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport; 66 minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport;
67 } 67 }
68 68
69 GrPathRenderer::CanDrawPathArgs args;
70 args.fShaderCaps = shaderCaps;
71 args.fPipelineBuilder = &pipelineBuilder;
72 args.fViewMatrix = &viewMatrix;
73 args.fPath = &path;
74 args.fStroke = &stroke;
75 args.fAntiAlias = antiAlias;
69 76
70 for (int i = 0; i < fChain.count(); ++i) { 77 for (int i = 0; i < fChain.count(); ++i) {
71 GrPathRenderer::CanDrawPathArgs args;
72 args.fShaderCaps = shaderCaps;
73 args.fPipelineBuilder = pipelineBuilder;
74 args.fViewMatrix = &viewMatrix;
75 args.fPath = &path;
76 args.fStroke = &stroke;
77 args.fAntiAlias = antiAlias;
78 if (fChain[i]->canDrawPath(args)) { 78 if (fChain[i]->canDrawPath(args)) {
79 if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) { 79 if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) {
80 GrPathRenderer::StencilSupport support = 80 GrPathRenderer::StencilSupport support =
81 fChain[i]->getStencilSupp ort(path, stroke); 81 fChain[i]->getStencilSupp ort(path, stroke);
82 if (support < minStencilSupport) { 82 if (support < minStencilSupport) {
83 continue; 83 continue;
84 } else if (stencilSupport) { 84 } else if (stencilSupport) {
85 *stencilSupport = support; 85 *stencilSupport = support;
86 } 86 }
87 } 87 }
(...skipping 14 matching lines...) Expand all
102 } 102 }
103 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); 103 this->addPathRenderer(new GrTessellatingPathRenderer)->unref();
104 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); 104 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref();
105 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); 105 this->addPathRenderer(new GrAAConvexPathRenderer)->unref();
106 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); 106 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref();
107 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref(); 107 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref();
108 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport( ), 108 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport( ),
109 caps.stencilWrapOpsSupport() ))->unref(); 109 caps.stencilWrapOpsSupport() ))->unref();
110 fInit = true; 110 fInit = true;
111 } 111 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698