OLD | NEW |
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 #ifndef Viewer_DEFINED | 8 #ifndef Viewer_DEFINED |
9 #define Viewer_DEFINED | 9 #define Viewer_DEFINED |
10 | 10 |
11 #include "sk_app/Application.h" | 11 #include "sk_app/Application.h" |
12 #include "sk_app/CommandSet.h" | 12 #include "sk_app/CommandSet.h" |
13 #include "sk_app/Window.h" | 13 #include "sk_app/Window.h" |
14 #include "gm.h" | 14 #include "gm.h" |
15 #include "SkAnimTimer.h" | 15 #include "SkAnimTimer.h" |
16 #include "Slide.h" | 16 #include "Slide.h" |
17 | 17 |
18 class SkCanvas; | 18 class SkCanvas; |
19 | 19 |
20 class Viewer : public sk_app::Application { | 20 class Viewer : public sk_app::Application { |
21 public: | 21 public: |
22 Viewer(int argc, char** argv, void* platformData); | 22 Viewer(int argc, char** argv, void* platformData); |
23 ~Viewer() override; | 23 ~Viewer() override; |
24 | 24 |
25 void onPaint(SkCanvas* canvas); | 25 void onPaint(SkCanvas* canvas); |
26 void onIdle(double ms) override; | 26 void onIdle(double ms) override; |
27 bool onTouch(int owner, sk_app::Window::InputState state, float x, float y); | 27 bool onTouch(intptr_t owner, sk_app::Window::InputState state, float x, floa
t y); |
28 void onUIStateChanged(const SkString& stateName, const SkString& stateValue)
; | 28 void onUIStateChanged(const SkString& stateName, const SkString& stateValue)
; |
29 | 29 |
30 private: | 30 private: |
31 void initSlides(); | 31 void initSlides(); |
32 void updateTitle(); | 32 void updateTitle(); |
33 void setupCurrentSlide(int previousSlide); | 33 void setupCurrentSlide(int previousSlide); |
34 | 34 |
35 void updateUIState(); | 35 void updateUIState(); |
36 | 36 |
37 void drawStats(SkCanvas* canvas); | 37 void drawStats(SkCanvas* canvas); |
(...skipping 25 matching lines...) Expand all Loading... |
63 | 63 |
64 SkTouchGesture fGesture; | 64 SkTouchGesture fGesture; |
65 | 65 |
66 // identity unless the window initially scales the content to fit the screen
. | 66 // identity unless the window initially scales the content to fit the screen
. |
67 SkMatrix fDefaultMatrix; | 67 SkMatrix fDefaultMatrix; |
68 SkMatrix fDefaultMatrixInv; | 68 SkMatrix fDefaultMatrixInv; |
69 }; | 69 }; |
70 | 70 |
71 | 71 |
72 #endif | 72 #endif |
OLD | NEW |