OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkRecordDraw.h" | 8 #include "SkRecordDraw.h" |
9 #include "SkPatchUtils.h" | 9 #include "SkPatchUtils.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 SkTDArray<unsigned> ops; | 28 SkTDArray<unsigned> ops; |
29 bbh->search(query, &ops); | 29 bbh->search(query, &ops); |
30 | 30 |
31 SkRecords::Draw draw(canvas); | 31 SkRecords::Draw draw(canvas); |
32 for (int i = 0; i < ops.count(); i++) { | 32 for (int i = 0; i < ops.count(); i++) { |
33 if (callback && callback->abortDrawing()) { | 33 if (callback && callback->abortDrawing()) { |
34 return; | 34 return; |
35 } | 35 } |
| 36 // This visit call uses the SkRecords::Draw::operator() to call |
| 37 // methods on the |canvas|, wrapped by methods defined with the |
| 38 // DRAW() macro. |
36 record.visit<void>(ops[i], draw); | 39 record.visit<void>(ops[i], draw); |
37 } | 40 } |
38 } else { | 41 } else { |
39 // Draw all ops. | 42 // Draw all ops. |
40 SkRecords::Draw draw(canvas); | 43 SkRecords::Draw draw(canvas); |
41 for (unsigned i = 0; i < record.count(); i++) { | 44 for (unsigned i = 0; i < record.count(); i++) { |
42 if (callback && callback->abortDrawing()) { | 45 if (callback && callback->abortDrawing()) { |
43 return; | 46 return; |
44 } | 47 } |
| 48 // This visit call uses the SkRecords::Draw::operator() to call |
| 49 // methods on the |canvas|, wrapped by methods defined with the |
| 50 // DRAW() macro. |
45 record.visit<void>(i, draw); | 51 record.visit<void>(i, draw); |
46 } | 52 } |
47 } | 53 } |
48 } | 54 } |
49 | 55 |
50 void SkRecordPartialDraw(const SkRecord& record, | 56 void SkRecordPartialDraw(const SkRecord& record, |
51 SkCanvas* canvas, | 57 SkCanvas* canvas, |
52 const SkRect& clearRect, | 58 const SkRect& clearRect, |
53 unsigned start, unsigned stop, | 59 unsigned start, unsigned stop, |
54 const SkMatrix& initialCTM) { | 60 const SkMatrix& initialCTM) { |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. | 556 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. |
551 SkTDArray<SaveBounds> fSaveStack; | 557 SkTDArray<SaveBounds> fSaveStack; |
552 SkTDArray<unsigned> fControlIndices; | 558 SkTDArray<unsigned> fControlIndices; |
553 }; | 559 }; |
554 | 560 |
555 } // namespace SkRecords | 561 } // namespace SkRecords |
556 | 562 |
557 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkBBoxHi
erarchy* bbh) { | 563 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkBBoxHi
erarchy* bbh) { |
558 SkRecords::FillBounds(cullRect, record, bbh); | 564 SkRecords::FillBounds(cullRect, record, bbh); |
559 } | 565 } |
OLD | NEW |