OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrPathRendererChain.h" | 9 #include "GrPathRendererChain.h" |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 if (kStencilOnly_DrawType == drawType) { | 72 if (kStencilOnly_DrawType == drawType) { |
73 minStencilSupport = GrPathRenderer::kStencilOnly_StencilSupport; | 73 minStencilSupport = GrPathRenderer::kStencilOnly_StencilSupport; |
74 } else if (kStencilAndColor_DrawType == drawType || | 74 } else if (kStencilAndColor_DrawType == drawType || |
75 kStencilAndColorAntiAlias_DrawType == drawType) { | 75 kStencilAndColorAntiAlias_DrawType == drawType) { |
76 minStencilSupport = GrPathRenderer::kNoRestriction_StencilSupport; | 76 minStencilSupport = GrPathRenderer::kNoRestriction_StencilSupport; |
77 } else { | 77 } else { |
78 minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport; | 78 minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport; |
79 } | 79 } |
80 if (minStencilSupport != GrPathRenderer::kNoSupport_StencilSupport) { | 80 if (minStencilSupport != GrPathRenderer::kNoSupport_StencilSupport) { |
81 // We don't support (and shouldn't need) stenciling of non-fill paths. | 81 // We don't support (and shouldn't need) stenciling of non-fill paths. |
82 if (!args.fStroke->isFillStyle() || args.fStroke->isDashed()) { | 82 if (!args.fStyle->isSimpleFill()) { |
83 return nullptr; | 83 return nullptr; |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 for (int i = 0; i < fChain.count(); ++i) { | 87 for (int i = 0; i < fChain.count(); ++i) { |
88 if (fChain[i]->canDrawPath(args)) { | 88 if (fChain[i]->canDrawPath(args)) { |
89 if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport)
{ | 89 if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport)
{ |
90 GrPathRenderer::StencilSupport support = | 90 GrPathRenderer::StencilSupport support = |
91 fChain[i]->getStencilSupport(*args.fPath
); | 91 fChain[i]->getStencilSupport(*args.fPath
); |
92 if (support < minStencilSupport) { | 92 if (support < minStencilSupport) { |
93 continue; | 93 continue; |
94 } else if (stencilSupport) { | 94 } else if (stencilSupport) { |
95 *stencilSupport = support; | 95 *stencilSupport = support; |
96 } | 96 } |
97 } | 97 } |
98 return fChain[i]; | 98 return fChain[i]; |
99 } | 99 } |
100 } | 100 } |
101 return nullptr; | 101 return nullptr; |
102 } | 102 } |
OLD | NEW |