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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 381133002: Remove SkPicture copy constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed unused "copy" method 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') | src/core/SkPicture.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 * 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 7
8 #include "SampleApp.h" 8 #include "SampleApp.h"
9 9
10 #include "OverView.h" 10 #include "OverView.h"
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 if (!bmp.isNull()) { 1352 if (!bmp.isNull()) {
1353 static int gSampleGrabCounter; 1353 static int gSampleGrabCounter;
1354 SkString name; 1354 SkString name;
1355 name.printf("sample_grab_%d.png", gSampleGrabCounter++); 1355 name.printf("sample_grab_%d.png", gSampleGrabCounter++);
1356 SkImageEncoder::EncodeFile(name.c_str(), bmp, 1356 SkImageEncoder::EncodeFile(name.c_str(), bmp,
1357 SkImageEncoder::kPNG_Type, 100); 1357 SkImageEncoder::kPNG_Type, 100);
1358 } 1358 }
1359 } 1359 }
1360 1360
1361 if (kPicture_DeviceType == fDeviceType) { 1361 if (kPicture_DeviceType == fDeviceType) {
1362 SkAutoTUnref<SkPicture> picture(fRecorder.endRecording()); 1362 SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording());
1363 1363
1364 if (true) { 1364 if (true) {
1365 SkPicture* pict = new SkPicture(*picture);
1366 this->installDrawFilter(orig); 1365 this->installDrawFilter(orig);
1367 orig->drawPicture(pict); 1366 orig->drawPicture(picture);
1368 pict->unref();
1369 } else if (true) { 1367 } else if (true) {
1370 SkDynamicMemoryWStream ostream; 1368 SkDynamicMemoryWStream ostream;
1371 picture->serialize(&ostream); 1369 picture->serialize(&ostream);
1372 1370
1373 SkAutoDataUnref data(ostream.copyToData()); 1371 SkAutoDataUnref data(ostream.copyToData());
1374 SkMemoryStream istream(data->data(), data->size()); 1372 SkMemoryStream istream(data->data(), data->size());
1375 SkAutoTUnref<SkPicture> pict(SkPicture::CreateFromStream(&istream)); 1373 SkAutoTUnref<SkPicture> pict(SkPicture::CreateFromStream(&istream));
1376 if (pict.get() != NULL) { 1374 if (pict.get() != NULL) {
1377 orig->drawPicture(pict.get()); 1375 orig->drawPicture(pict.get());
1378 } 1376 }
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 SkGraphics::Init(); 2399 SkGraphics::Init();
2402 SkEvent::Init(); 2400 SkEvent::Init();
2403 } 2401 }
2404 2402
2405 // FIXME: this should be in a header 2403 // FIXME: this should be in a header
2406 void application_term(); 2404 void application_term();
2407 void application_term() { 2405 void application_term() {
2408 SkEvent::Term(); 2406 SkEvent::Term();
2409 SkGraphics::Term(); 2407 SkGraphics::Term();
2410 } 2408 }
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698