OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include <new> | 7 #include <new> |
8 #include "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
9 #include "SkDrawPictureCallback.h" | 9 #include "SkDrawPictureCallback.h" |
10 #include "SkPictureData.h" | 10 #include "SkPictureData.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 const SkPictInfo& info, | 41 const SkPictInfo& info, |
42 bool deepCopyOps) | 42 bool deepCopyOps) |
43 : fInfo(info) { | 43 : fInfo(info) { |
44 | 44 |
45 this->init(); | 45 this->init(); |
46 | 46 |
47 fOpData = record.opData(deepCopyOps); | 47 fOpData = record.opData(deepCopyOps); |
48 | 48 |
49 fContentInfo.set(record.fContentInfo); | 49 fContentInfo.set(record.fContentInfo); |
50 | 50 |
51 // copy over the refcnt dictionary to our reader | |
52 record.fFlattenableHeap.setupPlaybacks(); | |
53 | |
54 fBitmaps = record.fBitmapHeap->extractBitmaps(); | 51 fBitmaps = record.fBitmapHeap->extractBitmaps(); |
55 fPaints = record.fPaints.unflattenToArray(); | 52 fPaints = SkTRefArray<SkPaint>::Create(record.fPaints.begin(), record.fPaint
s.count()); |
56 | 53 |
57 fBitmapHeap.reset(SkSafeRef(record.fBitmapHeap)); | 54 fBitmapHeap.reset(SkSafeRef(record.fBitmapHeap)); |
58 fPathHeap.reset(SkSafeRef(record.pathHeap())); | 55 fPathHeap.reset(SkSafeRef(record.pathHeap())); |
59 | 56 |
60 this->initForPlayback(); | 57 this->initForPlayback(); |
61 | 58 |
62 const SkTDArray<const SkPicture* >& pictures = record.getPictureRefs(); | 59 const SkTDArray<const SkPicture* >& pictures = record.getPictureRefs(); |
63 fPictureCount = pictures.count(); | 60 fPictureCount = pictures.count(); |
64 if (fPictureCount > 0) { | 61 if (fPictureCount > 0) { |
65 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); | 62 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 } | 579 } |
583 } | 580 } |
584 | 581 |
585 bool SkPictureData::suitableForLayerOptimization() const { | 582 bool SkPictureData::suitableForLayerOptimization() const { |
586 return fContentInfo.numLayers() > 0; | 583 return fContentInfo.numLayers() > 0; |
587 } | 584 } |
588 #endif | 585 #endif |
589 /////////////////////////////////////////////////////////////////////////////// | 586 /////////////////////////////////////////////////////////////////////////////// |
590 | 587 |
591 | 588 |
OLD | NEW |