| 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 "SkLayerInfo.h" | 9 #include "SkLayerInfo.h" |
| 9 #include "SkPictureRecorder.h" | 10 #include "SkPictureRecorder.h" |
| 10 #include "SkRecord.h" | 11 #include "SkRecord.h" |
| 11 #include "SkRecordDraw.h" | 12 #include "SkRecordDraw.h" |
| 12 #include "SkRecorder.h" | 13 #include "SkRecorder.h" |
| 13 #include "SkRecordOpts.h" | 14 #include "SkRecordOpts.h" |
| 14 #include "SkTypes.h" | 15 #include "SkTypes.h" |
| 15 | 16 |
| 16 SkPictureRecorder::SkPictureRecorder() {} | 17 SkPictureRecorder::SkPictureRecorder() {} |
| 17 | 18 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if (fBBH.get()) { | 54 if (fBBH.get()) { |
| 54 SkRect cullRect = SkRect::MakeWH(fCullWidth, fCullHeight); | 55 SkRect cullRect = SkRect::MakeWH(fCullWidth, fCullHeight); |
| 55 | 56 |
| 56 if (saveLayerData) { | 57 if (saveLayerData) { |
| 57 SkRecordComputeLayers(cullRect, *fRecord, fBBH.get(), saveLayerData)
; | 58 SkRecordComputeLayers(cullRect, *fRecord, fBBH.get(), saveLayerData)
; |
| 58 } else { | 59 } else { |
| 59 SkRecordFillBounds(cullRect, *fRecord, fBBH.get()); | 60 SkRecordFillBounds(cullRect, *fRecord, fBBH.get()); |
| 60 } | 61 } |
| 61 } | 62 } |
| 62 | 63 |
| 63 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullWidth, fCullHeight, fRecord.de
tach(), fBBH.get())); | 64 // TODO: we should remember these from our caller |
| 65 SkBBHFactory* factory = NULL; |
| 66 uint32_t recordFlags = 0; |
| 67 SkAutoDataUnref drawablePicts(fRecorder->newDrawableSnapshot(factory, record
Flags)); |
| 68 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullWidth, fCullHeight, fRecord.de
tach(), |
| 69 drawablePicts, fBBH.get())); |
| 64 | 70 |
| 65 if (saveLayerData) { | 71 if (saveLayerData) { |
| 66 pict->EXPERIMENTAL_addAccelData(saveLayerData); | 72 pict->EXPERIMENTAL_addAccelData(saveLayerData); |
| 67 } | 73 } |
| 68 | 74 |
| 69 return pict; | 75 return pict; |
| 70 } | 76 } |
| 71 | 77 |
| 72 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { | 78 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { |
| 73 if (NULL == canvas) { | 79 if (NULL == canvas) { |
| 74 return; | 80 return; |
| 75 } | 81 } |
| 76 SkRecordDraw(*fRecord, canvas, NULL/*bbh*/, NULL/*callback*/); | 82 |
| 83 int drawableCount = 0; |
| 84 SkRecordDraw(*fRecord, canvas, NULL, drawableCount, NULL/*bbh*/, NULL/*callb
ack*/); |
| 77 } | 85 } |
| OLD | NEW |