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