xref: /aosp_15_r20/external/skia/tools/viewer/SvgSlide.h (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 /*
2  * Copyright 2018 Google Inc.
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 SvgSlide_DEFINED
9 #define SvgSlide_DEFINED
10 
11 #include "include/core/SkRefCnt.h"
12 #include "include/core/SkScalar.h"
13 #include "include/core/SkString.h"
14 #include "tools/viewer/Slide.h"
15 
16 class SkCanvas;
17 class SkSVGDOM;
18 
19 class SvgSlide final : public Slide {
20 public:
21     SvgSlide(const SkString& name, const SkString& path);
22     ~SvgSlide() override;
23 
24     void load(SkScalar winWidth, SkScalar winHeight) override;
25     void unload() override;
26     void resize(SkScalar, SkScalar) override;
27 
28     void draw(SkCanvas*) override;
29 private:
30     const SkString  fPath;
31 
32     sk_sp<SkSVGDOM> fDom;
33 };
34 
35 #endif // SvgSlide_DEFINED
36