2016-04-06 13:08:59 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VulkanViewer_DEFINED
|
|
|
|
#define VulkanViewer_DEFINED
|
|
|
|
|
|
|
|
#include "../Application.h"
|
|
|
|
#include "../Window.h"
|
|
|
|
#include "gm.h"
|
2016-04-08 14:24:09 +00:00
|
|
|
#include "Slide.h"
|
2016-04-06 13:08:59 +00:00
|
|
|
|
|
|
|
class SkCanvas;
|
|
|
|
|
|
|
|
class VulkanViewer : public Application {
|
|
|
|
public:
|
|
|
|
VulkanViewer(int argc, char** argv, void* platformData);
|
|
|
|
~VulkanViewer() override;
|
|
|
|
|
2016-04-06 19:08:51 +00:00
|
|
|
bool onKey(Window::Key key, Window::InputState state, uint32_t modifiers);
|
2016-04-06 13:08:59 +00:00
|
|
|
void onPaint(SkCanvas* canvas);
|
|
|
|
|
2016-04-07 18:09:51 +00:00
|
|
|
void onIdle(double ms) override;
|
2016-04-06 13:08:59 +00:00
|
|
|
|
|
|
|
private:
|
2016-04-08 14:24:09 +00:00
|
|
|
void initSlides();
|
|
|
|
|
2016-04-07 18:09:51 +00:00
|
|
|
void drawStats(SkCanvas* canvas);
|
|
|
|
|
2016-04-06 13:08:59 +00:00
|
|
|
Window* fWindow;
|
|
|
|
|
2016-04-07 18:09:51 +00:00
|
|
|
static const int kMeasurementCount = 64; // should be power of 2 for fast mod
|
|
|
|
double fMeasurements[kMeasurementCount];
|
|
|
|
int fCurrentMeasurement;
|
|
|
|
|
2016-04-08 14:24:09 +00:00
|
|
|
SkTArray<sk_sp<Slide>> fSlides;
|
|
|
|
int fCurrentSlide;
|
2016-04-06 13:08:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|