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.fStyle->isSimpleFill()) { | 82 if (!args.fShape->style().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 = fChain[i]->getStencilSu
pport(*args.fShape); |
91 fChain[i]->getStencilSupport(*args.fPath
); | |
92 if (support < minStencilSupport) { | 91 if (support < minStencilSupport) { |
93 continue; | 92 continue; |
94 } else if (stencilSupport) { | 93 } else if (stencilSupport) { |
95 *stencilSupport = support; | 94 *stencilSupport = support; |
96 } | 95 } |
97 } | 96 } |
98 return fChain[i]; | 97 return fChain[i]; |
99 } | 98 } |
100 } | 99 } |
101 return nullptr; | 100 return nullptr; |
102 } | 101 } |
OLD | NEW |