#include <emscripten.h>
#include <emscripten/bind.h>
#include "include/core/SkCanvas.h"
#include "include/core/SkSurface.h"
#include "tools/skui/InputState.h"
#include "tools/skui/ModifierKey.h"
#include "tools/viewer/SKPSlide.h"
#include "tools/viewer/SampleSlide.h"
#include "tools/viewer/SvgSlide.h"
#include <GLES3/gl3.h>
#include <string>
Go to the source code of this file.
◆ EMSCRIPTEN_BINDINGS()
EMSCRIPTEN_BINDINGS |
( |
Viewer |
| ) |
|
Definition at line 46 of file viewer_bindings.cpp.
46 {
50 class_<Slide>("Slide")
56 }))
59 enum_<skui::InputState>("InputState")
65 enum_<skui::ModifierKey>("ModifierKey")
72}
virtual bool onMouse(SkScalar x, SkScalar y, skui::InputState state, skui::ModifierKey modifiers)
virtual bool onChar(SkUnichar c)
virtual void load(SkScalar winWidth, SkScalar winHeight)
virtual bool animate(double nanos)
Dart_NativeFunction function
static sk_sp< Slide > MakeSlide(std::string name)
static sk_sp< Slide > MakeSkpSlide(std::string name, std::string skpData)
static sk_sp< Slide > MakeSvgSlide(std::string name, std::string svgText)
◆ MakeSkpSlide()
static sk_sp< Slide > MakeSkpSlide |
( |
std::string |
name, |
|
|
std::string |
skpData |
|
) |
| |
|
static |
Definition at line 34 of file viewer_bindings.cpp.
34 {
35 auto stream = std::make_unique<SkMemoryStream>(skpData.data(), skpData.size(),
36 true);
38}
DEF_SWITCHES_START aot vmservice shared library name
◆ MakeSlide()
static sk_sp< Slide > MakeSlide |
( |
std::string |
name | ) |
|
|
static |
Definition at line 22 of file viewer_bindings.cpp.
22 {
23 if (
name ==
"PathText") {
24 extern Sample* MakePathTextSample();
25 return sk_make_sp<SampleSlide>(MakePathTextSample);
26 }
27 if (
name ==
"TessellatedWedge") {
28 extern Sample* MakeTessellatedWedgeSample();
29 return sk_make_sp<SampleSlide>(MakeTessellatedWedgeSample);
30 }
31 return nullptr;
32}
◆ MakeSvgSlide()
static sk_sp< Slide > MakeSvgSlide |
( |
std::string |
name, |
|
|
std::string |
svgText |
|
) |
| |
|
static |
Definition at line 40 of file viewer_bindings.cpp.
40 {
41 auto stream = std::make_unique<SkMemoryStream>(svgText.data(), svgText.size(),
42 true);
44}