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 VulkanViewer_DEFINED | 8 #ifndef VulkanViewer_DEFINED |
9 #define VulkanViewer_DEFINED | 9 #define VulkanViewer_DEFINED |
10 | 10 |
11 #include "../Application.h" | 11 #include "../Application.h" |
12 #include "../Window.h" | 12 #include "../Window.h" |
13 #include "gm.h" | 13 #include "gm.h" |
| 14 #include "Slide.h" |
14 | 15 |
15 class SkCanvas; | 16 class SkCanvas; |
16 | 17 |
17 class VulkanViewer : public Application { | 18 class VulkanViewer : public Application { |
18 public: | 19 public: |
19 VulkanViewer(int argc, char** argv, void* platformData); | 20 VulkanViewer(int argc, char** argv, void* platformData); |
20 ~VulkanViewer() override; | 21 ~VulkanViewer() override; |
21 | 22 |
22 bool onKey(Window::Key key, Window::InputState state, uint32_t modifiers); | 23 bool onKey(Window::Key key, Window::InputState state, uint32_t modifiers); |
23 void onPaint(SkCanvas* canvas); | 24 void onPaint(SkCanvas* canvas); |
24 | 25 |
25 void onIdle(double ms) override; | 26 void onIdle(double ms) override; |
26 | 27 |
27 private: | 28 private: |
| 29 void initSlides(); |
| 30 |
28 void drawStats(SkCanvas* canvas); | 31 void drawStats(SkCanvas* canvas); |
29 | 32 |
30 Window* fWindow; | 33 Window* fWindow; |
31 | 34 |
32 static const int kMeasurementCount = 64; // should be power of 2 for fast m
od | 35 static const int kMeasurementCount = 64; // should be power of 2 for fast m
od |
33 double fMeasurements[kMeasurementCount]; | 36 double fMeasurements[kMeasurementCount]; |
34 int fCurrentMeasurement; | 37 int fCurrentMeasurement; |
35 | 38 |
36 const skiagm::GMRegistry* fGMs; | 39 SkTArray<sk_sp<Slide>> fSlides; |
| 40 int fCurrentSlide; |
37 }; | 41 }; |
38 | 42 |
39 | 43 |
40 #endif | 44 #endif |
OLD | NEW |