| 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 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 SkDynamicMemoryWStream ostream; | 1369 SkDynamicMemoryWStream ostream; |
| 1370 picture->serialize(&ostream); | 1370 picture->serialize(&ostream); |
| 1371 | 1371 |
| 1372 SkAutoDataUnref data(ostream.copyToData()); | 1372 SkAutoDataUnref data(ostream.copyToData()); |
| 1373 SkMemoryStream istream(data->data(), data->size()); | 1373 SkMemoryStream istream(data->data(), data->size()); |
| 1374 SkAutoTUnref<SkPicture> pict(SkPicture::CreateFromStream(&istream)); | 1374 SkAutoTUnref<SkPicture> pict(SkPicture::CreateFromStream(&istream)); |
| 1375 if (pict.get() != NULL) { | 1375 if (pict.get() != NULL) { |
| 1376 orig->drawPicture(pict.get()); | 1376 orig->drawPicture(pict.get()); |
| 1377 } | 1377 } |
| 1378 } else { | 1378 } else { |
| 1379 picture->draw(orig); | 1379 picture->playback(orig); |
| 1380 } | 1380 } |
| 1381 } | 1381 } |
| 1382 | 1382 |
| 1383 // Do this after presentGL and other finishing, rather than in afterChild | 1383 // Do this after presentGL and other finishing, rather than in afterChild |
| 1384 if (fMeasureFPS && fMeasureFPS_StartTime) { | 1384 if (fMeasureFPS && fMeasureFPS_StartTime) { |
| 1385 fMeasureFPS_Time += SkTime::GetMSecs() - fMeasureFPS_StartTime; | 1385 fMeasureFPS_Time += SkTime::GetMSecs() - fMeasureFPS_StartTime; |
| 1386 } | 1386 } |
| 1387 } | 1387 } |
| 1388 | 1388 |
| 1389 void SampleWindow::beforeChild(SkView* child, SkCanvas* canvas) { | 1389 void SampleWindow::beforeChild(SkView* child, SkCanvas* canvas) { |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2396 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2396 setenv("ANDROID_ROOT", "/android/device/data", 0); |
| 2397 #endif | 2397 #endif |
| 2398 SkGraphics::Init(); | 2398 SkGraphics::Init(); |
| 2399 SkEvent::Init(); | 2399 SkEvent::Init(); |
| 2400 } | 2400 } |
| 2401 | 2401 |
| 2402 void application_term() { | 2402 void application_term() { |
| 2403 SkEvent::Term(); | 2403 SkEvent::Term(); |
| 2404 SkGraphics::Term(); | 2404 SkGraphics::Term(); |
| 2405 } | 2405 } |
| OLD | NEW |