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 15 matching lines...) Expand all Loading... |
26 void onIdle(double ms) override; | 26 void onIdle(double ms) override; |
27 | 27 |
28 private: | 28 private: |
29 void initSlides(); | 29 void initSlides(); |
30 void updateTitle(); | 30 void updateTitle(); |
31 void setupCurrentSlide(int previousSlide); | 31 void setupCurrentSlide(int previousSlide); |
32 | 32 |
33 void drawStats(SkCanvas* canvas); | 33 void drawStats(SkCanvas* canvas); |
34 | 34 |
35 void changeZoomLevel(float delta); | 35 void changeZoomLevel(float delta); |
36 void updateMatrix(); | 36 SkMatrix computeMatrix(); |
37 | 37 |
38 sk_app::Window* fWindow; | 38 sk_app::Window* fWindow; |
39 | 39 |
40 static const int kMeasurementCount = 64; // should be power of 2 for fast m
od | 40 static const int kMeasurementCount = 64; // should be power of 2 for fast m
od |
41 double fMeasurements[kMeasurementCount]; | 41 double fMeasurements[kMeasurementCount]; |
42 int fCurrentMeasurement; | 42 int fCurrentMeasurement; |
43 | 43 |
44 SkAnimTimer fAnimTimer; | 44 SkAnimTimer fAnimTimer; |
45 SkTArray<sk_sp<Slide>> fSlides; | 45 SkTArray<sk_sp<Slide>> fSlides; |
46 int fCurrentSlide; | 46 int fCurrentSlide; |
47 | 47 |
48 bool fDisplayStats; | 48 bool fDisplayStats; |
49 | 49 |
50 // transform data | 50 // transform data |
51 SkMatrix fLocalMatrix; | |
52 SkScalar fZoomCenterX; | 51 SkScalar fZoomCenterX; |
53 SkScalar fZoomCenterY; | 52 SkScalar fZoomCenterY; |
54 SkScalar fZoomLevel; | 53 SkScalar fZoomLevel; |
55 SkScalar fZoomScale; | 54 SkScalar fZoomScale; |
56 | 55 |
57 sk_app::CommandSet fCommands; | 56 sk_app::CommandSet fCommands; |
58 }; | 57 }; |
59 | 58 |
60 | 59 |
61 #endif | 60 #endif |
OLD | NEW |