Flutter Engine
The Flutter Engine
Classes | Enumerations | Functions
Skwasm Namespace Reference

Classes

struct  FlutterFontCollection
 
class  Surface
 
struct  SurfaceWrapper
 
class  TextureSourceWrapper
 

Enumerations

enum class  FilterQuality { none , low , medium , high }
 
enum class  ImageByteFormat { rawRgba , rawStraightRgba , rawUnmodified , png }
 

Functions

SkMatrix createMatrix (const SkScalar *f)
 
SkRRect createRRect (const SkScalar *f)
 
SkFilterMode filterModeForQuality (FilterQuality quality)
 
SkSamplingOptions samplingOptionsForQuality (FilterQuality quality)
 
void makeCurrent (EMSCRIPTEN_WEBGL_CONTEXT_HANDLE handle)
 

Enumeration Type Documentation

◆ FilterQuality

enum class Skwasm::FilterQuality
strong
Enumerator
none 
low 
medium 
high 

Definition at line 29 of file helpers.h.

◆ ImageByteFormat

enum class Skwasm::ImageByteFormat
strong
Enumerator
rawRgba 
rawStraightRgba 
rawUnmodified 
png 

Definition at line 30 of file surface.h.

Function Documentation

◆ createMatrix()

SkMatrix Skwasm::createMatrix ( const SkScalar f)
inline

Definition at line 14 of file helpers.h.

14 {
15 return SkMatrix::MakeAll(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7],
16 f[8]);
17}
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
Definition: SkMatrix.h:179

◆ createRRect()

SkRRect Skwasm::createRRect ( const SkScalar f)
inline

Definition at line 19 of file helpers.h.

19 {
20 const SkRect* rect = reinterpret_cast<const SkRect*>(f);
21 const SkVector* radiiValues = reinterpret_cast<const SkVector*>(f + 4);
22
23 SkRRect rr;
24 rr.setRectRadii(*rect, radiiValues);
25 return rr;
26}
void setRectRadii(const SkRect &rect, const SkVector radii[4])
Definition: SkRRect.cpp:189
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ filterModeForQuality()

SkFilterMode Skwasm::filterModeForQuality ( FilterQuality  quality)
inline

Definition at line 36 of file helpers.h.

36 {
37 switch (quality) {
38 case FilterQuality::none:
39 case FilterQuality::low:
41 case FilterQuality::medium:
42 case FilterQuality::high:
44 }
45}

◆ makeCurrent()

void Skwasm::makeCurrent ( EMSCRIPTEN_WEBGL_CONTEXT_HANDLE  handle)
inline

Definition at line 22 of file wrappers.h.

22 {
23 if (!handle)
24 return;
25
26 int result = emscripten_webgl_make_context_current(handle);
27 if (result != EMSCRIPTEN_RESULT_SUCCESS) {
28 printf("make_context failed: %d", result);
29 }
30}
GAsyncResult * result
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: SkSLString.cpp:83

◆ samplingOptionsForQuality()

SkSamplingOptions Skwasm::samplingOptionsForQuality ( FilterQuality  quality)
inline

Definition at line 47 of file helpers.h.

47 {
48 switch (quality) {
49 case FilterQuality::none:
51 case FilterQuality::low:
53 case FilterQuality::medium:
55 case FilterQuality::high:
56 // Cubic equation coefficients recommended by Mitchell & Netravali
57 // in their paper on cubic interpolation.
59 }
60}
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkCubicResampler Mitchell()