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

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

Issue 349313004: No one uses SkPicture::swap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « include/core/SkPicture.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 if (src.fPlayback.get()) { 155 if (src.fPlayback.get()) {
156 fPlayback.reset(SkNEW_ARGS(SkPicturePlayback, (*src.fPlayback))); 156 fPlayback.reset(SkNEW_ARGS(SkPicturePlayback, (*src.fPlayback)));
157 fUniqueID = src.uniqueID(); // need to call method to ensure != 0 157 fUniqueID = src.uniqueID(); // need to call method to ensure != 0
158 } 158 }
159 } 159 }
160 160
161 // fRecord OK 161 // fRecord OK
162 SkPicture::~SkPicture() {} 162 SkPicture::~SkPicture() {}
163 163
164 // fRecord OK
165 void SkPicture::swap(SkPicture& other) {
166 SkTSwap(fUniqueID, other.fUniqueID);
167 SkTSwap(fWidth, other.fWidth);
168 SkTSwap(fHeight, other.fHeight);
169
170 fAccelData.swap(&other.fAccelData);
171 fPlayback.swap(&other.fPlayback);
172 fRecord.swap(&other.fRecord);
173 }
174
175 // fRecord TODO 164 // fRecord TODO
176 SkPicture* SkPicture::clone() const { 165 SkPicture* SkPicture::clone() const {
177 SkPicture* clonedPicture = SkNEW(SkPicture); 166 SkPicture* clonedPicture = SkNEW(SkPicture);
178 this->clone(clonedPicture, 1); 167 this->clone(clonedPicture, 1);
179 return clonedPicture; 168 return clonedPicture;
180 } 169 }
181 170
182 // fRecord TODO 171 // fRecord TODO
183 void SkPicture::clone(SkPicture* pictures, int count) const { 172 void SkPicture::clone(SkPicture* pictures, int count) const {
184 SkPictCopyInfo copyInfo; 173 SkPictCopyInfo copyInfo;
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return fUniqueID; 524 return fUniqueID;
536 } 525 }
537 526
538 // fRecord OK 527 // fRecord OK
539 SkPicture::SkPicture(int width, int height, SkRecord* record) 528 SkPicture::SkPicture(int width, int height, SkRecord* record)
540 : fWidth(width) 529 : fWidth(width)
541 , fHeight(height) 530 , fHeight(height)
542 , fRecord(record) { 531 , fRecord(record) {
543 this->needsNewGenID(); 532 this->needsNewGenID();
544 } 533 }
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698