Brian Osman | d927bd2 | 2019-12-18 11:23:12 -0500 | [diff] [blame^] | 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 "tools/viewer/Slide.h" |
| 12 | |
| 13 | #include "src/core/SkRuntimeEffect.h" |
| 14 | |
| 15 | class SkSLSlide : public Slide { |
| 16 | public: |
| 17 | SkSLSlide(); |
| 18 | |
| 19 | // TODO: We need a way for primarily interactive slides to always be as large as the window |
| 20 | SkISize getDimensions() const override { return SkISize::MakeEmpty(); } |
| 21 | |
| 22 | void draw(SkCanvas* canvas) override; |
| 23 | |
| 24 | bool rebuild(); |
| 25 | |
| 26 | private: |
| 27 | SkString fSkSL; |
| 28 | sk_sp<SkRuntimeEffect> fEffect; |
| 29 | SkAutoTMalloc<char> fInputs; |
| 30 | }; |
| 31 | |
| 32 | #endif |