blob: bb9fa3e9f49a555fcb4fbbb4615d1f2347395aa9 [file] [log] [blame]
Brian Salomon06c9e292021-04-29 14:10:23 -04001/*
2 * Copyright 2021 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef MSKPSlide_DEFINED
9#define MSKPSlide_DEFINED
10
11#include "tools/MSKPPlayer.h"
12#include "tools/viewer/Slide.h"
13
14class SkStreamSeekable;
15
16class MSKPSlide : public Slide {
17public:
18 MSKPSlide(const SkString& name, const SkString& path);
19 MSKPSlide(const SkString& name, std::unique_ptr<SkStreamSeekable>);
20
21 SkISize getDimensions() const override;
22
23 void draw(SkCanvas* canvas) override;
24 bool animate(double nanos) override;
25 void load(SkScalar winWidth, SkScalar winHeight) override;
26 void unload() override;
27 void gpuTeardown() override;
28
29private:
30 std::unique_ptr<SkStreamSeekable> fStream;
Brian Salomon0bc48222021-04-23 19:14:02 -040031 std::unique_ptr<MSKPPlayer> fPlayer;
32
33 int fFrame = 0;
34 int fFPS = 15;
35 bool fPaused = false;
36 double fLastFrameTime = -1;
Brian Salomon06c9e292021-04-29 14:10:23 -040037
38 using INHERITED = Slide;
39};
40
41#endif