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

Side by Side Diff: tools/viewer/sk_app/CommandSet.cpp

Issue 2001153002: Move inval dedup to Window for wider usages. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 "CommandSet.h" 8 #include "CommandSet.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 19 matching lines...) Expand all
30 case kNone_HelpMode: 30 case kNone_HelpMode:
31 this->fHelpMode = kGrouped_HelpMode; 31 this->fHelpMode = kGrouped_HelpMode;
32 break; 32 break;
33 case kGrouped_HelpMode: 33 case kGrouped_HelpMode:
34 this->fHelpMode = kAlphabetical_HelpMode; 34 this->fHelpMode = kAlphabetical_HelpMode;
35 break; 35 break;
36 case kAlphabetical_HelpMode: 36 case kAlphabetical_HelpMode:
37 this->fHelpMode = kNone_HelpMode; 37 this->fHelpMode = kNone_HelpMode;
38 break; 38 break;
39 } 39 }
40 fWindow->inval(); 40 fWindow->checkAndInval();
41 }); 41 });
42 } 42 }
43 43
44 void CommandSet::attach(Window* window) { 44 void CommandSet::attach(Window* window) {
45 fWindow = window; 45 fWindow = window;
46 window->registerKeyFunc(on_key_handler, this); 46 window->registerKeyFunc(on_key_handler, this);
47 window->registerCharFunc(on_char_handler, this); 47 window->registerCharFunc(on_char_handler, this);
48 } 48 }
49 49
50 bool CommandSet::onKey(Window::Key key, Window::InputState state, uint32_t modif iers) { 50 bool CommandSet::onKey(Window::Key key, Window::InputState state, uint32_t modif iers) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 canvas->drawText(cmd.fKeyName.c_str(), cmd.fKeyName.size(), x, y, paint) ; 150 canvas->drawText(cmd.fKeyName.c_str(), cmd.fKeyName.size(), x, y, paint) ;
151 SkString text = SkStringPrintf(": %s", cmd.fDescription.c_str()); 151 SkString text = SkStringPrintf(": %s", cmd.fDescription.c_str());
152 canvas->drawText(text.c_str(), text.size(), x + keyWidth, y, paint); 152 canvas->drawText(text.c_str(), text.size(), x + keyWidth, y, paint);
153 y += paint.getTextSize() + 2; 153 y += paint.getTextSize() + 2;
154 } 154 }
155 } 155 }
156 156
157 } // namespace sk_app 157 } // namespace sk_app
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698