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 "SkBBoxRecord.h" | 9 #include "SkBBoxRecord.h" |
10 | 10 |
11 void SkBBoxRecord::drawOval(const SkRect& rect, const SkPaint& paint) { | 11 void SkBBoxRecord::drawOval(const SkRect& rect, const SkPaint& paint) { |
12 if (this->transformBounds(rect, &paint)) { | 12 if (this->transformBounds(rect, &paint)) { |
13 INHERITED::drawOval(rect, paint); | 13 INHERITED::drawOval(rect, paint); |
14 } | 14 } |
15 } | 15 } |
16 | 16 |
17 void SkBBoxRecord::drawRRect(const SkRRect& rrect, const SkPaint& paint) { | 17 void SkBBoxRecord::drawRRect(const SkRRect& rrect, const SkPaint& paint) { |
18 if (this->transformBounds(rrect.rect(), &paint)) { | 18 if (this->transformBounds(rrect.rect(), &paint)) { |
19 INHERITED::drawRRect(rrect, paint); | 19 INHERITED::drawRRect(rrect, paint); |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
23 void SkBBoxRecord::onDrawRect(const SkRect& rect, const SkPaint& paint) { | 23 void SkBBoxRecord::drawRect(const SkRect& rect, const SkPaint& paint) { |
24 if (this->transformBounds(rect, &paint)) { | 24 if (this->transformBounds(rect, &paint)) { |
25 INHERITED::onDrawRect(rect, paint); | 25 INHERITED::drawRect(rect, paint); |
26 } | 26 } |
27 } | 27 } |
28 | 28 |
29 void SkBBoxRecord::onDrawPath(const SkPath& path, const SkPaint& paint) { | 29 void SkBBoxRecord::drawPath(const SkPath& path, const SkPaint& paint) { |
30 if (path.isInverseFillType()) { | 30 if (path.isInverseFillType()) { |
31 // If path is inverse filled, use the current clip bounds as the | 31 // If path is inverse filled, use the current clip bounds as the |
32 // path's device-space bounding box. | 32 // path's device-space bounding box. |
33 SkIRect clipBounds; | 33 SkIRect clipBounds; |
34 if (this->getClipDeviceBounds(&clipBounds)) { | 34 if (this->getClipDeviceBounds(&clipBounds)) { |
35 this->handleBBox(SkRect::MakeFromIRect(clipBounds)); | 35 this->handleBBox(SkRect::MakeFromIRect(clipBounds)); |
36 INHERITED::onDrawPath(path, paint); | 36 INHERITED::drawPath(path, paint); |
37 } | 37 } |
38 } else if (this->transformBounds(path.getBounds(), &paint)) { | 38 } else if (this->transformBounds(path.getBounds(), &paint)) { |
39 INHERITED::onDrawPath(path, paint); | 39 INHERITED::drawPath(path, paint); |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 void SkBBoxRecord::drawPoints(PointMode mode, size_t count, const SkPoint pts[], | 43 void SkBBoxRecord::drawPoints(PointMode mode, size_t count, const SkPoint pts[], |
44 const SkPaint& paint) { | 44 const SkPaint& paint) { |
45 SkRect bbox; | 45 SkRect bbox; |
46 bbox.set(pts, count); | 46 bbox.set(pts, count); |
47 // Small min width value, just to ensure hairline point bounding boxes aren'
t empty. | 47 // Small min width value, just to ensure hairline point bounding boxes aren'
t empty. |
48 // Even though we know hairline primitives are drawn one pixel wide, we do n
ot use a | 48 // Even though we know hairline primitives are drawn one pixel wide, we do n
ot use a |
49 // minimum of 1 because the playback scale factor is unknown at record time.
Later | 49 // minimum of 1 because the playback scale factor is unknown at record time.
Later |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 286 } |
287 | 287 |
288 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { | 288 if (!outBounds.isEmpty() && !this->quickReject(outBounds)) { |
289 this->getTotalMatrix().mapRect(&outBounds); | 289 this->getTotalMatrix().mapRect(&outBounds); |
290 this->handleBBox(outBounds); | 290 this->handleBBox(outBounds); |
291 return true; | 291 return true; |
292 } | 292 } |
293 | 293 |
294 return false; | 294 return false; |
295 } | 295 } |
OLD | NEW |