Flutter Engine
The Flutter Engine
SkSLSlide.h
Go to the documentation of this file.
1/*
2* Copyright 2019 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 SkSLSlide_DEFINED
9#define SkSLSlide_DEFINED
10
11#include "include/core/SkM44.h"
19#include "tools/viewer/Slide.h"
20
21#include <utility>
22
23class SkCanvas;
24
25namespace skui {
26enum class InputState;
27enum class ModifierKey;
28} // namespace sk
29
30class SkSLSlide : public Slide {
31public:
32 SkSLSlide();
33
34 void draw(SkCanvas* canvas) override;
35 bool animate(double nanos) override;
36
37 void resize(SkScalar winWidth, SkScalar winHeight) override {
38 fResolution = { winWidth, winHeight, 1.0f };
39 }
40 void load(SkScalar winWidth, SkScalar winHeight) override;
41 void unload() override;
42
44 skui::ModifierKey modifiers) override { return true; }
45
46private:
47 bool rebuild();
48
49 SkString fSkSL;
50 bool fCodeIsDirty;
54 float fSeconds = 0.0f;
55
56 enum Geometry {
57 kFill,
58 kCircle,
59 kRoundRect,
60 kCapsule,
61 kText,
62 };
63 int fGeometry = kFill;
64 SkV3 fResolution = { 1, 1, 1 };
65 SkV4 fMousePos;
66 int fTraceCoord[2] = {64, 64};
67 bool fShadertoyUniforms = true;
68
69 // Named shaders that can be selected as inputs
71};
72
73#endif
void unload() override
Definition: SkSLSlide.cpp:97
void resize(SkScalar winWidth, SkScalar winHeight) override
Definition: SkSLSlide.h:37
bool onMouse(SkScalar x, SkScalar y, skui::InputState state, skui::ModifierKey modifiers) override
Definition: SkSLSlide.h:43
bool animate(double nanos) override
Definition: SkSLSlide.cpp:350
void load(SkScalar winWidth, SkScalar winHeight) override
Definition: SkSLSlide.cpp:72
void draw(SkCanvas *canvas) override
Definition: SkSLSlide.cpp:146
Definition: Slide.h:29
float SkScalar
Definition: extension.cpp:12
AtkStateType state
double y
double x
InputState
Definition: InputState.h:6
ModifierKey
Definition: ModifierKey.h:9
Definition: SkM44.h:56
Definition: SkM44.h:98