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 "SkLayerInfo.h" | 8 #include "SkLayerInfo.h" |
9 #include "SkRecordDraw.h" | 9 #include "SkRecordDraw.h" |
10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // This visit call uses the SkRecords::Draw::operator() to call | 54 // This visit call uses the SkRecords::Draw::operator() to call |
55 // methods on the |canvas|, wrapped by methods defined with the | 55 // methods on the |canvas|, wrapped by methods defined with the |
56 // DRAW() macro. | 56 // DRAW() macro. |
57 record.visit<void>(i, draw); | 57 record.visit<void>(i, draw); |
58 } | 58 } |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 void SkRecordPartialDraw(const SkRecord& record, SkCanvas* canvas, | 62 void SkRecordPartialDraw(const SkRecord& record, SkCanvas* canvas, |
63 SkPicture const* const drawablePicts[], int drawableCou
nt, | 63 SkPicture const* const drawablePicts[], int drawableCou
nt, |
64 const SkRect& clearRect, | |
65 unsigned start, unsigned stop, | 64 unsigned start, unsigned stop, |
66 const SkMatrix& initialCTM) { | 65 const SkMatrix& initialCTM) { |
67 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); | 66 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); |
68 | 67 |
69 stop = SkTMin(stop, record.count()); | 68 stop = SkTMin(stop, record.count()); |
70 SkRecords::PartialDraw draw(canvas, NULL, 0, clearRect, initialCTM); | 69 SkRecords::Draw draw(canvas, drawablePicts, NULL, drawableCount, &initialCTM
); |
71 for (unsigned i = start; i < stop; i++) { | 70 for (unsigned i = start; i < stop; i++) { |
72 record.visit<void>(i, draw); | 71 record.visit<void>(i, draw); |
73 } | 72 } |
74 } | 73 } |
75 | 74 |
76 namespace SkRecords { | 75 namespace SkRecords { |
77 | 76 |
78 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip
le threads. | 77 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip
le threads. |
79 static SkBitmap shallow_copy(const SkBitmap& bitmap) { | 78 static SkBitmap shallow_copy(const SkBitmap& bitmap) { |
80 return bitmap; | 79 return bitmap; |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); | 801 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); |
803 | 802 |
804 for (unsigned curOp = 0; curOp < record.count(); curOp++) { | 803 for (unsigned curOp = 0; curOp < record.count(); curOp++) { |
805 visitor.setCurrentOp(curOp); | 804 visitor.setCurrentOp(curOp); |
806 record.visit<void>(curOp, visitor); | 805 record.visit<void>(curOp, visitor); |
807 } | 806 } |
808 | 807 |
809 visitor.cleanUp(bbh); | 808 visitor.cleanUp(bbh); |
810 } | 809 } |
811 | 810 |
OLD | NEW |