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 "SkImageGenerator.h" | 8 #include "SkImageGenerator.h" |
9 #include "SkPictureData.h" | 9 #include "SkPictureData.h" |
10 #include "SkPictureRecord.h" | 10 #include "SkPictureRecord.h" |
(...skipping 28 matching lines...) Expand all Loading... | |
39 : fInfo(info) { | 39 : fInfo(info) { |
40 | 40 |
41 this->init(); | 41 this->init(); |
42 | 42 |
43 fOpData = record.opData(deepCopyOps); | 43 fOpData = record.opData(deepCopyOps); |
44 | 44 |
45 fContentInfo.set(record.fContentInfo); | 45 fContentInfo.set(record.fContentInfo); |
46 | 46 |
47 fBitmaps = record.fBitmaps; | 47 fBitmaps = record.fBitmaps; |
48 fPaints = record.fPaints; | 48 fPaints = record.fPaints; |
49 fPaths = record.fPaths; | 49 |
50 fPaths.reset(record.fPaths.count() + 1); // 0 is reserved. | |
mtklein
2015/10/29 14:15:29
Oops, note to self, remove this. 0's not reserved
| |
51 record.fPaths.foreach([this](const SkPath& path, int n) { | |
52 fPaths[n] = path; | |
53 }); | |
50 | 54 |
51 this->initForPlayback(); | 55 this->initForPlayback(); |
52 | 56 |
53 const SkTDArray<const SkPicture* >& pictures = record.getPictureRefs(); | 57 const SkTDArray<const SkPicture* >& pictures = record.getPictureRefs(); |
54 fPictureCount = pictures.count(); | 58 fPictureCount = pictures.count(); |
55 if (fPictureCount > 0) { | 59 if (fPictureCount > 0) { |
56 fPictureRefs = new const SkPicture* [fPictureCount]; | 60 fPictureRefs = new const SkPicture* [fPictureCount]; |
57 for (int i = 0; i < fPictureCount; i++) { | 61 for (int i = 0; i < fPictureCount; i++) { |
58 fPictureRefs[i] = pictures[i]; | 62 fPictureRefs[i] = pictures[i]; |
59 fPictureRefs[i]->ref(); | 63 fPictureRefs[i]->ref(); |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
619 } | 623 } |
620 } | 624 } |
621 | 625 |
622 bool SkPictureData::suitableForLayerOptimization() const { | 626 bool SkPictureData::suitableForLayerOptimization() const { |
623 return fContentInfo.numLayers() > 0; | 627 return fContentInfo.numLayers() > 0; |
624 } | 628 } |
625 #endif | 629 #endif |
626 /////////////////////////////////////////////////////////////////////////////// | 630 /////////////////////////////////////////////////////////////////////////////// |
627 | 631 |
628 | 632 |
OLD | NEW |