1043 {
1044#ifdef ENABLE_GPU
1045 constant("gpu", true);
1047#endif
1048
1049#ifdef CK_ENABLE_WEBGL
1050 constant("webgl", true);
1055#endif
1056
1057#ifdef CK_ENABLE_WEBGPU
1058 constant("webgpu", true);
1059 function(
"_MakeGPUTextureSurface", &MakeGPUTextureSurface);
1060#endif
1061
1065
1069 uint8_t* imgData = reinterpret_cast<uint8_t*>(iptr);
1072 if (codec == nullptr) {
1073 return nullptr;
1074 }
1076 if (aCodec == nullptr) {
1077 return nullptr;
1078 }
1079
1081 }), allow_raw_pointers());
1084 uint8_t* imgData = reinterpret_cast<uint8_t*>(iptr);
1087 if (codec == nullptr) {
1088 return nullptr;
1089 }
1090 return std::get<0>(codec->getImage());
1091 }), allow_raw_pointers());
1092
1093
1097 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1100
1102 }), allow_raw_pointers());
1103
1104 function(
"_getShadowLocalBounds", optional_override([](
1109 const SkScalar* nineMatrixValues =
reinterpret_cast<const SkScalar*
>(ctmPtr);
1110 ctm.
set9(nineMatrixValues);
1113 SkRect* outputBounds =
reinterpret_cast<SkRect*
>(outPtr);
1115 flags, outputBounds);
1116 }));
1117
1118#ifdef CK_SERIALIZE_SKP
1121 uint8_t*
d =
reinterpret_cast<uint8_t*
>(dPtr);
1123
1124#ifndef CK_NO_FONTS
1125
1127 once([] {
1130 });
1131#endif
1132
1136 if (codec == nullptr) {
1137 return nullptr;
1138 }
1140 if (at.has_value()) {
1143
1145 }
1146 return std::get<0>(codec->getImage(
info));
1147 };
1148
1150 }), allow_raw_pointers());
1151#endif
1152
1153#ifdef ENABLE_GPU
1154 class_<GrDirectContext>("GrDirectContext")
1156 .
function(
"_getResourceCacheLimitBytes",
1158 int maxResources = 0;
1159 size_t currMax = 0;
1160 self.getResourceCacheLimits(&maxResources, &currMax);
1161 return currMax;
1162 }))
1163 .function("_getResourceCacheUsageBytes",
1165 int usedResources = 0;
1166 size_t currUsage = 0;
1167 self.getResourceCacheUsage(&usedResources, &currUsage);
1168 return currUsage;
1169 }))
1170 .function("_releaseResourcesAndAbandonContext",
1172 .function("_setResourceCacheLimitBytes",
1174 int maxResources = 0;
1175 size_t currMax = 0;
1176 self.getResourceCacheLimits(&maxResources, &currMax);
1177 self.setResourceCacheLimits(maxResources, maxResourceBytes);
1178 }));
1179#endif
1180#ifdef CK_ENABLE_WEBGL
1181
1182
1183 function(
"_setTextureCleanup", optional_override([](
JSObject callbackObj)->
void {
1184 textureCleanup = callbackObj;
1185 }));
1186#endif
1187
1188 class_<SkAnimatedImage>("AnimatedImage")
1195
1197 }))
1202 }));
1203
1204 class_<SkBlender>("Blender")
1207
1208 class_<SkCanvas>("Canvas")
1209 .constructor<>()
1210 .constructor<SkScalar,SkScalar>()
1213 }))
1217 }))
1220 self.clipRect(*rect, op, doAntiAlias);
1221 }))
1223
1224 const SkScalar* sixteenMatrixValues =
reinterpret_cast<const SkScalar*
>(mPtr);
1227 }))
1232 self.drawArc(*oval, startAngle, sweepAngle, useCenter,
paint);
1233 }))
1234 .function(
"_drawAtlasOptions", optional_override([](
SkCanvas&
self,
1240 const SkRect* srcRects =
reinterpret_cast<const SkRect*
>(rptr);
1242 if (cptr) {
1244 }
1248 }), allow_raw_pointers())
1254 const SkRect* srcRects =
reinterpret_cast<const SkRect*
>(rptr);
1256 if (cptr) {
1258 }
1262 }), allow_raw_pointers())
1266 }))
1269 }))
1272 }))
1276 }))
1277 .function(
"_drawGlyphs", optional_override([](
SkCanvas&
self,
1285 reinterpret_cast<const uint16_t*
>(
glyphs),
1286 reinterpret_cast<const SkPoint*
>(positions),
1288 }))
1289
1293 }), allow_raw_pointers())
1299 }), allow_raw_pointers())
1305 }), allow_raw_pointers())
1306
1312
1314 }), allow_raw_pointers())
1315
1324 }), allow_raw_pointers())
1333 }), allow_raw_pointers())
1342 }), allow_raw_pointers())
1348 }))
1350#ifdef CK_INCLUDE_PARAGRAPH
1354 }), allow_raw_pointers())
1355#endif
1357 .function(
"_drawPatch", optional_override([](
SkCanvas&
self,
1363 self.drawPatch(
reinterpret_cast<const SkPoint*
>(cubics),
1365 reinterpret_cast<const SkPoint*
>(texs),
1367 }))
1368
1369
1376 }))
1379 }))
1384 }))
1390 }))
1400
1405 }))
1406#ifndef CK_NO_FONTS
1410 const char* str = reinterpret_cast<const char*>(sptr);
1411
1413 }))
1415#endif
1417
1420 if (!outputRect) {
1421 return;
1422 }
1423 self.getDeviceClipBounds(outputRect);
1424 }))
1425
1426
1427
1430 if (!sixteenMatrixValues) {
1431 return;
1432 }
1434 m.getRowMajor(sixteenMatrixValues);
1435 }))
1437
1438
1439
1442 if (!nineMatrixValues) {
1443 return;
1444 }
1446 m.get9(nineMatrixValues);
1447 }))
1450 }), allow_raw_pointers())
1451
1454 size_t dstRowBytes, int srcX, int srcY) {
1455 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1457
1458 return self.readPixels(dstInfo, pixels, dstRowBytes, srcX, srcY);
1459 }), allow_raw_pointers())
1468 }), allow_raw_pointers())
1471 }))
1477 size_t srcRowBytes, int dstX, int dstY) {
1478 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1480
1481 return self.writePixels(dstInfo, pixels, srcRowBytes, dstX, dstY);
1482 }));
1483
1484 class_<SkColorFilter>("ColorFilter")
1489 }))
1493 .class_function(
"_makeMatrix", optional_override([](
WASMPointerF32 fPtr) {
1494 float* twentyFloats = reinterpret_cast<float*>(fPtr);
1496 }))
1499
1500 class_<SkContourMeasureIter>("ContourMeasureIter")
1503
1504 class_<SkContourMeasure>("ContourMeasure")
1510 if (!
self.getPosTan(distance, pointAndVector, pointAndVector + 1)) {
1511 SkDebugf(
"zero-length path in getPosTan\n");
1512 }
1513 }))
1517 bool ok =
self.getSegment(startD, stopD, &p, startWithMoveTo);
1520 }
1522 }))
1525
1526#ifndef CK_NO_FONTS
1527 class_<SkFont>("Font")
1528 .constructor<>()
1537
1540 self.getWidthsBounds(
glyphs, numGlyphs, outputWidths, outputRects,
paint);
1541 }), allow_raw_pointers())
1543 size_t strLen, size_t expectedCodePoints,
1545 char* str = reinterpret_cast<char*>(sptr);
1547
1549 glyphIDs, expectedCodePoints);
1550 return actualCodePoints;
1551 }))
1554 self.getMetrics(&fm);
1555
1556 JSObject j = emscripten::val::object();
1561 const float rect[] = {
1563 };
1565 }
1566 return j;
1567 }))
1568 .function(
"_getGlyphIntercepts", optional_override([](
SkFont&
self,
1574 if (
glyphs.size() > (
pos.size() >> 1)) {
1575 return emscripten::val("Not enough x,y position pairs for glyphs");
1576 }
1580 }), allow_raw_pointers())
1596
1597 class_<SkFontMgr>("FontMgr")
1599 .class_function(
"_fromData", optional_override([](
WASMPointerU32 dPtr,
1602 auto datas = reinterpret_cast<const uint8_t**>(dPtr);
1603 auto sizes = reinterpret_cast<const size_t*>(sPtr);
1604
1605 std::unique_ptr<sk_sp<SkData>[]> skdatas(
new sk_sp<SkData>[numFonts]);
1606 for (int i = 0; i < numFonts; ++i) {
1608 }
1609
1611 }), allow_raw_pointers())
1613 .function(
"getFamilyName", optional_override([](
SkFontMgr&
self,
int index)->JSString {
1614 if (index < 0 || index >=
self.countFamilies()) {
1615 return emscripten::val::null();
1616 }
1618 self.getFamilyName(index, &
s);
1619 return emscripten::val(
s.c_str());
1620 }))
1621 .function(
"matchFamilyStyle", optional_override([](
SkFontMgr&
self, std::string
name, emscripten::val jsFontStyle)->sk_sp<
SkTypeface> {
1625
1627
1628 return self.matchFamilyStyle(
name.c_str(), style);
1629 }), allow_raw_pointers())
1632 int numFam =
self.countFamilies();
1633 SkDebugf(
"There are %d font families\n", numFam);
1634 for (int i = 0 ; i< numFam; i++) {
1636 self.getFamilyName(i, &
s);
1638 }
1639 }))
1640#endif
1641 .function(
"_makeTypefaceFromData", optional_override([](
SkFontMgr&
self,
1644 uint8_t*
font =
reinterpret_cast<uint8_t*
>(fPtr);
1646
1647 return self.makeFromData(fontData);
1648 }), allow_raw_pointers());
1649#endif
1650
1651 class_<SkImage>("Image")
1653#ifdef CK_ENABLE_WEBGL
1654 .class_function("_makeFromGenerator", &MakeImageFromGenerator)
1655#endif
1656
1658 return self->imageInfo().refColorSpace();
1659 }), allow_raw_pointers())
1661
1669 }))
1675 }))
1676#if defined(ENABLE_GPU)
1679 int quality,
1682 }), allow_raw_pointers())
1683#endif
1686 }))
1693 : nullptr);
1694 }), allow_raw_pointers())
1700 return self->makeShader(tx, ty, {filter, mipmap}, mPtr ? &localMatrix :
nullptr);
1701 }), allow_raw_pointers())
1702#if defined(ENABLE_GPU)
1705 size_t dstRowBytes, int srcX, int srcY,
1707 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1709 return self->readPixels(dContext, ii, pixels, dstRowBytes, srcX, srcY);
1710 }), allow_raw_pointers())
1711#endif
1714 size_t dstRowBytes, int srcX, int srcY)->bool {
1715 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1717 return self->readPixels(
nullptr, ii, pixels, dstRowBytes, srcX, srcY);
1718 }), allow_raw_pointers())
1720
1721 class_<SkImageFilter>("ImageFilter")
1728 }))
1732 }))
1733 .class_function(
"MakeBlur", optional_override([](
SkScalar sigmaX,
SkScalar sigmaY,
1736 }))
1740 }))
1742 .class_function(
"MakeDilate", optional_override([](
SkScalar radiusX,
SkScalar radiusY,
1745 }))
1746 .class_function(
"MakeDisplacementMap", optional_override([](
SkColorChannel xChannelSelector,
1752 }))
1755 }))
1756 .class_function(
"_MakeDropShadow", optional_override([](
SkScalar dx,
SkScalar dy,
1761 }))
1762 .class_function(
"_MakeDropShadowOnly", optional_override([](
SkScalar dx,
SkScalar dy,
1767 }))
1768 .class_function(
"MakeErode", optional_override([](
SkScalar radiusX,
SkScalar radiusY,
1771 }))
1779 if (src && dst) {
1781 }
1783 }))
1792 if (src && dst) {
1794 }
1796 }))
1797 .class_function("_MakeMatrixTransformCubic",
1802 }))
1803 .class_function("_MakeMatrixTransformOptions",
1808 }))
1809 .class_function(
"MakeOffset", optional_override([](
SkScalar dx,
SkScalar dy,
1812 }));
1813
1814 class_<SkMaskFilter>("MaskFilter")
1817
1819 }), allow_raw_pointers());
1820
1821 class_<SkPaint>("Paint")
1822 .constructor<>()
1826 }))
1827
1830 float* fourFloats = reinterpret_cast<float*>(cPtr);
1831 memcpy(fourFloats, c.vec(), 4 *
sizeof(
SkScalar));
1832 }))
1844 }))
1847 }))
1851 }))
1863
1864 class_<SkColorSpace>("ColorSpace")
1868 }))
1869
1870
1872 .class_function(
"_MakeDisplayP3", optional_override([]()->sk_sp<
SkColorSpace> {
1874 }))
1875 .class_function(
"_MakeAdobeRGB", optional_override([]()->sk_sp<
SkColorSpace> {
1877 }));
1878
1879 class_<SkPathEffect>("PathEffect")
1884 const float* intervals = reinterpret_cast<const float*>(cptr);
1886 }), allow_raw_pointers())
1888 .class_function(
"_MakeLine2D", optional_override([](
SkScalar width,
1891 const SkScalar* nineMatrixValues =
reinterpret_cast<const SkScalar*
>(mPtr);
1892 matrix.set9(nineMatrixValues);
1894 }), allow_raw_pointers())
1896 .class_function(
"_MakePath2D", optional_override([](
WASMPointerF32 mPtr,
1899 const SkScalar* nineMatrixValues =
reinterpret_cast<const SkScalar*
>(mPtr);
1900 matrix.set9(nineMatrixValues);
1902 }), allow_raw_pointers());
1903
1904
1905 class_<SkPath>("Path")
1906 .constructor<>()
1907#ifdef CK_INCLUDE_PATHOPS
1908 .class_function("MakeFromOp", &MakePathFromOp)
1909#endif
1915 .function(
"_addArc", optional_override([](
SkPath&
self,
1919 self.addArc(*oval, startAngle, sweepAngle);
1920 }))
1921 .function(
"_addOval", optional_override([](
SkPath&
self,
1923 bool ccw,
unsigned start)->void {
1926 }))
1927 .function(
"_addCircle", optional_override([](
SkPath&
self,
1931 bool ccw)->void {
1933 }))
1934
1936 .function(
"_addPoly", optional_override([](
SkPath&
self,
1938 int count,
bool close)->void {
1941 }))
1942 .function(
"_addRect", optional_override([](
SkPath&
self,
1944 bool ccw)->void {
1947 }))
1948 .function(
"_addRRect", optional_override([](
SkPath&
self,
1950 bool ccw)->void {
1952 }))
1954 .function(
"_arcToOval", optional_override([](
SkPath&
self,
1956 SkScalar sweepAngle,
bool forceMoveTo)->void {
1958 self.arcTo(*oval, startAngle, sweepAngle, forceMoveTo);
1959 }))
1967 .function(
"_getPoint", optional_override([](
SkPath&
self,
int index,
1971 }))
1986 .function(
"_transform", select_overload<
void(
SkPath&,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar)>(&
ApplyTransform))
1987
1988
1992
1993#ifdef CK_INCLUDE_PATHOPS
1994
1997 .function("makeAsWinding", &MakeAsWinding)
1998#endif
1999
2001 .function(
"toCmds", &
ToCmds)
2002
2005 .function(
"_getBounds", optional_override([](
SkPath&
self,
2009 }))
2010 .function(
"_computeTightBounds", optional_override([](
SkPath&
self,
2014 }))
2015 .function(
"equals", &
Equals)
2016 .function("copy", &CopyPath)
2017#ifdef SK_DEBUG
2018 .function(
"dump", select_overload<
void()
const>(&
SkPath::dump))
2020#endif
2021 ;
2022
2024 class_<SkPictureRecorder>("PictureRecorder")
2025 .constructor<>()
2030 return self.beginRecording(*bounds, computeBounds ? &
bbhFactory : nullptr);
2031 }), allow_raw_pointers())
2034 return self.finishRecordingAsPicture();
2035 }), allow_raw_pointers());
2036
2037 class_<SkPicture>("Picture")
2044 return self.makeShader(
tmx,
tmy, mode, mPtr ? &localMatrix : nullptr, tileRect);
2045 }), allow_raw_pointers())
2050 }))
2052#ifdef CK_SERIALIZE_SKP
2053
2054
2055
2057
2058
2059
2060
2061
2066 };
2067
2069 if (!data) {
2070 return emscripten::val::null();
2071 }
2073 }), allow_raw_pointers())
2074#endif
2075 ;
2076
2077 class_<SkShader>("Shader")
2080 .class_function("_MakeColor",
2083 })
2084 )
2085 .class_function("MakeFractalNoise", optional_override([](
2088 int tileW,
int tileH)->sk_sp<
SkShader> {
2089
2092 }))
2093
2094
2095
2096 .class_function("_MakeLinearGradient", optional_override([](
2106
2111 mPtr ? &localMatrix : nullptr);
2116 mPtr ? &localMatrix : nullptr);
2117 }
2119 return nullptr;
2120 }), allow_raw_pointers())
2121 .class_function("_MakeRadialGradient", optional_override([](
2134 mPtr ? &localMatrix : nullptr);
2139 mPtr ? &localMatrix : nullptr);
2140 }
2142 return nullptr;
2143 }), allow_raw_pointers())
2144 .class_function(
"_MakeSweepGradient", optional_override([](
SkScalar cx,
SkScalar cy,
2157 mode, startAngle, endAngle,
flags,
2158 mPtr ? &localMatrix : nullptr);
2162 mode, startAngle, endAngle,
flags,
2163 mPtr ? &localMatrix : nullptr);
2164 }
2166 return nullptr;
2167 }), allow_raw_pointers())
2168 .class_function("MakeTurbulence", optional_override([](
2171 int tileW,
int tileH)->sk_sp<
SkShader> {
2172
2175 }))
2176 .class_function("_MakeTwoPointConicalGradient", optional_override([](
2184 const SkPoint* startAndEnd =
reinterpret_cast<const SkPoint*
>(fourFloatsPtr);
2187
2191 startAndEnd[1], endRadius,
2192 colors, colorSpace, positions,
count, mode,
2194 mPtr ? &localMatrix : nullptr);
2198 startRadius,
2199 startAndEnd[1],
2200 endRadius,
2201 colors,
2202 positions,
2204 mode,
2206 mPtr ? &localMatrix : nullptr);
2207 }
2209 return nullptr;
2210 }), allow_raw_pointers());
2211
2212#ifdef CK_INCLUDE_RUNTIME_EFFECT
2213 class_<SkSL::DebugTrace>("DebugTrace")
2217 self.writeTrace(&wstream);
2219 return std::string(reinterpret_cast<const char*>(trace->bytes()), trace->size());
2220 }));
2221
2222 value_object<SkRuntimeEffect::TracedShader>("TracedShader")
2225
2226 class_<SkRuntimeEffect>("RuntimeEffect")
2228 .class_function("_Make", optional_override([](std::string sksl,
2229 emscripten::val errHandler
2231 SkString s(sksl.c_str(), sksl.length());
2233 if (!effect) {
2234 errHandler.call<void>("onError", val(errorText.c_str()));
2235 return nullptr;
2236 }
2237 return effect;
2238 }))
2239 .class_function("_MakeForBlender", optional_override([](std::string sksl,
2240 emscripten::val errHandler
2242 SkString s(sksl.c_str(), sksl.length());
2244 if (!effect) {
2245 errHandler.call<void>("onError", val(errorText.c_str()));
2246 return nullptr;
2247 }
2248 return effect;
2249 }))
2250 .class_function("MakeTraced", optional_override([](
2252 int traceCoordX,
2255 }))
2258 size_t fLen,
2259 bool shouldOwnUniforms,
2261 void* uniformData = reinterpret_cast<void*>(fPtr);
2262 castUniforms(uniformData, fLen,
self);
2264 if (shouldOwnUniforms) {
2266 } else {
2268 }
2269
2271 return self.makeShader(uniforms,
nullptr, 0, mPtr ? &localMatrix : nullptr);
2272 }))
2275 size_t fLen,
2276 bool shouldOwnUniforms,
2278 size_t cLen,
2280 void* uniformData = reinterpret_cast<void*>(fPtr);
2281 castUniforms(uniformData, fLen,
self);
2283 if (shouldOwnUniforms) {
2285 } else {
2287 }
2288
2291 for (size_t i = 0; i < cLen; i++) {
2292
2293
2294 children[i] = sk_ref_sp<SkShader>(childrenPtrs[i]);
2295 }
2297 auto s =
self.makeShader(uniforms, children, cLen, mPtr ? &localMatrix : nullptr);
2298 delete[] children;
2300 }))
2303 size_t fLen,
2304 bool shouldOwnUniforms)->sk_sp<
SkBlender> {
2305 void* uniformData = reinterpret_cast<void*>(fPtr);
2306 castUniforms(uniformData, fLen,
self);
2308 if (shouldOwnUniforms) {
2310 } else {
2312 }
2313
2314 return self.makeBlender(uniforms, {});
2315 }))
2317 return self.uniforms().size();
2318 }))
2320 return self.uniformSize() /
sizeof(
float);
2321 }))
2322 .function(
"getUniformName", optional_override([](
SkRuntimeEffect&
self,
int i)->JSString {
2323 auto it =
self.uniforms().begin() + i;
2324 return emscripten::val(std::string(it->name).c_str());
2325 }))
2326 .function(
"getUniform", optional_override([](
SkRuntimeEffect&
self,
int i)->RuntimeEffectUniform {
2327 auto it =
self.uniforms().begin() + i;
2328 RuntimeEffectUniform su = fromUniform(*it);
2329 return su;
2330 }));
2331
2332 value_object<RuntimeEffectUniform>("RuntimeEffectUniform")
2333 .field("columns", &RuntimeEffectUniform::columns)
2334 .field("rows", &RuntimeEffectUniform::rows)
2335 .field("slot", &RuntimeEffectUniform::slot)
2336 .field("isInteger", &RuntimeEffectUniform::isInteger);
2337
2338 constant("rt_effect", true);
2339#endif
2340
2341 class_<SkSurface>("Surface")
2343 .class_function(
"_makeRasterDirect", optional_override([](
const SimpleImageInfo ii,
2346 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
2349 }), allow_raw_pointers())
2351#ifdef CK_ENABLE_WEBGL
2353#endif
2354 }))
2357 const auto& ii =
self.imageInfo();
2359 }))
2361#ifdef CK_ENABLE_WEBGL
2362 .function(
"_makeImageFromTexture", optional_override([](
SkSurface&
self,
2363 uint32_t webglHandle, uint32_t texHandle,
2365 auto releaseCtx = new TextureReleaseContext{webglHandle, texHandle};
2370
2372 gbt,
2377 deleteJSTexture,
2378 releaseCtx);
2379 }))
2380#endif
2381#ifdef CK_ENABLE_WEBGPU
2382 .function(
"_replaceBackendTexture", optional_override([](
SkSurface&
self,
2383 uint32_t texHandle, uint32_t texFormat,
2385 return ReplaceBackendTexture(
self, texHandle, texFormat,
width,
height);
2386 }))
2387#endif
2390 if (!bounds) {
2391 return self.makeImageSnapshot();
2392 }
2393 return self.makeImageSnapshot(*bounds);
2394 }))
2397 }), allow_raw_pointers())
2398#ifdef ENABLE_GPU
2400 return self.getCanvas()->recordingContext() !=
nullptr;
2401 }))
2402 .function(
"sampleCnt", optional_override([](
SkSurface&
self)->int {
2404 &
self, SkSurfaces::BackendHandleAccess::kFlushRead);
2405 return (backendRT.isValid()) ? backendRT.sampleCnt() : 0;
2406 }))
2407 .function(
"_resetContext",optional_override([](
SkSurface&
self)->void {
2409 }))
2410#else
2411 .function(
"reportBackendTypeIsGPU", optional_override([](
SkSurface&
self) ->
bool {
2412 return false;
2413 }))
2414#endif
2416
2417#ifndef CK_NO_FONTS
2418 class_<SkTextBlob>("TextBlob")
2420 .class_function(
"_MakeFromRSXform", optional_override([](
WASMPointerU8 sptr,
2421 size_t strBtyes,
2424 const char* str = reinterpret_cast<const char*>(sptr);
2426
2428 }), allow_raw_pointers())
2429 .class_function(
"_MakeFromRSXformGlyphs", optional_override([](
WASMPointerU16 gPtr,
2430 size_t byteLen,
2435
2437 }), allow_raw_pointers())
2438 .class_function(
"_MakeFromText", optional_override([](
WASMPointerU8 sptr,
2440 const char* str = reinterpret_cast<const char*>(sptr);
2442 }), allow_raw_pointers())
2443 .class_function(
"_MakeFromGlyphs", optional_override([](
WASMPointerU16 gPtr,
2447 }), allow_raw_pointers());
2448
2449 class_<SkTypeface>("Typeface")
2452#if defined(CK_EMBED_FONT)
2453 if (SK_EMBEDDED_FONTS.count == 0) {
2454 return nullptr;
2455 }
2458 once([] {
2460 auto stream = std::make_unique<SkMemoryStream>(fontEntry.
data, fontEntry.
size,
false);
2462 });
2463 return default_face;
2464#else
2465 return nullptr;
2466#endif
2467 }), allow_raw_pointers())
2468 .class_function("_MakeTypefaceFromData", optional_override([](
2470 uint8_t*
font =
reinterpret_cast<uint8_t*
>(fPtr);
2472 stream->setMemoryOwned(font, flen);
2474 }), allow_raw_pointers())
2476 size_t strLen, size_t expectedCodePoints,
2478 char* str = reinterpret_cast<char*>(sptr);
2480
2482 glyphIDs, expectedCodePoints);
2483 return actualCodePoints;
2484 }));
2485#endif
2486
2487 class_<SkVertices>("Vertices")
2493 }))
2495
2496
2497 class_<SkVertices::Builder>("_VerticesBuilder")
2500
2502 }))
2505
2507 }))
2509
2511 }))
2513
2515 }));
2516
2517 enum_<SkAlphaType>("AlphaType")
2521
2522 enum_<SkBlendMode>("BlendMode")
2552
2553 enum_<SkBlurStyle>("BlurStyle")
2558
2559 enum_<SkClipOp>("ClipOp")
2562
2563 enum_<SkColorChannel>("ColorChannel")
2568
2569 enum_<SkColorType>("ColorType")
2579
2580 enum_<SkPathFillType>("FillType")
2583
2584 enum_<SkFilterMode>("FilterMode")
2587
2588
2589
2590 enum_<SkEncodedImageFormat>("ImageFormat")
2594
2595 enum_<SkMipmapMode>("MipmapMode")
2599
2600 enum_<SkPaint::Style>("PaintStyle")
2603
2604 enum_<SkPath1DPathEffect::Style>("Path1DEffect")
2608
2609#ifdef CK_INCLUDE_PATHOPS
2610 enum_<SkPathOp>("PathOp")
2616#endif
2617
2618 enum_<SkCanvas::PointMode>("PointMode")
2622
2623 enum_<SkPaint::Cap>("StrokeCap")
2627
2628 enum_<SkPaint::Join>("StrokeJoin")
2632
2633#ifndef CK_NO_FONTS
2634 enum_<SkFontHinting>("FontHinting")
2639
2640 enum_<SkFont::Edging>("FontEdging")
2641#ifndef CK_NO_ALIAS_FONT
2643#endif
2646#endif
2647
2648 enum_<SkTileMode>("TileMode")
2653
2654 enum_<SkVertices::VertexMode>("VertexMode")
2658
2659
2660
2661
2662
2663 value_object<SimpleImageInfo>("ImageInfo")
2669
2670 value_object<StrokeOpts>("StrokeOpts")
2676
2677 constant(
"MOVE_VERB",
MOVE);
2678 constant(
"LINE_VERB",
LINE);
2679 constant(
"QUAD_VERB",
QUAD);
2680 constant(
"CONIC_VERB",
CONIC);
2681 constant(
"CUBIC_VERB",
CUBIC);
2682 constant(
"CLOSE_VERB",
CLOSE);
2683
2686
2690
2691#ifdef CK_INCLUDE_PARAGRAPH
2693#endif
2694}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kTopLeft_GrSurfaceOrigin
@ kTextureBinding_GrGLBackendState
static const int points[]
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kUnpremul_SkAlphaType
pixel components are independent of alpha
@ kExclusion
rc = s + d - two(s*d), ra = kSrcOver
@ kSaturation
saturation of source with hue and luminosity of destination
@ kColorBurn
darken destination to reflect source
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kHue
hue of source with saturation and luminosity of destination
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kColorDodge
brighten destination to reflect source
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ kLuminosity
luminosity of source with hue and saturation of destination
@ kSoftLight
lighten or darken, depending on source
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
@ kOverlay
multiply or screen, depending on destination
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
@ kColor
hue and saturation of source with luminosity of destination
@ kHardLight
multiply or screen, depending on source
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
@ kOuter_SkBlurStyle
nothing inside, fuzzy outside
@ kSolid_SkBlurStyle
solid inside, fuzzy outside
@ kInner_SkBlurStyle
fuzzy inside, nothing outside
@ kNormal_SkBlurStyle
fuzzy inside and outside
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGB_101010x_SkColorType
pixel with 10 bits each for red, green, blue; in 32-bit word
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
SK_API sk_sp< SkFontMgr > SkFontMgr_New_Custom_Data(SkSpan< sk_sp< SkData > >)
@ kNormal
glyph outlines modified to improve constrast
@ kNone
glyph outlines unchanged
@ kSlight
minimal modification to improve constrast
@ kFull
modifies glyph outlines for maximum constrast
@ kUTF8
uses bytes to represent UTF-8 or ASCII
@ kGlyphID
uses two byte words to represent glyph indices
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static bool ok(int result)
@ kReverseDifference_SkPathOp
subtract the first path from the op path
@ kDifference_SkPathOp
subtract the op path from the first path
@ kIntersect_SkPathOp
intersect the two paths
@ kUnion_SkPathOp
union (inclusive-or) the two paths
@ kXOR_SkPathOp
exclusive-or the two paths
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
#define SkScalarFloorToInt(x)
@ kDirectionalLight_ShadowFlag
@ kGeometricOnly_ShadowFlag
@ kTransparentOccluder_ShadowFlag
constexpr int SkToInt(S x)
static SkScalar center(float pos0, float pos1)
TypedArray MakeTypedArray(int count, const T src[])
emscripten::val Float32Array
emscripten::val Uint8Array
Type::kYUV Type::kRGBA() int(0.7 *637)
SkColor4f ptrToSkColor4f(WASMPointerF32 cPtr)
void ApplyReset(SkPath &p)
void ApplyTransform(SkPath &orig, SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
bool ApplyStroke(SkPath &path, StrokeOpts opts)
SkImageInfo toSkImageInfo(const SimpleImageInfo &sii)
void ApplyRMoveTo(SkPath &p, SkScalar dx, SkScalar dy)
void ApplyRQuadTo(SkPath &p, SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2)
void PathAddVerbsPointsWeights(SkPath &path, WASMPointerU8 verbsPtr, int numVerbs, WASMPointerF32 ptsPtr, int numPts, WASMPointerF32 wtsPtr, int numWts)
void ApplyClose(SkPath &p)
void ApplyRewind(SkPath &p)
SkPathOrNull MakePathFromCmds(WASMPointerF32 cptr, int numCmds)
void ApplyRCubicTo(SkPath &p, SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar dx3, SkScalar dy3)
void ApplyRArcToArcSize(SkPath &orig, SkScalar rx, SkScalar ry, SkScalar xAxisRotate, bool useSmallArc, bool ccw, SkScalar dx, SkScalar dy)
void ApplyRConicTo(SkPath &p, SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar w)
sk_sp< SkData > alwaysSaveTypefaceBytes(SkTypeface *face, void *)
void ApplyCubicTo(SkPath &p, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
void ApplyArcToTangent(SkPath &p, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)
void ApplyMoveTo(SkPath &p, SkScalar x, SkScalar y)
SkPathOrNull MakePathFromSVGString(std::string str)
void ApplyConicTo(SkPath &p, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
void ApplyAddPath(SkPath &orig, const SkPath &newPath, SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2, bool extendPath)
void ApplyArcToArcSize(SkPath &orig, SkScalar rx, SkScalar ry, SkScalar xAxisRotate, bool useSmallArc, bool ccw, SkScalar x, SkScalar y)
SkRRect ptrToSkRRect(WASMPointerF32 fPtr)
SkPathOrNull MakePathFromInterpolation(const SkPath &path1, const SkPath &path2, SkScalar weight)
bool ApplyDash(SkPath &path, SkScalar on, SkScalar off, SkScalar phase)
Uint8Array toBytes(sk_sp< SkData > data)
JSString ToSVGString(const SkPath &path)
static Uint8Array encodeImage(GrDirectContext *dContext, sk_sp< SkImage > img, SkEncodedImageFormat fmt, int quality)
Float32Array ToCmds(const SkPath &path)
SkPath MakePathFromVerbsPointsWeights(WASMPointerU8 verbsPtr, int numVerbs, WASMPointerF32 ptsPtr, int numPts, WASMPointerF32 wtsPtr, int numWts)
void ApplyQuadTo(SkPath &p, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
void ApplyRLineTo(SkPath &p, SkScalar dx, SkScalar dy)
bool Equals(const SkPath &a, const SkPath &b)
bool CanInterpolate(const SkPath &path1, const SkPath &path2)
bool ApplyTrim(SkPath &path, SkScalar startT, SkScalar stopT, bool isComplement)
void computeTonalColors(WASMPointerF32 cPtrAmbi, WASMPointerF32 cPtrSpot)
std::unique_ptr< SkCodec > DecodeImageData(sk_sp< SkData > data)
void ApplyLineTo(SkPath &p, SkScalar x, SkScalar y)
void resetContext(uint32_t state=kAll_GrBackendState)
void releaseResourcesAndAbandonContext()
static std::unique_ptr< SkAndroidCodec > MakeFromCodec(std::unique_ptr< SkCodec >)
static sk_sp< SkAnimatedImage > Make(std::unique_ptr< SkAndroidCodec >, const SkImageInfo &info, SkIRect cropRect, sk_sp< SkPicture > postProcess)
int getFrameCount() const
int currentFrameDuration()
sk_sp< SkImage > getCurrentFrame()
int getRepetitionCount() const
static sk_sp< SkBlender > Mode(SkBlendMode mode)
void translate(SkScalar dx, SkScalar dy)
void drawPaint(const SkPaint &paint)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
@ kFast_SrcRectConstraint
sample outside bounds; faster
void rotate(SkScalar degrees)
void restoreToCount(int saveCount)
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
@ kInitWithPrevious_SaveLayerFlag
initializes with previous contents
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void drawPicture(const SkPicture *picture)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
@ kLines_PointMode
draw each pair of points as a line segment
@ kPolygon_PointMode
draw the array of points as a open polygon
@ kPoints_PointMode
draw each point separately
void skew(SkScalar sx, SkScalar sy)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkColorFilter > Compose(const sk_sp< SkColorFilter > &outer, sk_sp< SkColorFilter > inner)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
static sk_sp< SkColorFilter > SRGBToLinearGamma()
static sk_sp< SkColorFilter > Lerp(float t, sk_sp< SkColorFilter > dst, sk_sp< SkColorFilter > src)
static sk_sp< SkColorFilter > LinearToSRGBGamma()
static bool Equals(const SkColorSpace *, const SkColorSpace *)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkColorSpace > MakeRGB(const skcms_TransferFunction &transferFn, const skcms_Matrix3x3 &toXYZ)
sk_sp< SkContourMeasure > next()
static sk_sp< SkPathEffect > Make(SkScalar radius)
static sk_sp< SkData > MakeWithoutCopy(const void *data, size_t length)
static sk_sp< SkData > MakeFromMalloc(const void *data, size_t length)
static sk_sp< SkPathEffect > Make(SkScalar segLength, SkScalar dev, uint32_t seedAssist=0)
sk_sp< SkData > detachAsData()
int countFamilies() const
void setSubpixel(bool subpixel)
void setScaleX(SkScalar scaleX)
void setLinearMetrics(bool linearMetrics)
SkTypeface * getTypeface() const
void setTypeface(sk_sp< SkTypeface > tf)
void setEdging(Edging edging)
void setSize(SkScalar textSize)
SkScalar getScaleX() const
SkScalar getSkewX() const
void setSkewX(SkScalar skewX)
void setHinting(SkFontHinting hintingLevel)
@ kAntiAlias
may have transparent pixels on glyph edges
@ kAlias
no transparent pixels on glyph edges
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
void setEmbolden(bool embolden)
void setEmbeddedBitmaps(bool embeddedBitmaps)
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DropShadow(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor color, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Erode(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DropShadowOnly(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor color, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DisplacementMap(SkColorChannel xChannelSelector, SkColorChannel yChannelSelector, SkScalar scale, sk_sp< SkImageFilter > displacement, sk_sp< SkImageFilter > color, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Compose(sk_sp< SkImageFilter > outer, sk_sp< SkImageFilter > inner)
static sk_sp< SkImageFilter > Image(sk_sp< SkImage > image, const SkRect &srcRect, const SkRect &dstRect, const SkSamplingOptions &sampling)
static sk_sp< SkImageFilter > MatrixTransform(const SkMatrix &matrix, const SkSamplingOptions &sampling, sk_sp< SkImageFilter > input)
static sk_sp< SkImageFilter > Blend(SkBlendMode mode, sk_sp< SkImageFilter > background, sk_sp< SkImageFilter > foreground=nullptr, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Shader(sk_sp< SkShader > shader, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Dilate(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
sk_sp< SkImage > withDefaultMipmaps() const
static sk_sp< SkPathEffect > Make(SkScalar width, const SkMatrix &matrix)
static SkM44 RowMajor(const SkScalar r[16])
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
SkMatrix & set9(const SkScalar buffer[9])
SkScalar getStrokeMiter() const
@ kButt_Cap
no stroke extension
void setStyle(Style style)
void setStrokeMiter(SkScalar miter)
void setAntiAlias(bool aa)
void setDither(bool dither)
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
void setStrokeCap(Cap cap)
@ kFill_Style
set to fill geometry
void setStrokeJoin(Join join)
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
void setShader(sk_sp< SkShader > shader)
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
SkScalar getStrokeWidth() const
@ kMiter_Join
extends to miter limit
@ kBevel_Join
connects outside edges
void setBlendMode(SkBlendMode mode)
void setColorFilter(sk_sp< SkColorFilter > colorFilter)
void setBlender(sk_sp< SkBlender > blender)
Join getStrokeJoin() const
void setStrokeWidth(SkScalar width)
static sk_sp< SkPathEffect > Make(const SkPath &path, SkScalar advance, SkScalar phase, Style)
static sk_sp< SkPathEffect > Make(const SkMatrix &matrix, const SkPath &path)
SkPathFillType getFillType() const
void setFillType(SkPathFillType ft)
SkPath & setIsVolatile(bool isVolatile)
bool contains(SkScalar x, SkScalar y) const
static sk_sp< SkPicture > MakeFromData(const SkData *data, const SkDeserialProcs *procs=nullptr)
virtual size_t approximateBytesUsed() const =0
static size_t GetTotalBytesUsed()
static size_t GetTotalByteLimit()
static size_t SetTotalByteLimit(size_t newLimit)
static Result MakeForBlender(SkString sksl, const Options &)
static Result MakeForShader(SkString sksl, const Options &)
static TracedShader MakeTraced(sk_sp< SkShader > shader, const SkIPoint &traceCoord)
static void DrawShadow(SkCanvas *canvas, const SkPath &path, const SkPoint3 &zPlaneParams, const SkPoint3 &lightPos, SkScalar lightRadius, SkColor ambientColor, SkColor spotColor, uint32_t flags=SkShadowFlags::kNone_ShadowFlag)
static bool GetLocalBounds(const SkMatrix &ctm, const SkPath &path, const SkPoint3 &zPlaneParams, const SkPoint3 &lightPos, SkScalar lightRadius, uint32_t flags, SkRect *bounds)
sk_sp< SkSurface > makeSurface(const SkImageInfo &imageInfo)
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
static sk_sp< SkTextBlob > MakeFromRSXform(const void *text, size_t byteLength, const SkRSXform xform[], const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
static sk_sp< SkTypeface > MakeFromStream(std::unique_ptr< SkStreamAsset >, const SkFontArguments &)
static void Register(FactoryId id, sk_sp< SkTypeface >(*make)(std::unique_ptr< SkStreamAsset >, const SkFontArguments &))
sk_sp< SkVertices > detach()
uint32_t uniqueID() const
@ kTriangleStrip_VertexMode
@ kTriangleFan_VertexMode
@ kWhiteSpace_VisitorFlag
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
FlutterSemanticsFlag flags
Dart_NativeFunction function
static sk_sp< GrDirectContext > MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context)
SkRTreeFactory bbhFactory
SK_API GrBackendTexture MakeGL(int width, int height, skgpu::Mipmapped, const GrGLTextureInfo &glInfo, std::string_view label={})
SK_API sk_sp< SkImage > RasterFromData(const SkImageInfo &info, sk_sp< SkData > pixels, size_t rowBytes)
SK_API sk_sp< SkImage > BorrowTextureFrom(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
static constexpr skcms_Matrix3x3 kAdobeRGB
static constexpr skcms_Matrix3x3 kDisplayP3
static constexpr skcms_TransferFunction k2Dot2
static constexpr skcms_TransferFunction kSRGB
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
sk_sp< const SkImage > atlas
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
PODArray< SkRSXform > xforms
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SkSamplingOptions sampling
SK_API sk_sp< SkShader > MakeTurbulence(SkScalar baseFrequencyX, SkScalar baseFrequencyY, int numOctaves, SkScalar seed, const SkISize *tileSize=nullptr)
SK_API sk_sp< SkShader > MakeFractalNoise(SkScalar baseFrequencyX, SkScalar baseFrequencyY, int numOctaves, SkScalar seed, const SkISize *tileSize=nullptr)
SK_API sk_sp< SkSurface > WrapPixels(const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, const SkSurfaceProps *surfaceProps=nullptr)
SK_API GrBackendRenderTarget GetBackendRenderTarget(SkSurface *, BackendHandleAccess)
font
Font Metadata and Metrics.
SK_API void FlushAndSubmit(sk_sp< SkSurface >)
static SkString fmt(SkColor4f c)
bool EMSCRIPTEN_KEEPALIVE ApplySimplify(SkPath &path)
bool EMSCRIPTEN_KEEPALIVE ApplyPathOp(SkPath &pathOne, const SkPath &pathTwo, SkPathOp op)
sk_sp< SkColorSpace > colorSpace
SkDeserialImageFromDataProc fImageDataProc
SkScalar fTop
greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable ...
SkScalar fLeading
distance to add between lines, typically positive or zero
SkScalar fBottom
greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable ...
uint32_t fFlags
FontMetricsFlags indicating which metrics are valid.
SkScalar fAscent
distance to reserve above baseline, typically negative
@ kBoundsInvalid_Flag
set if fTop, fBottom, fXMin, fXMax invalid
SkScalar fDescent
distance to reserve below baseline, typically positive
SkScalar fXMin
greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with vari...
SkScalar fXMax
greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with var...
static constexpr SkIPoint Make(int32_t x, int32_t y)
static constexpr SkISize Make(int32_t w, int32_t h)
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
SkAlphaType alphaType() const
SkColorType colorType() const
static sk_sp< SkColorFilter > Make()
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
sk_sp< SkSL::DebugTrace > debugTrace
SkSerialImageProc fImageProc
SkSerialTypefaceProc fTypefaceProc