Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Side by Side Diff: samplecode/SampleApp.cpp

Issue 407183003: add portable and canonical font support for DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add atexit; rename to create_... Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | src/fonts/SkTestScalerContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 switch (str[i]) { 1654 switch (str[i]) {
1655 case ':': str[i] = '-'; break; 1655 case ':': str[i] = '-'; break;
1656 case '/': str[i] = '-'; break; 1656 case '/': str[i] = '-'; break;
1657 case ' ': str[i] = '_'; break; 1657 case ' ': str[i] = '_'; break;
1658 default: break; 1658 default: break;
1659 } 1659 }
1660 } 1660 }
1661 } 1661 }
1662 #endif 1662 #endif
1663 1663
1664 namespace sk_tool_utils { 1664 DECLARE_bool(portableFonts);
1665 extern bool gEnablePortableTypeface;
1666 };
1667 1665
1668 bool SampleWindow::onHandleChar(SkUnichar uni) { 1666 bool SampleWindow::onHandleChar(SkUnichar uni) {
1669 { 1667 {
1670 SkView* view = curr_view(this); 1668 SkView* view = curr_view(this);
1671 if (view) { 1669 if (view) {
1672 SkEvent evt(gCharEvtName); 1670 SkEvent evt(gCharEvtName);
1673 evt.setFast32(uni); 1671 evt.setFast32(uni);
1674 if (view->doQuery(&evt)) { 1672 if (view->doQuery(&evt)) {
1675 return true; 1673 return true;
1676 } 1674 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 // Cannot call updateTitle() synchronously, because the toggleBBox e vent is still in 1710 // Cannot call updateTitle() synchronously, because the toggleBBox e vent is still in
1713 // the queue. 1711 // the queue.
1714 post_event_to_sink(SkNEW_ARGS(SkEvent, (gUpdateWindowTitleEvtName)), this); 1712 post_event_to_sink(SkNEW_ARGS(SkEvent, (gUpdateWindowTitleEvtName)), this);
1715 this->inval(NULL); 1713 this->inval(NULL);
1716 break; 1714 break;
1717 case 'f': 1715 case 'f':
1718 // only 1716 // only
1719 toggleFPS(); 1717 toggleFPS();
1720 break; 1718 break;
1721 case 'F': 1719 case 'F':
1722 sk_tool_utils::gEnablePortableTypeface ^= true; 1720 FLAGS_portableFonts ^= true;
1723 this->inval(NULL); 1721 this->inval(NULL);
1724 break; 1722 break;
1725 case 'g': 1723 case 'g':
1726 fRequestGrabImage = true; 1724 fRequestGrabImage = true;
1727 this->inval(NULL); 1725 this->inval(NULL);
1728 break; 1726 break;
1729 case 'G': 1727 case 'G':
1730 gShowGMBounds = !gShowGMBounds; 1728 gShowGMBounds = !gShowGMBounds;
1731 post_event_to_sink(GMSampleView::NewShowSizeEvt(gShowGMBounds), 1729 post_event_to_sink(GMSampleView::NewShowSizeEvt(gShowGMBounds),
1732 curr_view(this)); 1730 curr_view(this));
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 setenv("ANDROID_ROOT", "/android/device/data", 0); 2396 setenv("ANDROID_ROOT", "/android/device/data", 0);
2399 #endif 2397 #endif
2400 SkGraphics::Init(); 2398 SkGraphics::Init();
2401 SkEvent::Init(); 2399 SkEvent::Init();
2402 } 2400 }
2403 2401
2404 void application_term() { 2402 void application_term() {
2405 SkEvent::Term(); 2403 SkEvent::Term();
2406 SkGraphics::Term(); 2404 SkGraphics::Term();
2407 } 2405 }
OLDNEW
« no previous file with comments | « gyp/tools.gyp ('k') | src/fonts/SkTestScalerContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698