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 "SkData.h" | 8 #include "SkData.h" |
9 #include "SkLayerInfo.h" | 9 #include "SkLayerInfo.h" |
10 #include "SkPictureRecorder.h" | 10 #include "SkPictureRecorder.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 if (saveLayerData) { | 54 if (saveLayerData) { |
55 SkRecordComputeLayers(fCullRect, *fRecord, fBBH.get(), saveLayerData
); | 55 SkRecordComputeLayers(fCullRect, *fRecord, fBBH.get(), saveLayerData
); |
56 } else { | 56 } else { |
57 SkRecordFillBounds(fCullRect, *fRecord, fBBH.get()); | 57 SkRecordFillBounds(fCullRect, *fRecord, fBBH.get()); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 // TODO: we should remember these from our caller | 61 // TODO: we should remember these from our caller |
62 SkBBHFactory* factory = NULL; | 62 SkBBHFactory* factory = NULL; |
63 uint32_t recordFlags = 0; | 63 uint32_t recordFlags = 0; |
64 SkAutoDataUnref drawablePicts(fRecorder->newDrawableSnapshot(factory, record
Flags)); | 64 SkAutoTUnref<SkPicture::SnapshotArray> drawablePicts( |
| 65 fRecorder->newDrawableSnapshot(factory, recordFlags)); |
65 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord.detach(), | 66 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord.detach(), |
66 drawablePicts, fBBH.get())); | 67 drawablePicts.detach(), fBBH.get())
); |
67 | 68 |
68 if (saveLayerData) { | 69 if (saveLayerData) { |
69 pict->EXPERIMENTAL_addAccelData(saveLayerData); | 70 pict->EXPERIMENTAL_addAccelData(saveLayerData); |
70 } | 71 } |
71 | 72 |
72 return pict; | 73 return pict; |
73 } | 74 } |
74 | 75 |
75 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { | 76 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { |
76 if (NULL == canvas) { | 77 if (NULL == canvas) { |
77 return; | 78 return; |
78 } | 79 } |
79 | 80 |
80 int drawableCount = 0; | 81 int drawableCount = 0; |
81 SkRecordDraw(*fRecord, canvas, NULL, drawableCount, NULL/*bbh*/, NULL/*callb
ack*/); | 82 SkRecordDraw(*fRecord, canvas, NULL, drawableCount, NULL/*bbh*/, NULL/*callb
ack*/); |
82 } | 83 } |
OLD | NEW |