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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 112903002: Fix SampleApp BBH shortcut collision. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 #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 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 for (size_t i = 0; i < name->size(); i++) { 1823 for (size_t i = 0; i < name->size(); i++) {
1824 switch (str[i]) { 1824 switch (str[i]) {
1825 case ':': str[i] = '-'; break; 1825 case ':': str[i] = '-'; break;
1826 case '/': str[i] = '-'; break; 1826 case '/': str[i] = '-'; break;
1827 case ' ': str[i] = '_'; break; 1827 case ' ': str[i] = '_'; break;
1828 default: break; 1828 default: break;
1829 } 1829 }
1830 } 1830 }
1831 } 1831 }
1832 #endif 1832 #endif
1833 1833
robertphillips 2013/12/11 16:23:10 Is there any more commented out code that tries to
f(malita) 2013/12/11 16:45:50 Nope, I checked.
1834 //extern bool gIgnoreFastBlurRect;
1835
1836 bool SampleWindow::onHandleChar(SkUnichar uni) { 1834 bool SampleWindow::onHandleChar(SkUnichar uni) {
1837 { 1835 {
1838 SkView* view = curr_view(this); 1836 SkView* view = curr_view(this);
1839 if (view) { 1837 if (view) {
1840 SkEvent evt(gCharEvtName); 1838 SkEvent evt(gCharEvtName);
1841 evt.setFast32(uni); 1839 evt.setFast32(uni);
1842 if (view->doQuery(&evt)) { 1840 if (view->doQuery(&evt)) {
1843 return true; 1841 return true;
1844 } 1842 }
1845 } 1843 }
(...skipping 22 matching lines...) Expand all
1868 fScrollTestX = fScrollTestY = 0; 1866 fScrollTestX = fScrollTestY = 0;
1869 } else { 1867 } else {
1870 fScrollTestX += dx; 1868 fScrollTestX += dx;
1871 fScrollTestY += dy; 1869 fScrollTestY += dy;
1872 } 1870 }
1873 this->inval(NULL); 1871 this->inval(NULL);
1874 return true; 1872 return true;
1875 } 1873 }
1876 1874
1877 switch (uni) { 1875 switch (uni) {
1878 case 'b': 1876 case 'B':
1879 {
1880 postEventToSink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), c urr_view(this)); 1877 postEventToSink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), c urr_view(this));
1881 this->updateTitle(); 1878 // Cannot call updateTitle() synchronously, because the toggleBBox e vent is still in
1879 // the queue.
robertphillips 2013/12/11 16:23:10 SkNEW_ARGS? Shouldn't this be post_event_to_sink e
f(malita) 2013/12/11 16:45:50 Done.
robertphillips 2013/12/11 16:47:30 I meant just change the name since it is a global
1880 postEventToSink(new SkEvent(gUpdateWindowTitleEvtName), this);
1882 this->inval(NULL); 1881 this->inval(NULL);
1883 break; 1882 break;
1884 }
1885 case 'B':
1886 // gIgnoreFastBlurRect = !gIgnoreFastBlurRect;
1887 this->inval(NULL);
1888 break;
1889
1890 case 'f': 1883 case 'f':
1891 // only 1884 // only
1892 toggleFPS(); 1885 toggleFPS();
1893 break; 1886 break;
1894 case 'g': 1887 case 'g':
1895 fRequestGrabImage = true; 1888 fRequestGrabImage = true;
1896 this->inval(NULL); 1889 this->inval(NULL);
1897 break; 1890 break;
1898 case 'G': 1891 case 'G':
1899 gShowGMBounds = !gShowGMBounds; 1892 gShowGMBounds = !gShowGMBounds;
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 SkGraphics::Init(); 2616 SkGraphics::Init();
2624 SkEvent::Init(); 2617 SkEvent::Init();
2625 } 2618 }
2626 2619
2627 // FIXME: this should be in a header 2620 // FIXME: this should be in a header
2628 void application_term(); 2621 void application_term();
2629 void application_term() { 2622 void application_term() {
2630 SkEvent::Term(); 2623 SkEvent::Term();
2631 SkGraphics::Term(); 2624 SkGraphics::Term();
2632 } 2625 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698