Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Side by Side Diff: src/core/SkPicture.cpp

Issue 316063005: Fix error revealed by Android unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 : fAccelData(NULL) { 127 : fAccelData(NULL) {
128 this->needsNewGenID(); 128 this->needsNewGenID();
129 fPlayback = NULL; 129 fPlayback = NULL;
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 bool deepCopy) {
139 SkPictInfo info; 138 SkPictInfo info;
140 resourceSrc->createHeader(&info); 139 resourceSrc->createHeader(&info);
141 return SkNEW_ARGS(SkPicturePlayback, (resourceSrc, record, info, deepCopy)); 140
141 // FakeEndRecording is only called from partialReplay. For that use case
scroggo 2014/06/10 13:31:25 Originally it had multiple callers. Does it make s
robertphillips 2014/06/10 17:26:28 It will go away entirely in a later CL.
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.
reed1 2014/06/10 12:29:03 just a suggestion to help document... const bool
robertphillips 2014/06/10 17:26:27 Done.
145 return SkNEW_ARGS(SkPicturePlayback, (resourceSrc, record, info, true));
142 } 146 }
143 147
144 SkPicture::SkPicture(const SkPicture& src) 148 SkPicture::SkPicture(const SkPicture& src)
145 : INHERITED() 149 : INHERITED()
146 , fAccelData(NULL) 150 , fAccelData(NULL)
147 , fContentInfo(src.fContentInfo) { 151 , fContentInfo(src.fContentInfo) {
148 this->needsNewGenID(); 152 this->needsNewGenID();
149 fWidth = src.fWidth; 153 fWidth = src.fWidth;
150 fHeight = src.fHeight; 154 fHeight = src.fHeight;
151 155
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 } while (SK_InvalidGenID == genID); 569 } while (SK_InvalidGenID == genID);
566 return genID; 570 return genID;
567 } 571 }
568 572
569 uint32_t SkPicture::uniqueID() const { 573 uint32_t SkPicture::uniqueID() const {
570 if (SK_InvalidGenID == fUniqueID) { 574 if (SK_InvalidGenID == fUniqueID) {
571 fUniqueID = next_picture_generation_id(); 575 fUniqueID = next_picture_generation_id();
572 } 576 }
573 return fUniqueID; 577 return fUniqueID;
574 } 578 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698