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 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 switch (str[i]) { | 1678 switch (str[i]) { |
1679 case ':': str[i] = '-'; break; | 1679 case ':': str[i] = '-'; break; |
1680 case '/': str[i] = '-'; break; | 1680 case '/': str[i] = '-'; break; |
1681 case ' ': str[i] = '_'; break; | 1681 case ' ': str[i] = '_'; break; |
1682 default: break; | 1682 default: break; |
1683 } | 1683 } |
1684 } | 1684 } |
1685 } | 1685 } |
1686 #endif | 1686 #endif |
1687 | 1687 |
| 1688 namespace sk_tool_utils { |
| 1689 extern bool gEnablePortableTypeface; |
| 1690 }; |
| 1691 |
1688 bool SampleWindow::onHandleChar(SkUnichar uni) { | 1692 bool SampleWindow::onHandleChar(SkUnichar uni) { |
1689 { | 1693 { |
1690 SkView* view = curr_view(this); | 1694 SkView* view = curr_view(this); |
1691 if (view) { | 1695 if (view) { |
1692 SkEvent evt(gCharEvtName); | 1696 SkEvent evt(gCharEvtName); |
1693 evt.setFast32(uni); | 1697 evt.setFast32(uni); |
1694 if (view->doQuery(&evt)) { | 1698 if (view->doQuery(&evt)) { |
1695 return true; | 1699 return true; |
1696 } | 1700 } |
1697 } | 1701 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1731 post_event_to_sink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox"))
, curr_view(this)); | 1735 post_event_to_sink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox"))
, curr_view(this)); |
1732 // Cannot call updateTitle() synchronously, because the toggleBBox e
vent is still in | 1736 // Cannot call updateTitle() synchronously, because the toggleBBox e
vent is still in |
1733 // the queue. | 1737 // the queue. |
1734 post_event_to_sink(SkNEW_ARGS(SkEvent, (gUpdateWindowTitleEvtName)),
this); | 1738 post_event_to_sink(SkNEW_ARGS(SkEvent, (gUpdateWindowTitleEvtName)),
this); |
1735 this->inval(NULL); | 1739 this->inval(NULL); |
1736 break; | 1740 break; |
1737 case 'f': | 1741 case 'f': |
1738 // only | 1742 // only |
1739 toggleFPS(); | 1743 toggleFPS(); |
1740 break; | 1744 break; |
| 1745 case 'F': |
| 1746 sk_tool_utils::gEnablePortableTypeface ^= true; |
| 1747 this->inval(NULL); |
| 1748 break; |
1741 case 'g': | 1749 case 'g': |
1742 fRequestGrabImage = true; | 1750 fRequestGrabImage = true; |
1743 this->inval(NULL); | 1751 this->inval(NULL); |
1744 break; | 1752 break; |
1745 case 'G': | 1753 case 'G': |
1746 gShowGMBounds = !gShowGMBounds; | 1754 gShowGMBounds = !gShowGMBounds; |
1747 post_event_to_sink(GMSampleView::NewShowSizeEvt(gShowGMBounds), | 1755 post_event_to_sink(GMSampleView::NewShowSizeEvt(gShowGMBounds), |
1748 curr_view(this)); | 1756 curr_view(this)); |
1749 this->inval(NULL); | 1757 this->inval(NULL); |
1750 break; | 1758 break; |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 SkGraphics::Init(); | 2425 SkGraphics::Init(); |
2418 SkEvent::Init(); | 2426 SkEvent::Init(); |
2419 } | 2427 } |
2420 | 2428 |
2421 // FIXME: this should be in a header | 2429 // FIXME: this should be in a header |
2422 void application_term(); | 2430 void application_term(); |
2423 void application_term() { | 2431 void application_term() { |
2424 SkEvent::Term(); | 2432 SkEvent::Term(); |
2425 SkGraphics::Term(); | 2433 SkGraphics::Term(); |
2426 } | 2434 } |
OLD | NEW |