| 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/Window.h" | 13 #include "sk_app/Window.h" |
| 13 #include "gm.h" | 14 #include "gm.h" |
| 14 #include "SkAnimTimer.h" | 15 #include "SkAnimTimer.h" |
| 15 #include "Slide.h" | 16 #include "Slide.h" |
| 16 | 17 |
| 17 class SkCanvas; | 18 class SkCanvas; |
| 18 | 19 |
| 19 class Viewer : public sk_app::Application { | 20 class Viewer : public sk_app::Application { |
| 20 public: | 21 public: |
| 21 Viewer(int argc, char** argv, void* platformData); | 22 Viewer(int argc, char** argv, void* platformData); |
| 22 ~Viewer() override; | 23 ~Viewer() override; |
| 23 | 24 |
| 24 bool onKey(sk_app::Window::Key key, sk_app::Window::InputState state, uint32
_t modifiers); | |
| 25 bool onChar(SkUnichar, uint32_t modifiers); | |
| 26 void onPaint(SkCanvas* canvas); | 25 void onPaint(SkCanvas* canvas); |
| 27 void onIdle(double ms) override; | 26 void onIdle(double ms) override; |
| 28 | 27 |
| 29 private: | 28 private: |
| 30 void initSlides(); | 29 void initSlides(); |
| 31 void updateTitle(); | 30 void updateTitle(); |
| 32 void setupCurrentSlide(int previousSlide); | 31 void setupCurrentSlide(int previousSlide); |
| 33 | 32 |
| 34 void drawStats(SkCanvas* canvas); | 33 void drawStats(SkCanvas* canvas); |
| 35 | 34 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 48 | 47 |
| 49 bool fDisplayStats; | 48 bool fDisplayStats; |
| 50 | 49 |
| 51 // transform data | 50 // transform data |
| 52 SkMatrix fLocalMatrix; | 51 SkMatrix fLocalMatrix; |
| 53 SkScalar fZoomCenterX; | 52 SkScalar fZoomCenterX; |
| 54 SkScalar fZoomCenterY; | 53 SkScalar fZoomCenterY; |
| 55 SkScalar fZoomLevel; | 54 SkScalar fZoomLevel; |
| 56 SkScalar fZoomScale; | 55 SkScalar fZoomScale; |
| 57 | 56 |
| 57 sk_app::CommandSet fCommands; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 | 60 |
| 61 #endif | 61 #endif |
| OLD | NEW |