OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrSoftwarePathRenderer.h" | 8 #include "GrSoftwarePathRenderer.h" |
9 #include "GrAuditTrail.h" | 9 #include "GrAuditTrail.h" |
10 #include "GrClip.h" | 10 #include "GrClip.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 const SkMatrix& matrix, | 31 const SkMatrix& matrix, |
32 SkIRect* devShapeBounds, | 32 SkIRect* devShapeBounds, |
33 SkIRect* devClipBounds) { | 33 SkIRect* devClipBounds) { |
34 // compute bounds as intersection of rt size, clip, and path | 34 // compute bounds as intersection of rt size, clip, and path |
35 clip.getConservativeBounds(width, height, devClipBounds); | 35 clip.getConservativeBounds(width, height, devClipBounds); |
36 | 36 |
37 if (devClipBounds->isEmpty()) { | 37 if (devClipBounds->isEmpty()) { |
38 *devShapeBounds = SkIRect::MakeWH(width, height); | 38 *devShapeBounds = SkIRect::MakeWH(width, height); |
39 return false; | 39 return false; |
40 } | 40 } |
41 SkRect shapeBounds = shape.styledBounds(); | 41 SkRect shapeBounds; |
| 42 shape.styledBounds(&shapeBounds); |
42 if (!shapeBounds.isEmpty()) { | 43 if (!shapeBounds.isEmpty()) { |
43 SkRect shapeSBounds; | 44 SkRect shapeSBounds; |
44 matrix.mapRect(&shapeSBounds, shapeBounds); | 45 matrix.mapRect(&shapeSBounds, shapeBounds); |
45 SkIRect shapeIBounds; | 46 SkIRect shapeIBounds; |
46 shapeSBounds.roundOut(&shapeIBounds); | 47 shapeSBounds.roundOut(&shapeIBounds); |
47 *devShapeBounds = *devClipBounds; | 48 *devShapeBounds = *devClipBounds; |
48 if (!devShapeBounds->intersect(shapeIBounds)) { | 49 if (!devShapeBounds->intersect(shapeIBounds)) { |
49 // set the correct path bounds, as this would be used later. | 50 // set the correct path bounds, as this would be used later. |
50 *devShapeBounds = shapeIBounds; | 51 *devShapeBounds = shapeIBounds; |
51 return false; | 52 return false; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 devShapeBounds); | 160 devShapeBounds); |
160 | 161 |
161 if (inverseFilled) { | 162 if (inverseFilled) { |
162 DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSetti
ngs, | 163 DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSetti
ngs, |
163 *args.fClip, args.fColor, | 164 *args.fClip, args.fColor, |
164 *args.fViewMatrix, devClipBounds, devShapeBounds); | 165 *args.fViewMatrix, devClipBounds, devShapeBounds); |
165 } | 166 } |
166 | 167 |
167 return true; | 168 return true; |
168 } | 169 } |
OLD | NEW |