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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool onTouch(intptr_t owner, sk_app::Window::InputState state, float x, floa
t y); | 28 bool onTouch(intptr_t owner, sk_app::Window::InputState state, float x, floa
t y); |
29 void onUIStateChanged(const SkString& stateName, const SkString& stateValue)
; | 29 void onUIStateChanged(const SkString& stateName, const SkString& stateValue)
; |
30 | 30 |
31 private: | 31 private: |
32 void initSlides(); | 32 void initSlides(); |
33 void updateTitle(); | 33 void updateTitle(); |
34 void setupCurrentSlide(int previousSlide); | 34 void setupCurrentSlide(int previousSlide); |
35 | 35 |
36 void updateUIState(); | 36 void updateUIState(); |
37 | 37 |
| 38 void drawSlide(SkCanvas* canvs, bool inSplitScreen); |
38 void drawStats(SkCanvas* canvas); | 39 void drawStats(SkCanvas* canvas); |
39 | 40 |
40 void changeZoomLevel(float delta); | 41 void changeZoomLevel(float delta); |
41 SkMatrix computeMatrix(); | 42 SkMatrix computeMatrix(); |
42 | 43 |
43 sk_app::Window* fWindow; | 44 sk_app::Window* fWindow; |
44 | 45 |
45 static const int kMeasurementCount = 64; // should be power of 2 for fast m
od | 46 static const int kMeasurementCount = 64; // should be power of 2 for fast m
od |
46 double fMeasurements[kMeasurementCount]; | 47 double fMeasurements[kMeasurementCount]; |
47 int fCurrentMeasurement; | 48 int fCurrentMeasurement; |
48 | 49 |
49 SkAnimTimer fAnimTimer; | 50 SkAnimTimer fAnimTimer; |
50 SkTArray<sk_sp<Slide>> fSlides; | 51 SkTArray<sk_sp<Slide>> fSlides; |
51 int fCurrentSlide; | 52 int fCurrentSlide; |
52 | 53 |
53 bool fDisplayStats; | 54 bool fDisplayStats; |
54 | 55 |
| 56 // whether to split the screen and draw two copies of the slide, one with sR
GB and one without |
| 57 bool fSplitScreen; |
| 58 |
55 sk_app::Window::BackendType fBackendType; | 59 sk_app::Window::BackendType fBackendType; |
56 | 60 |
57 // transform data | 61 // transform data |
58 SkScalar fZoomCenterX; | 62 SkScalar fZoomCenterX; |
59 SkScalar fZoomCenterY; | 63 SkScalar fZoomCenterY; |
60 SkScalar fZoomLevel; | 64 SkScalar fZoomLevel; |
61 SkScalar fZoomScale; | 65 SkScalar fZoomScale; |
62 | 66 |
63 sk_app::CommandSet fCommands; | 67 sk_app::CommandSet fCommands; |
64 | 68 |
65 SkTouchGesture fGesture; | 69 SkTouchGesture fGesture; |
66 | 70 |
67 // identity unless the window initially scales the content to fit the screen
. | 71 // identity unless the window initially scales the content to fit the screen
. |
68 SkMatrix fDefaultMatrix; | 72 SkMatrix fDefaultMatrix; |
69 SkMatrix fDefaultMatrixInv; | 73 SkMatrix fDefaultMatrixInv; |
70 | 74 |
71 Json::Value fAllSlideNames; // cache all slide names for fast upd
ateUIState | 75 Json::Value fAllSlideNames; // cache all slide names for fast upd
ateUIState |
72 }; | 76 }; |
73 | 77 |
74 | 78 |
75 #endif | 79 #endif |
OLD | NEW |