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 30 matching lines...) Expand all Loading... |
41 return; | 41 return; |
42 } | 42 } |
43 record.visit<void>(i, draw); | 43 record.visit<void>(i, draw); |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 void SkRecordPartialDraw(const SkRecord& record, | 48 void SkRecordPartialDraw(const SkRecord& record, |
49 SkCanvas* canvas, | 49 SkCanvas* canvas, |
50 const SkRect& clearRect, | 50 const SkRect& clearRect, |
51 unsigned start, unsigned stop) { | 51 unsigned start, unsigned stop, |
| 52 const SkMatrix& initialCTM) { |
52 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); | 53 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); |
53 | 54 |
54 stop = SkTMin(stop, record.count()); | 55 stop = SkTMin(stop, record.count()); |
55 SkRecords::PartialDraw draw(canvas, clearRect); | 56 SkRecords::PartialDraw draw(canvas, clearRect, initialCTM); |
56 for (unsigned i = start; i < stop; i++) { | 57 for (unsigned i = start; i < stop; i++) { |
57 record.visit<void>(i, draw); | 58 record.visit<void>(i, draw); |
58 } | 59 } |
59 } | 60 } |
60 | 61 |
61 namespace SkRecords { | 62 namespace SkRecords { |
62 | 63 |
63 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip
le threads. | 64 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip
le threads. |
64 static SkBitmap shallow_copy(const SkBitmap& bitmap) { | 65 static SkBitmap shallow_copy(const SkBitmap& bitmap) { |
65 return bitmap; | 66 return bitmap; |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. | 508 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. |
508 SkTDArray<SaveBounds> fSaveStack; | 509 SkTDArray<SaveBounds> fSaveStack; |
509 SkTDArray<unsigned> fControlIndices; | 510 SkTDArray<unsigned> fControlIndices; |
510 }; | 511 }; |
511 | 512 |
512 } // namespace SkRecords | 513 } // namespace SkRecords |
513 | 514 |
514 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { | 515 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { |
515 SkRecords::FillBounds(record, bbh); | 516 SkRecords::FillBounds(record, bbh); |
516 } | 517 } |
OLD | NEW |