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 #include "SampleApp.h" | 7 #include "SampleApp.h" |
8 | 8 |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 return true; | 1839 return true; |
1840 } | 1840 } |
1841 break; | 1841 break; |
1842 case kLeft_SkKey: | 1842 case kLeft_SkKey: |
1843 if (this->previousSample()) { | 1843 if (this->previousSample()) { |
1844 return true; | 1844 return true; |
1845 } | 1845 } |
1846 return true; | 1846 return true; |
1847 case kUp_SkKey: | 1847 case kUp_SkKey: |
1848 if (USE_ARROWS_FOR_ZOOM) { | 1848 if (USE_ARROWS_FOR_ZOOM) { |
1849 this->changeZoomLevel(1.f); | 1849 this->changeZoomLevel(1.f / 32.f); |
1850 } else { | 1850 } else { |
1851 fNClip = !fNClip; | 1851 fNClip = !fNClip; |
1852 this->inval(NULL); | 1852 this->inval(NULL); |
1853 this->updateTitle(); | 1853 this->updateTitle(); |
1854 } | 1854 } |
1855 return true; | 1855 return true; |
1856 case kDown_SkKey: | 1856 case kDown_SkKey: |
1857 if (USE_ARROWS_FOR_ZOOM) { | 1857 if (USE_ARROWS_FOR_ZOOM) { |
1858 this->changeZoomLevel(-1.f); | 1858 this->changeZoomLevel(-1.f / 32.f); |
1859 } else { | 1859 } else { |
1860 this->setConfig(cycle_configs(this->getBitmap().config())); | 1860 this->setConfig(cycle_configs(this->getBitmap().config())); |
1861 this->updateTitle(); | 1861 this->updateTitle(); |
1862 } | 1862 } |
1863 return true; | 1863 return true; |
1864 case kOK_SkKey: { | 1864 case kOK_SkKey: { |
1865 SkString title; | 1865 SkString title; |
1866 if (curr_title(this, &title)) { | 1866 if (curr_title(this, &title)) { |
1867 writeTitleToPrefs(title.c_str()); | 1867 writeTitleToPrefs(title.c_str()); |
1868 } | 1868 } |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 SkGraphics::Init(); | 2455 SkGraphics::Init(); |
2456 SkEvent::Init(); | 2456 SkEvent::Init(); |
2457 } | 2457 } |
2458 | 2458 |
2459 // FIXME: this should be in a header | 2459 // FIXME: this should be in a header |
2460 void application_term(); | 2460 void application_term(); |
2461 void application_term() { | 2461 void application_term() { |
2462 SkEvent::Term(); | 2462 SkEvent::Term(); |
2463 SkGraphics::Term(); | 2463 SkGraphics::Term(); |
2464 } | 2464 } |
OLD | NEW |