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 19 matching lines...) Expand all Loading... |
30 #include "SkTypeface.h" | 30 #include "SkTypeface.h" |
31 #include "SkWindow.h" | 31 #include "SkWindow.h" |
32 #include "sk_tool_utils.h" | 32 #include "sk_tool_utils.h" |
33 | 33 |
34 #if SK_SUPPORT_GPU | 34 #if SK_SUPPORT_GPU |
35 #include "gl/GrGLInterface.h" | 35 #include "gl/GrGLInterface.h" |
36 #include "gl/GrGLUtil.h" | 36 #include "gl/GrGLUtil.h" |
37 #include "GrRenderTarget.h" | 37 #include "GrRenderTarget.h" |
38 #include "GrContext.h" | 38 #include "GrContext.h" |
39 #include "SkGpuDevice.h" | 39 #include "SkGpuDevice.h" |
| 40 #include "GrTessellatingPathRenderer.h" |
40 #else | 41 #else |
41 class GrContext; | 42 class GrContext; |
42 #endif | 43 #endif |
43 | 44 |
44 extern SampleView* CreateSamplePictFileView(const char filename[]); | 45 extern SampleView* CreateSamplePictFileView(const char filename[]); |
45 | 46 |
46 class PictFileFactory : public SkViewFactory { | 47 class PictFileFactory : public SkViewFactory { |
47 SkString fFilename; | 48 SkString fFilename; |
48 public: | 49 public: |
49 PictFileFactory(const SkString& filename) : fFilename(filename) {} | 50 PictFileFactory(const SkString& filename) : fFilename(filename) {} |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 877 |
877 itemID =fAppMenu->appendList("Device Type", "Device Type", sinkID, 0, | 878 itemID =fAppMenu->appendList("Device Type", "Device Type", sinkID, 0, |
878 "Raster", "Picture", "OpenGL", | 879 "Raster", "Picture", "OpenGL", |
879 #if SK_ANGLE | 880 #if SK_ANGLE |
880 "ANGLE", | 881 "ANGLE", |
881 #endif | 882 #endif |
882 NULL); | 883 NULL); |
883 fAppMenu->assignKeyEquivalentToItem(itemID, 'd'); | 884 fAppMenu->assignKeyEquivalentToItem(itemID, 'd'); |
884 itemID = fAppMenu->appendTriState("AA", "AA", sinkID, fAAState); | 885 itemID = fAppMenu->appendTriState("AA", "AA", sinkID, fAAState); |
885 fAppMenu->assignKeyEquivalentToItem(itemID, 'b'); | 886 fAppMenu->assignKeyEquivalentToItem(itemID, 'b'); |
| 887 itemID = fAppMenu->appendSwitch("Wireframe", "Wireframe", sinkID, false); |
| 888 fAppMenu->assignKeyEquivalentToItem(itemID, 'w'); |
886 itemID = fAppMenu->appendTriState("LCD", "LCD", sinkID, fLCDState); | 889 itemID = fAppMenu->appendTriState("LCD", "LCD", sinkID, fLCDState); |
887 fAppMenu->assignKeyEquivalentToItem(itemID, 'l'); | 890 fAppMenu->assignKeyEquivalentToItem(itemID, 'l'); |
888 itemID = fAppMenu->appendList("FilterLevel", "FilterLevel", sinkID, fFilterL
evelIndex, | 891 itemID = fAppMenu->appendList("FilterLevel", "FilterLevel", sinkID, fFilterL
evelIndex, |
889 gFilterLevelStates[0].fName, | 892 gFilterLevelStates[0].fName, |
890 gFilterLevelStates[1].fName, | 893 gFilterLevelStates[1].fName, |
891 gFilterLevelStates[2].fName, | 894 gFilterLevelStates[2].fName, |
892 gFilterLevelStates[3].fName, | 895 gFilterLevelStates[3].fName, |
893 gFilterLevelStates[4].fName, | 896 gFilterLevelStates[4].fName, |
894 NULL); | 897 NULL); |
895 fAppMenu->assignKeyEquivalentToItem(itemID, 'n'); | 898 fAppMenu->assignKeyEquivalentToItem(itemID, 'n'); |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 #endif | 1590 #endif |
1588 (void)SampleView::SetUsePipe(curr_view(this), fPipeState); | 1591 (void)SampleView::SetUsePipe(curr_view(this), fPipeState); |
1589 this->updateTitle(); | 1592 this->updateTitle(); |
1590 this->inval(NULL); | 1593 this->inval(NULL); |
1591 return true; | 1594 return true; |
1592 } | 1595 } |
1593 if (SkOSMenu::FindSwitchState(evt, "Slide Show", NULL)) { | 1596 if (SkOSMenu::FindSwitchState(evt, "Slide Show", NULL)) { |
1594 this->toggleSlideshow(); | 1597 this->toggleSlideshow(); |
1595 return true; | 1598 return true; |
1596 } | 1599 } |
| 1600 if (SkOSMenu::FindSwitchState(evt, "Wireframe", &GrTessellatingPathRenderer:
:gWireframe)) { |
| 1601 this->inval(NULL); |
| 1602 return true; |
| 1603 } |
1597 if (SkOSMenu::FindTriState(evt, "AA", &fAAState) || | 1604 if (SkOSMenu::FindTriState(evt, "AA", &fAAState) || |
1598 SkOSMenu::FindTriState(evt, "LCD", &fLCDState) || | 1605 SkOSMenu::FindTriState(evt, "LCD", &fLCDState) || |
1599 SkOSMenu::FindListIndex(evt, "FilterLevel", &fFilterLevelIndex) || | 1606 SkOSMenu::FindListIndex(evt, "FilterLevel", &fFilterLevelIndex) || |
1600 SkOSMenu::FindTriState(evt, "Subpixel", &fSubpixelState) || | 1607 SkOSMenu::FindTriState(evt, "Subpixel", &fSubpixelState) || |
1601 SkOSMenu::FindListIndex(evt, "Hinting", &fHintingState) || | 1608 SkOSMenu::FindListIndex(evt, "Hinting", &fHintingState) || |
1602 SkOSMenu::FindSwitchState(evt, "Clip", &fUseClip) || | 1609 SkOSMenu::FindSwitchState(evt, "Clip", &fUseClip) || |
1603 SkOSMenu::FindSwitchState(evt, "Zoomer", &fShowZoomer) || | 1610 SkOSMenu::FindSwitchState(evt, "Zoomer", &fShowZoomer) || |
1604 SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify) || | 1611 SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify) || |
1605 SkOSMenu::FindListIndex(evt, "Transition-Next", &fTransitionNext) || | 1612 SkOSMenu::FindListIndex(evt, "Transition-Next", &fTransitionNext) || |
1606 SkOSMenu::FindListIndex(evt, "Transition-Prev", &fTransitionPrev)) { | 1613 SkOSMenu::FindListIndex(evt, "Transition-Prev", &fTransitionPrev)) { |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2434 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2428 #endif | 2435 #endif |
2429 SkGraphics::Init(); | 2436 SkGraphics::Init(); |
2430 SkEvent::Init(); | 2437 SkEvent::Init(); |
2431 } | 2438 } |
2432 | 2439 |
2433 void application_term() { | 2440 void application_term() { |
2434 SkEvent::Term(); | 2441 SkEvent::Term(); |
2435 SkGraphics::Term(); | 2442 SkGraphics::Term(); |
2436 } | 2443 } |
OLD | NEW |