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

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

Issue 2047443002: Use intptr_t for onTouch argument. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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 | « tools/viewer/sk_app/Window.h ('k') | 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 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 "Window.h" 8 #include "Window.h"
9 9
10 #include "SkSurface.h" 10 #include "SkSurface.h"
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "VulkanWindowContext.h" 12 #include "VulkanWindowContext.h"
13 13
14 namespace sk_app { 14 namespace sk_app {
15 15
16 static bool default_char_func(SkUnichar c, uint32_t modifiers, void* userData) { 16 static bool default_char_func(SkUnichar c, uint32_t modifiers, void* userData) {
17 return false; 17 return false;
18 } 18 }
19 19
20 static bool default_key_func(Window::Key key, Window::InputState state, uint32_t modifiers, 20 static bool default_key_func(Window::Key key, Window::InputState state, uint32_t modifiers,
21 void* userData) { 21 void* userData) {
22 return false; 22 return false;
23 } 23 }
24 24
25 static bool default_mouse_func(int x, int y, Window::InputState state, uint32_t modifiers, 25 static bool default_mouse_func(int x, int y, Window::InputState state, uint32_t modifiers,
26 void* userData) { 26 void* userData) {
27 return false; 27 return false;
28 } 28 }
29 29
30 static bool default_touch_func(int owner, Window::InputState state, float x, flo at y, 30 static bool default_touch_func(intptr_t owner, Window::InputState state, float x , float y,
31 void* userData) { 31 void* userData) {
32 return false; 32 return false;
33 } 33 }
34 34
35 static void default_ui_state_changed_func( 35 static void default_ui_state_changed_func(
36 const SkString& stateName, const SkString& stateValue, void* userData) { } 36 const SkString& stateName, const SkString& stateValue, void* userData) { }
37 37
38 static void default_paint_func(SkCanvas*, void* userData) {} 38 static void default_paint_func(SkCanvas*, void* userData) {}
39 39
40 Window::Window() : fCharFunc(default_char_func) 40 Window::Window() : fCharFunc(default_char_func)
(...skipping 14 matching lines...) Expand all
55 } 55 }
56 56
57 bool Window::onKey(Key key, InputState state, uint32_t modifiers) { 57 bool Window::onKey(Key key, InputState state, uint32_t modifiers) {
58 return fKeyFunc(key, state, modifiers, fKeyUserData); 58 return fKeyFunc(key, state, modifiers, fKeyUserData);
59 } 59 }
60 60
61 bool Window::onMouse(int x, int y, InputState state, uint32_t modifiers) { 61 bool Window::onMouse(int x, int y, InputState state, uint32_t modifiers) {
62 return fMouseFunc(x, y, state, modifiers, fMouseUserData); 62 return fMouseFunc(x, y, state, modifiers, fMouseUserData);
63 } 63 }
64 64
65 bool Window::onTouch(int owner, InputState state, float x, float y) { 65 bool Window::onTouch(intptr_t owner, InputState state, float x, float y) {
66 return fTouchFunc(owner, state, x, y, fTouchUserData); 66 return fTouchFunc(owner, state, x, y, fTouchUserData);
67 } 67 }
68 68
69 void Window::onUIStateChanged(const SkString& stateName, const SkString& stateVa lue) { 69 void Window::onUIStateChanged(const SkString& stateName, const SkString& stateVa lue) {
70 return fUIStateChangedFunc(stateName, stateValue, fUIStateChangedUserData); 70 return fUIStateChangedFunc(stateName, stateValue, fUIStateChangedUserData);
71 } 71 }
72 72
73 void Window::onPaint() { 73 void Window::onPaint() {
74 markInvalProcessed(); 74 markInvalProcessed();
75 sk_sp<SkSurface> backbuffer = fWindowContext->getBackbufferSurface(); 75 sk_sp<SkSurface> backbuffer = fWindowContext->getBackbufferSurface();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 fIsContentInvalidated = true; 107 fIsContentInvalidated = true;
108 onInval(); 108 onInval();
109 } 109 }
110 } 110 }
111 111
112 void Window::markInvalProcessed() { 112 void Window::markInvalProcessed() {
113 fIsContentInvalidated = false; 113 fIsContentInvalidated = false;
114 } 114 }
115 115
116 } // namespace sk_app 116 } // namespace sk_app
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/Window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698