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 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 } | 1791 } |
1792 | 1792 |
1793 void SampleWindow::toggleFPS() { | 1793 void SampleWindow::toggleFPS() { |
1794 fMeasureFPS = !fMeasureFPS; | 1794 fMeasureFPS = !fMeasureFPS; |
1795 this->updateTitle(); | 1795 this->updateTitle(); |
1796 this->inval(nullptr); | 1796 this->inval(nullptr); |
1797 } | 1797 } |
1798 | 1798 |
1799 void SampleWindow::toggleDistanceFieldFonts() { | 1799 void SampleWindow::toggleDistanceFieldFonts() { |
1800 SkSurfaceProps props = this->getSurfaceProps(); | 1800 SkSurfaceProps props = this->getSurfaceProps(); |
1801 uint32_t flags = props.flags() ^ SkSurfaceProps::kUseDistanceFieldFonts_Flag
; | 1801 uint32_t flags = props.flags() ^ SkSurfaceProps::kUseDeviceIndependentFonts_
Flag; |
1802 this->setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry())); | 1802 this->setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry())); |
1803 | 1803 |
1804 this->updateTitle(); | 1804 this->updateTitle(); |
1805 this->inval(nullptr); | 1805 this->inval(nullptr); |
1806 } | 1806 } |
1807 | 1807 |
1808 #include "SkDumpCanvas.h" | 1808 #include "SkDumpCanvas.h" |
1809 | 1809 |
1810 bool SampleWindow::onHandleKey(SkKey key) { | 1810 bool SampleWindow::onHandleKey(SkKey key) { |
1811 { | 1811 { |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 } | 1999 } |
2000 if (fAnimating) { | 2000 if (fAnimating) { |
2001 title.prepend("<A> "); | 2001 title.prepend("<A> "); |
2002 } | 2002 } |
2003 if (fRotate) { | 2003 if (fRotate) { |
2004 title.prepend("<R> "); | 2004 title.prepend("<R> "); |
2005 } | 2005 } |
2006 if (fPerspAnim) { | 2006 if (fPerspAnim) { |
2007 title.prepend("<K> "); | 2007 title.prepend("<K> "); |
2008 } | 2008 } |
2009 if (this->getSurfaceProps().flags() & SkSurfaceProps::kUseDistanceFieldFonts
_Flag) { | 2009 if (this->getSurfaceProps().flags() & SkSurfaceProps::kUseDeviceIndependentF
onts_Flag) { |
2010 title.prepend("<DFF> "); | 2010 title.prepend("<DIF> "); |
2011 } | 2011 } |
2012 | 2012 |
2013 title.prepend(trystate_str(fLCDState, "LCD ", "lcd ")); | 2013 title.prepend(trystate_str(fLCDState, "LCD ", "lcd ")); |
2014 title.prepend(trystate_str(fAAState, "AA ", "aa ")); | 2014 title.prepend(trystate_str(fAAState, "AA ", "aa ")); |
2015 title.prepend(gFilterQualityStates[fFilterQualityIndex].fLabel); | 2015 title.prepend(gFilterQualityStates[fFilterQualityIndex].fLabel); |
2016 title.prepend(trystate_str(fSubpixelState, "S ", "s ")); | 2016 title.prepend(trystate_str(fSubpixelState, "S ", "s ")); |
2017 title.prepend(fFlipAxis & kFlipAxis_X ? "X " : nullptr); | 2017 title.prepend(fFlipAxis & kFlipAxis_X ? "X " : nullptr); |
2018 title.prepend(fFlipAxis & kFlipAxis_Y ? "Y " : nullptr); | 2018 title.prepend(fFlipAxis & kFlipAxis_Y ? "Y " : nullptr); |
2019 title.prepend(gHintingStates[fHintingState].label); | 2019 title.prepend(gHintingStates[fHintingState].label); |
2020 | 2020 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2392 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2392 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2393 #endif | 2393 #endif |
2394 SkGraphics::Init(); | 2394 SkGraphics::Init(); |
2395 SkEvent::Init(); | 2395 SkEvent::Init(); |
2396 } | 2396 } |
2397 | 2397 |
2398 void application_term() { | 2398 void application_term() { |
2399 SkEvent::Term(); | 2399 SkEvent::Term(); |
2400 SkGraphics::Term(); | 2400 SkGraphics::Term(); |
2401 } | 2401 } |
OLD | NEW |