| 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 #include "GrSoftwarePathRenderer.h" | 9 #include "GrSoftwarePathRenderer.h" |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| 11 #include "GrSWMaskHelper.h" | 11 #include "GrSWMaskHelper.h" |
| 12 | 12 |
| 13 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
| 14 bool GrSoftwarePathRenderer::canDrawPath(const SkPath&, | 14 bool GrSoftwarePathRenderer::canDrawPath(const SkPath&, |
| 15 const SkStrokeRec&, | 15 const SkStrokeRec&, |
| 16 const GrDrawTarget*, | 16 const GrDrawTarget*, |
| 17 bool antiAlias) const { | 17 bool antiAlias) const { |
| 18 if (!antiAlias || NULL == fContext) { | 18 if (NULL == fContext) { |
| 19 // TODO: We could allow the SW path to also handle non-AA paths but | |
| 20 // this would mean that GrDefaultPathRenderer would never be called | |
| 21 // (since it appears after the SW renderer in the path renderer | |
| 22 // chain). Some testing would need to be done r.e. performance | |
| 23 // and consistency of the resulting images before removing | |
| 24 // the "!antiAlias" clause from the above test | |
| 25 return false; | 19 return false; |
| 26 } | 20 } |
| 27 | 21 |
| 28 return true; | 22 return true; |
| 29 } | 23 } |
| 30 | 24 |
| 31 GrPathRenderer::StencilSupport GrSoftwarePathRenderer::onGetStencilSupport( | 25 GrPathRenderer::StencilSupport GrSoftwarePathRenderer::onGetStencilSupport( |
| 32 const SkPath&, | 26 const SkPath&, |
| 33 const SkStrokeRec&, | 27 const SkStrokeRec&, |
| 34 const GrDrawTarget*) const { | 28 const GrDrawTarget*) const { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 138 } |
| 145 | 139 |
| 146 GrSWMaskHelper::DrawToTargetWithPathMask(texture, target, devPathBounds); | 140 GrSWMaskHelper::DrawToTargetWithPathMask(texture, target, devPathBounds); |
| 147 | 141 |
| 148 if (path.isInverseFillType()) { | 142 if (path.isInverseFillType()) { |
| 149 draw_around_inv_path(target, devClipBounds, devPathBounds); | 143 draw_around_inv_path(target, devClipBounds, devPathBounds); |
| 150 } | 144 } |
| 151 | 145 |
| 152 return true; | 146 return true; |
| 153 } | 147 } |
| OLD | NEW |