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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 1523053003: add backdrop option to SaveLayerRec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ignore the hack in sampleapp.cpp, just for testing Created 4 years, 11 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/private/SkRecords.h ('k') | samplecode/SampleLayers.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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 static int gSampleGrabCounter; 1377 static int gSampleGrabCounter;
1378 SkString name; 1378 SkString name;
1379 name.printf("sample_grab_%d.png", gSampleGrabCounter++); 1379 name.printf("sample_grab_%d.png", gSampleGrabCounter++);
1380 SkImageEncoder::EncodeFile(name.c_str(), bmp, 1380 SkImageEncoder::EncodeFile(name.c_str(), bmp,
1381 SkImageEncoder::kPNG_Type, 100); 1381 SkImageEncoder::kPNG_Type, 100);
1382 } 1382 }
1383 } 1383 }
1384 1384
1385 if (kPicture_DeviceType == fDeviceType) { 1385 if (kPicture_DeviceType == fDeviceType) {
1386 SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording()); 1386 SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording());
1387 1387
robertphillips 2016/01/05 22:24:34 Delete this ?
reed1 2016/01/07 15:27:11 Done.
1388 if (true) {
1389 SkDynamicMemoryWStream wstream;
1390 picture->serialize(&wstream);
1391
1392 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream());
1393 picture.reset(SkPicture::CreateFromStream(rstream));
1394 }
1395
1388 if (fSaveToSKP) { 1396 if (fSaveToSKP) {
1389 SkFILEWStream stream("sample_app.skp"); 1397 SkFILEWStream stream("sample_app.skp");
1390 picture->serialize(&stream); 1398 picture->serialize(&stream);
1391 fSaveToSKP = false; 1399 fSaveToSKP = false;
1392 } 1400 }
1393 1401
1394 if (true) { 1402 if (true) {
1395 if (true) { 1403 if (true) {
1396 SkImageInfo info; 1404 SkImageInfo info;
1397 size_t rowBytes; 1405 size_t rowBytes;
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
2453 #ifdef SK_BUILD_FOR_MAC 2461 #ifdef SK_BUILD_FOR_MAC
2454 setenv("ANDROID_ROOT", "/android/device/data", 0); 2462 setenv("ANDROID_ROOT", "/android/device/data", 0);
2455 #endif 2463 #endif
2456 SkGraphics::Init(); 2464 SkGraphics::Init();
2457 SkEvent::Init(); 2465 SkEvent::Init();
2458 } 2466 }
2459 2467
2460 void application_term() { 2468 void application_term() {
2461 SkEvent::Term(); 2469 SkEvent::Term();
2462 } 2470 }
OLDNEW
« no previous file with comments | « include/private/SkRecords.h ('k') | samplecode/SampleLayers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698