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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 static bool compareSampleTitle(const SkViewFactory* first, const SkViewFactory*
second) { | 704 static bool compareSampleTitle(const SkViewFactory* first, const SkViewFactory*
second) { |
705 return strcmp(getSampleTitle(first).c_str(), getSampleTitle(second).c_str())
< 0; | 705 return strcmp(getSampleTitle(first).c_str(), getSampleTitle(second).c_str())
< 0; |
706 } | 706 } |
707 | 707 |
708 DEFINE_string(slide, "", "Start on this sample."); | 708 DEFINE_string(slide, "", "Start on this sample."); |
709 DEFINE_int32(msaa, 0, "Request multisampling with this count."); | 709 DEFINE_int32(msaa, 0, "Request multisampling with this count."); |
710 DEFINE_string(pictureDir, "", "Read pictures from here."); | 710 DEFINE_string(pictureDir, "", "Read pictures from here."); |
711 DEFINE_string(picture, "", "Path to single picture."); | 711 DEFINE_string(picture, "", "Path to single picture."); |
712 DEFINE_bool(sort, false, "Sort samples by title."); | 712 DEFINE_bool(sort, false, "Sort samples by title."); |
713 DEFINE_bool(list, false, "List samples?"); | 713 DEFINE_bool(list, false, "List samples?"); |
| 714 DEFINE_bool(gpu, false, "Start up with gpu?"); |
714 DEFINE_string(key, "", ""); // dummy to enable gm tests that have platform-spec
ific names | 715 DEFINE_string(key, "", ""); // dummy to enable gm tests that have platform-spec
ific names |
715 #ifdef SAMPLE_PDF_FILE_VIEWER | 716 #ifdef SAMPLE_PDF_FILE_VIEWER |
716 DEFINE_string(pdfPath, "", "Path to direcotry of pdf files."); | 717 DEFINE_string(pdfPath, "", "Path to direcotry of pdf files."); |
717 #endif | 718 #endif |
718 | 719 |
719 #include "SkTaskGroup.h" | 720 #include "SkTaskGroup.h" |
720 | 721 |
721 SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
Manager) | 722 SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
Manager) |
722 : INHERITED(hwnd) | 723 : INHERITED(hwnd) |
723 , fDevManager(nullptr) { | 724 , fDevManager(nullptr) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 static SkTaskGroup::Enabler enabled(-1); | 793 static SkTaskGroup::Enabler enabled(-1); |
793 gSampleWindow = this; | 794 gSampleWindow = this; |
794 | 795 |
795 #ifdef PIPE_FILE | 796 #ifdef PIPE_FILE |
796 //Clear existing file or create file if it doesn't exist | 797 //Clear existing file or create file if it doesn't exist |
797 FILE* f = fopen(FILE_PATH, "wb"); | 798 FILE* f = fopen(FILE_PATH, "wb"); |
798 fclose(f); | 799 fclose(f); |
799 #endif | 800 #endif |
800 | 801 |
801 fDeviceType = kRaster_DeviceType; | 802 fDeviceType = kRaster_DeviceType; |
| 803 if (FLAGS_gpu) { |
| 804 fDeviceType = kGPU_DeviceType; |
| 805 } |
802 | 806 |
803 #if DEFAULT_TO_GPU | 807 #if DEFAULT_TO_GPU |
804 fDeviceType = kGPU_DeviceType; | 808 fDeviceType = kGPU_DeviceType; |
805 #endif | 809 #endif |
806 #if SK_ANGLE && DEFAULT_TO_ANGLE | 810 #if SK_ANGLE && DEFAULT_TO_ANGLE |
807 fDeviceType = kANGLE_DeviceType; | 811 fDeviceType = kANGLE_DeviceType; |
808 #endif | 812 #endif |
809 #if SK_COMMAND_BUFFER && DEFAULT_TO_COMMAND_BUFFER | 813 #if SK_COMMAND_BUFFER && DEFAULT_TO_COMMAND_BUFFER |
810 fDeviceType = kCommandBuffer_DeviceType; | 814 fDeviceType = kCommandBuffer_DeviceType; |
811 #endif | 815 #endif |
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2391 #ifdef SK_BUILD_FOR_MAC | 2395 #ifdef SK_BUILD_FOR_MAC |
2392 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2396 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2393 #endif | 2397 #endif |
2394 SkGraphics::Init(); | 2398 SkGraphics::Init(); |
2395 SkEvent::Init(); | 2399 SkEvent::Init(); |
2396 } | 2400 } |
2397 | 2401 |
2398 void application_term() { | 2402 void application_term() { |
2399 SkEvent::Term(); | 2403 SkEvent::Term(); |
2400 } | 2404 } |
OLD | NEW |