blob: 4287c398b9dd56189c167d655e3a0489f8e3e68f [file] [log] [blame]
* Copyright 2019 Google LLC
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef SkSLSlide_DEFINED
#define SkSLSlide_DEFINED
#include "tools/viewer/Slide.h"
#include "include/effects/SkRuntimeEffect.h"
class SkSLSlide : public Slide {
// TODO: We need a way for primarily interactive slides to always be as large as the window
SkISize getDimensions() const override { return SkISize::MakeEmpty(); }
void draw(SkCanvas* canvas) override;
void load(SkScalar winWidth, SkScalar winHeight) override;
void unload() override;
bool rebuild();
SkString fSkSL;
bool fCodeIsDirty;
sk_sp<SkRuntimeEffect> fEffect;
SkAutoTMalloc<char> fInputs;
SkTArray<sk_sp<SkShader>> fChildren;
// Named shaders that can be selected as inputs
SkTArray<std::pair<const char*, sk_sp<SkShader>>> fShaders;