OLD | NEW |
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // theoretically could set bloat = 0, instead leave it because of ma
trix inversion | 143 // theoretically could set bloat = 0, instead leave it because of ma
trix inversion |
144 // precision. | 144 // precision. |
145 SkScalar bloat = viewMatrix.getMaxScale() * SK_ScalarHalf; | 145 SkScalar bloat = viewMatrix.getMaxScale() * SK_ScalarHalf; |
146 bounds.outset(bloat, bloat); | 146 bounds.outset(bloat, bloat); |
147 } else { | 147 } else { |
148 if (!viewMatrix.invert(&invert)) { | 148 if (!viewMatrix.invert(&invert)) { |
149 return false; | 149 return false; |
150 } | 150 } |
151 } | 151 } |
152 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi
ewMatrix; | 152 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi
ewMatrix; |
153 target->drawRect(pipelineBuilder, color, viewM, bounds, NULL, &invert); | 153 target->drawBWRect(pipelineBuilder, color, viewM, bounds, NULL, &invert)
; |
154 } else { | 154 } else { |
155 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, | 155 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, |
156 kZero_StencilOp, | 156 kZero_StencilOp, |
157 kZero_StencilOp, | 157 kZero_StencilOp, |
158 kNotEqual_StencilFunc, | 158 kNotEqual_StencilFunc, |
159 0xffff, | 159 0xffff, |
160 0x0000, | 160 0x0000, |
161 0xffff); | 161 0xffff); |
162 | 162 |
163 pipelineBuilder->setStencil(kStencilPass); | 163 pipelineBuilder->setStencil(kStencilPass); |
164 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(color, viewMatr
ix)); | 164 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(color, viewMatr
ix)); |
165 target->drawPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.ge
tFillType())); | 165 target->drawPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.ge
tFillType())); |
166 } | 166 } |
167 | 167 |
168 pipelineBuilder->stencil()->setDisabled(); | 168 pipelineBuilder->stencil()->setDisabled(); |
169 return true; | 169 return true; |
170 } | 170 } |
OLD | NEW |