| 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" |
| 11 #include "Resources.h" | 11 #include "Resources.h" |
| 12 #include "SampleCode.h" | 12 #include "SampleCode.h" |
| 13 #include "SamplePipeControllers.h" | 13 #include "SamplePipeControllers.h" |
| 14 #include "SkAnimTimer.h" | 14 #include "SkAnimTimer.h" |
| 15 #include "SkCanvas.h" | 15 #include "SkCanvas.h" |
| 16 #include "SkCommandLineFlags.h" | 16 #include "SkCommandLineFlags.h" |
| 17 #include "SkData.h" | 17 #include "SkData.h" |
| 18 #include "SkDevice.h" | 18 #include "SkDevice.h" |
| 19 #include "SkDocument.h" | 19 #include "SkDocument.h" |
| 20 #include "SkGPipe.h" | 20 #include "SkGPipe.h" |
| 21 #include "SkGraphics.h" | 21 #include "SkGraphics.h" |
| 22 #include "SkImageEncoder.h" | 22 #include "SkImageEncoder.h" |
| 23 #include "SkOSFile.h" | 23 #include "SkOSFile.h" |
| 24 #include "SkPaint.h" | 24 #include "SkPaint.h" |
| 25 #include "SkPaintFilterCanvas.h" | 25 #include "SkPaintFilterCanvas.h" |
| 26 #include "SkPicture.h" | 26 #include "SkPicture.h" |
| 27 #include "SkPictureRecorder.h" | 27 #include "SkPictureRecorder.h" |
| 28 #include "SkStream.h" | 28 #include "SkStream.h" |
| 29 #include "SkSurface.h" | 29 #include "SkSurface.h" |
| 30 #include "SkTemplates.h" |
| 30 #include "SkTSort.h" | 31 #include "SkTSort.h" |
| 31 #include "SkTime.h" | 32 #include "SkTime.h" |
| 32 #include "SkTypeface.h" | 33 #include "SkTypeface.h" |
| 33 #include "SkWindow.h" | 34 #include "SkWindow.h" |
| 34 #include "sk_tool_utils.h" | 35 #include "sk_tool_utils.h" |
| 35 | 36 |
| 36 #if SK_SUPPORT_GPU | 37 #if SK_SUPPORT_GPU |
| 37 #include "gl/GrGLInterface.h" | 38 #include "gl/GrGLInterface.h" |
| 38 #include "gl/GrGLUtil.h" | 39 #include "gl/GrGLUtil.h" |
| 39 #include "GrRenderTarget.h" | 40 #include "GrRenderTarget.h" |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 } | 786 } |
| 786 | 787 |
| 787 if (!FLAGS_sequence.isEmpty()) { | 788 if (!FLAGS_sequence.isEmpty()) { |
| 788 // The sequence file just contains a list (separated by CRs) of the samp
les or GM:gms | 789 // The sequence file just contains a list (separated by CRs) of the samp
les or GM:gms |
| 789 // you want to restrict to. Only these will appear when you cycle throug
h. | 790 // you want to restrict to. Only these will appear when you cycle throug
h. |
| 790 // If none are found, or the file is empty, then it will be ignored, and
all samples | 791 // If none are found, or the file is empty, then it will be ignored, and
all samples |
| 791 // will be available. | 792 // will be available. |
| 792 SkFILEStream stream(FLAGS_sequence[0]); | 793 SkFILEStream stream(FLAGS_sequence[0]); |
| 793 if (stream.isValid()) { | 794 if (stream.isValid()) { |
| 794 size_t len = stream.getLength(); | 795 size_t len = stream.getLength(); |
| 795 SkAutoMalloc storage(len + 1); | 796 SkAutoTMalloc<char> storage(len + 1); |
| 796 char* buffer = (char*)storage.get(); | 797 char* buffer = storage.get(); |
| 797 stream.read(buffer, len); | 798 stream.read(buffer, len); |
| 798 buffer[len] = 0; | 799 buffer[len] = 0; |
| 799 | 800 |
| 800 SkTArray<SkString> titles; | 801 SkTArray<SkString> titles; |
| 801 SkStrSplit(buffer, "\n\r", &titles); | 802 SkStrSplit(buffer, "\n\r", &titles); |
| 802 restrict_samples(fSamples, titles.begin(), titles.count()); | 803 restrict_samples(fSamples, titles.begin(), titles.count()); |
| 803 } | 804 } |
| 804 } | 805 } |
| 805 | 806 |
| 806 if (FLAGS_sort) { | 807 if (FLAGS_sort) { |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2452 #ifdef SK_BUILD_FOR_MAC | 2453 #ifdef SK_BUILD_FOR_MAC |
| 2453 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2454 setenv("ANDROID_ROOT", "/android/device/data", 0); |
| 2454 #endif | 2455 #endif |
| 2455 SkGraphics::Init(); | 2456 SkGraphics::Init(); |
| 2456 SkEvent::Init(); | 2457 SkEvent::Init(); |
| 2457 } | 2458 } |
| 2458 | 2459 |
| 2459 void application_term() { | 2460 void application_term() { |
| 2460 SkEvent::Term(); | 2461 SkEvent::Term(); |
| 2461 } | 2462 } |
| OLD | NEW |