/* * Copyright 2020 Google LLC * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include #include #include "include/core/SkCanvas.h" #include "tools/viewer/SampleSlide.h" #include using namespace emscripten; EMSCRIPTEN_BINDINGS(Viewer) { function("MakeSlide", optional_override([](std::string name)->sk_sp { if (name == "WavyPathText") { extern Sample* MakeWavyPathTextSample(); return sk_make_sp(MakeWavyPathTextSample); } return nullptr; })); class_("Slide") .smart_ptr>("sk_sp") .function("load", &Slide::load) .function("animate", &Slide::animate) .function("draw", optional_override([](Slide& self, SkCanvas& canvas) { self.draw(&canvas); })); }