| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 const SkPath& path, | 32 const SkPath& path, |
| 33 const SkMatrix& matrix, | 33 const SkMatrix& matrix, |
| 34 SkIRect* devPathBounds, | 34 SkIRect* devPathBounds, |
| 35 SkIRect* devClipBounds) { | 35 SkIRect* devClipBounds) { |
| 36 // compute bounds as intersection of rt size, clip, and path | 36 // compute bounds as intersection of rt size, clip, and path |
| 37 const GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); | 37 const GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); |
| 38 if (nullptr == rt) { | 38 if (nullptr == rt) { |
| 39 return false; | 39 return false; |
| 40 } | 40 } |
| 41 | 41 |
| 42 pipelineBuilder->clip().getConservativeBounds(rt, devClipBounds); | 42 pipelineBuilder->clip().getConservativeBounds(rt->width(), rt->height(), dev
ClipBounds); |
| 43 | 43 |
| 44 if (devClipBounds->isEmpty()) { | 44 if (devClipBounds->isEmpty()) { |
| 45 *devPathBounds = SkIRect::MakeWH(rt->width(), rt->height()); | 45 *devPathBounds = SkIRect::MakeWH(rt->width(), rt->height()); |
| 46 return false; | 46 return false; |
| 47 } | 47 } |
| 48 | 48 |
| 49 if (!path.getBounds().isEmpty()) { | 49 if (!path.getBounds().isEmpty()) { |
| 50 SkRect pathSBounds; | 50 SkRect pathSBounds; |
| 51 matrix.mapRect(&pathSBounds, path.getBounds()); | 51 matrix.mapRect(&pathSBounds, path.getBounds()); |
| 52 SkIRect pathIBounds; | 52 SkIRect pathIBounds; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 GrSWMaskHelper::DrawToTargetWithPathMask(texture, args.fTarget, args.fPipeli
neBuilder, | 129 GrSWMaskHelper::DrawToTargetWithPathMask(texture, args.fTarget, args.fPipeli
neBuilder, |
| 130 args.fColor, *args.fViewMatrix, dev
PathBounds); | 130 args.fColor, *args.fViewMatrix, dev
PathBounds); |
| 131 | 131 |
| 132 if (args.fPath->isInverseFillType()) { | 132 if (args.fPath->isInverseFillType()) { |
| 133 draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColor, *
args.fViewMatrix, | 133 draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColor, *
args.fViewMatrix, |
| 134 devClipBounds, devPathBounds); | 134 devClipBounds, devPathBounds); |
| 135 } | 135 } |
| 136 | 136 |
| 137 return true; | 137 return true; |
| 138 } | 138 } |
| OLD | NEW |