OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkPictureFlat.h" | 10 #include "SkPictureFlat.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 fWidth = fHeight = 0; | 130 fWidth = fHeight = 0; |
131 } | 131 } |
132 | 132 |
133 // This method makes a SkPicturePlayback object from an in-progress recording. | 133 // This method makes a SkPicturePlayback object from an in-progress recording. |
134 // Unfortunately, it does not include the restoreToCount of a real endRecording | 134 // Unfortunately, it does not include the restoreToCount of a real endRecording |
135 // call. | 135 // call. |
136 SkPicturePlayback* SkPicture::FakeEndRecording(const SkPicture* resourceSrc, | 136 SkPicturePlayback* SkPicture::FakeEndRecording(const SkPicture* resourceSrc, |
137 const SkPictureRecord& record) { | 137 const SkPictureRecord& record) { |
138 SkPictInfo info; | 138 SkPictInfo info; |
139 resourceSrc->createHeader(&info); | 139 resourceSrc->createHeader(&info); |
140 return SkNEW_ARGS(SkPicturePlayback, (resourceSrc, record, info)); | 140 |
| 141 // FakeEndRecording is only called from partialReplay. For that use case |
| 142 // we cannot be certain that the next call to SkWriter32::overwriteTAt |
| 143 // will be preceded by an append (i.e., that the required copy on write |
| 144 // will occur). In this case just force a deep copy of the operations. |
| 145 const bool deepCopyOps = true; |
| 146 return SkNEW_ARGS(SkPicturePlayback, (resourceSrc, record, info, deepCopyOps
)); |
141 } | 147 } |
142 | 148 |
143 SkPicture::SkPicture(const SkPicture& src) | 149 SkPicture::SkPicture(const SkPicture& src) |
144 : INHERITED() | 150 : INHERITED() |
145 , fAccelData(NULL) | 151 , fAccelData(NULL) |
146 , fContentInfo(src.fContentInfo) { | 152 , fContentInfo(src.fContentInfo) { |
147 this->needsNewGenID(); | 153 this->needsNewGenID(); |
148 fWidth = src.fWidth; | 154 fWidth = src.fWidth; |
149 fHeight = src.fHeight; | 155 fHeight = src.fHeight; |
150 | 156 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 } while (SK_InvalidGenID == genID); | 570 } while (SK_InvalidGenID == genID); |
565 return genID; | 571 return genID; |
566 } | 572 } |
567 | 573 |
568 uint32_t SkPicture::uniqueID() const { | 574 uint32_t SkPicture::uniqueID() const { |
569 if (SK_InvalidGenID == fUniqueID) { | 575 if (SK_InvalidGenID == fUniqueID) { |
570 fUniqueID = next_picture_generation_id(); | 576 fUniqueID = next_picture_generation_id(); |
571 } | 577 } |
572 return fUniqueID; | 578 return fUniqueID; |
573 } | 579 } |
OLD | NEW |