Chromium Code Reviews| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 // theoretically could set bloat = 0, instead leave it because of ma trix inversion | 128 // theoretically could set bloat = 0, instead leave it because of ma trix inversion |
| 129 // precision. | 129 // precision. |
| 130 SkScalar bloat = viewMatrix.getMaxScale() * SK_ScalarHalf; | 130 SkScalar bloat = viewMatrix.getMaxScale() * SK_ScalarHalf; |
| 131 bounds.outset(bloat, bloat); | 131 bounds.outset(bloat, bloat); |
| 132 } else { | 132 } else { |
| 133 if (!viewMatrix.invert(&invert)) { | 133 if (!viewMatrix.invert(&invert)) { |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi ewMatrix; | 137 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi ewMatrix; |
| 138 if (pipelineBuilder->getRenderTarget()->hasMixedSamples()) { | |
| 139 pipelineBuilder->disableState(GrPipelineBuilder::kHWAntialias_Flag); | |
| 140 } | |
| 138 args.fTarget->drawNonAARect(*pipelineBuilder, args.fColor, viewM, bounds , invert); | 141 args.fTarget->drawNonAARect(*pipelineBuilder, args.fColor, viewM, bounds , invert); |
|
Chris Dalton
2015/11/12 02:28:02
Is "drawNonAARect" more of a perf hint, that says
bsalomon
2015/11/12 16:39:32
It's supposed to be strict. It's often used to dra
| |
| 139 } else { | 142 } else { |
| 140 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, | 143 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, |
| 141 kZero_StencilOp, | 144 kZero_StencilOp, |
| 142 kKeep_StencilOp, | 145 kKeep_StencilOp, |
| 143 kNotEqual_StencilFunc, | 146 kNotEqual_StencilFunc, |
| 144 0xffff, | 147 0xffff, |
| 145 0x0000, | 148 0x0000, |
| 146 0xffff); | 149 0xffff); |
| 147 | 150 |
| 148 pipelineBuilder->setStencil(kStencilPass); | 151 pipelineBuilder->setStencil(kStencilPass); |
| 149 args.fTarget->drawPath(*pipelineBuilder, viewMatrix, args.fColor, p, | 152 args.fTarget->drawPath(*pipelineBuilder, viewMatrix, args.fColor, p, |
| 150 convert_skpath_filltype(path.getFillType())); | 153 convert_skpath_filltype(path.getFillType())); |
| 151 } | 154 } |
| 152 | 155 |
| 153 pipelineBuilder->stencil()->setDisabled(); | 156 pipelineBuilder->stencil()->setDisabled(); |
| 154 return true; | 157 return true; |
| 155 } | 158 } |
| OLD | NEW |