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

Unified Diff: tools/viewer/sk_app/Window.cpp

Issue 2004633002: Add drawer with state information (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/sk_app/Window.h ('k') | tools/viewer/sk_app/android/Window_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/Window.cpp
diff --git a/tools/viewer/sk_app/Window.cpp b/tools/viewer/sk_app/Window.cpp
index ba905e00f5e76148ab3da64296cbc489be88a1c5..1c798df399b7fecf9817a01fc157e477e28fcfb3 100644
--- a/tools/viewer/sk_app/Window.cpp
+++ b/tools/viewer/sk_app/Window.cpp
@@ -32,12 +32,16 @@ static bool default_touch_func(int owner, Window::InputState state, float x, flo
return false;
}
+static void default_ui_state_changed_func(
+ const SkString& stateName, const SkString& stateValue, void* userData) {}
+
static void default_paint_func(SkCanvas*, void* userData) {}
Window::Window() : fCharFunc(default_char_func)
, fKeyFunc(default_key_func)
, fMouseFunc(default_mouse_func)
, fTouchFunc(default_touch_func)
+ , fUIStateChangedFunc(default_ui_state_changed_func)
, fPaintFunc(default_paint_func) {
}
@@ -62,6 +66,10 @@ bool Window::onTouch(int owner, InputState state, float x, float y) {
return fTouchFunc(owner, state, x, y, fTouchUserData);
}
+void Window::onUIStateChanged(const SkString& stateName, const SkString& stateValue) {
+ return fUIStateChangedFunc(stateName, stateValue, fUIStateChangedUserData);
+}
+
void Window::onPaint() {
markInvalProcessed();
sk_sp<SkSurface> backbuffer = fWindowContext->getBackbufferSurface();
« no previous file with comments | « tools/viewer/sk_app/Window.h ('k') | tools/viewer/sk_app/android/Window_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698