OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkDrawLooper.h" | 8 #include "SkDrawLooper.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkMatrix.h" | 10 #include "SkMatrix.h" |
11 #include "SkPaint.h" | 11 #include "SkPaint.h" |
12 #include "SkRect.h" | 12 #include "SkRect.h" |
13 | 13 |
14 SK_DEFINE_INST_COUNT(SkDrawLooper) | |
15 | |
16 bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) { | 14 bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) { |
17 SkCanvas canvas; | 15 SkCanvas canvas; |
18 | 16 |
19 this->init(&canvas); | 17 this->init(&canvas); |
20 for (;;) { | 18 for (;;) { |
21 SkPaint p(paint); | 19 SkPaint p(paint); |
22 if (this->next(&canvas, &p)) { | 20 if (this->next(&canvas, &p)) { |
23 p.setLooper(NULL); | 21 p.setLooper(NULL); |
24 if (!p.canComputeFastBounds()) { | 22 if (!p.canComputeFastBounds()) { |
25 return false; | 23 return false; |
(...skipping 23 matching lines...) Expand all Loading... |
49 if (firstTime) { | 47 if (firstTime) { |
50 *dst = r; | 48 *dst = r; |
51 } else { | 49 } else { |
52 dst->join(r); | 50 dst->join(r); |
53 } | 51 } |
54 } else { | 52 } else { |
55 break; | 53 break; |
56 } | 54 } |
57 } | 55 } |
58 } | 56 } |
OLD | NEW |