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; | 41 SkRect shapeBounds = shape.styledBounds(); |
42 shape.styledBounds(&shapeBounds); | |
43 if (!shapeBounds.isEmpty()) { | 42 if (!shapeBounds.isEmpty()) { |
44 SkRect shapeSBounds; | 43 SkRect shapeSBounds; |
45 matrix.mapRect(&shapeSBounds, shapeBounds); | 44 matrix.mapRect(&shapeSBounds, shapeBounds); |
46 SkIRect shapeIBounds; | 45 SkIRect shapeIBounds; |
47 shapeSBounds.roundOut(&shapeIBounds); | 46 shapeSBounds.roundOut(&shapeIBounds); |
48 *devShapeBounds = *devClipBounds; | 47 *devShapeBounds = *devClipBounds; |
49 if (!devShapeBounds->intersect(shapeIBounds)) { | 48 if (!devShapeBounds->intersect(shapeIBounds)) { |
50 // set the correct path bounds, as this would be used later. | 49 // set the correct path bounds, as this would be used later. |
51 *devShapeBounds = shapeIBounds; | 50 *devShapeBounds = shapeIBounds; |
52 return false; | 51 return false; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 devShapeBounds); | 159 devShapeBounds); |
161 | 160 |
162 if (inverseFilled) { | 161 if (inverseFilled) { |
163 DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSetti
ngs, | 162 DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSetti
ngs, |
164 *args.fClip, args.fColor, | 163 *args.fClip, args.fColor, |
165 *args.fViewMatrix, devClipBounds, devShapeBounds); | 164 *args.fViewMatrix, devClipBounds, devShapeBounds); |
166 } | 165 } |
167 | 166 |
168 return true; | 167 return true; |
169 } | 168 } |
OLD | NEW |