Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |