1046 {
1047#ifdef ENABLE_GPU
1048 constant("gpu", true);
1050#endif
1051
1052#ifdef CK_ENABLE_WEBGL
1053 constant("webgl", true);
1058#endif
1059
1060#ifdef CK_ENABLE_WEBGPU
1061 constant("webgpu", true);
1062 function(
"_MakeGPUTextureSurface", &MakeGPUTextureSurface);
1063#endif
1064
1068
1072 uint8_t* imgData = reinterpret_cast<uint8_t*>(iptr);
1075 if (codec == nullptr) {
1076 return nullptr;
1077 }
1079 if (aCodec == nullptr) {
1080 return nullptr;
1081 }
1082
1084 }), allow_raw_pointers());
1087 uint8_t* imgData = reinterpret_cast<uint8_t*>(iptr);
1090 if (codec == nullptr) {
1091 return nullptr;
1092 }
1094 }), allow_raw_pointers());
1095
1096
1100 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1103
1105 }), allow_raw_pointers());
1106
1107 function(
"_getShadowLocalBounds", optional_override([](
1112 const SkScalar* nineMatrixValues =
reinterpret_cast<const SkScalar*
>(ctmPtr);
1113 ctm.
set9(nineMatrixValues);
1116 SkRect* outputBounds =
reinterpret_cast<SkRect*
>(outPtr);
1118 flags, outputBounds);
1119 }));
1120
1121#ifdef CK_SERIALIZE_SKP
1124 uint8_t*
d =
reinterpret_cast<uint8_t*
>(dPtr);
1126
1127#ifndef CK_NO_FONTS
1128
1130 once([] {
1133 });
1134#endif
1135
1139 if (codec == nullptr) {
1140 return nullptr;
1141 }
1143 if (at.has_value()) {
1146
1148 }
1150 };
1151
1153 }), allow_raw_pointers());
1154#endif
1155
1156#ifdef ENABLE_GPU
1157 class_<GrDirectContext>("GrDirectContext")
1159 .
function(
"_getResourceCacheLimitBytes",
1161 int maxResources = 0;
1162 size_t currMax = 0;
1163 self.getResourceCacheLimits(&maxResources, &currMax);
1164 return currMax;
1165 }))
1166 .function("_getResourceCacheUsageBytes",
1168 int usedResources = 0;
1169 size_t currUsage = 0;
1170 self.getResourceCacheUsage(&usedResources, &currUsage);
1171 return currUsage;
1172 }))
1173 .function("_releaseResourcesAndAbandonContext",
1175 .function("_setResourceCacheLimitBytes",
1177 int maxResources = 0;
1178 size_t currMax = 0;
1179 self.getResourceCacheLimits(&maxResources, &currMax);
1180 self.setResourceCacheLimits(maxResources, maxResourceBytes);
1181 }));
1182#endif
1183#ifdef CK_ENABLE_WEBGL
1184
1185
1186 function(
"_setTextureCleanup", optional_override([](
JSObject callbackObj)->
void {
1187 textureCleanup = callbackObj;
1188 }));
1189#endif
1190
1191 class_<SkAnimatedImage>("AnimatedImage")
1198
1200 }))
1205 }));
1206
1207 class_<SkBlender>("Blender")
1210
1211 class_<SkCanvas>("Canvas")
1212 .constructor<>()
1213 .constructor<SkScalar,SkScalar>()
1216 }))
1220 }))
1223 self.clipRect(*
rect, op, doAntiAlias);
1224 }))
1226
1227 const SkScalar* sixteenMatrixValues =
reinterpret_cast<const SkScalar*
>(mPtr);
1230 }))
1236 }))
1237 .function(
"_drawAtlasOptions", optional_override([](
SkCanvas&
self,
1243 const SkRect* srcRects =
reinterpret_cast<const SkRect*
>(rptr);
1245 if (cptr) {
1247 }
1251 }), allow_raw_pointers())
1257 const SkRect* srcRects =
reinterpret_cast<const SkRect*
>(rptr);
1259 if (cptr) {
1261 }
1265 }), allow_raw_pointers())
1269 }))
1272 }))
1275 }))
1279 }))
1280 .function(
"_drawGlyphs", optional_override([](
SkCanvas&
self,
1288 reinterpret_cast<const uint16_t*
>(
glyphs),
1289 reinterpret_cast<const SkPoint*
>(positions),
1291 }))
1292
1296 }), allow_raw_pointers())
1302 }), allow_raw_pointers())
1308 }), allow_raw_pointers())
1309
1315
1317 }), allow_raw_pointers())
1318
1327 }), allow_raw_pointers())
1336 }), allow_raw_pointers())
1345 }), allow_raw_pointers())
1351 }))
1353#ifdef CK_INCLUDE_PARAGRAPH
1357 }), allow_raw_pointers())
1358#endif
1360 .function(
"_drawPatch", optional_override([](
SkCanvas&
self,
1366 self.drawPatch(
reinterpret_cast<const SkPoint*
>(cubics),
1370 }))
1371
1372
1379 }))
1382 }))
1387 }))
1393 }))
1403
1408 }))
1409#ifndef CK_NO_FONTS
1413 const char* str = reinterpret_cast<const char*>(sptr);
1414
1416 }))
1418#endif
1420
1423 if (!outputRect) {
1424 return;
1425 }
1426 self.getDeviceClipBounds(outputRect);
1427 }))
1428
1429
1430
1433 if (!sixteenMatrixValues) {
1434 return;
1435 }
1437 m.getRowMajor(sixteenMatrixValues);
1438 }))
1440
1441
1442
1445 if (!nineMatrixValues) {
1446 return;
1447 }
1449 m.get9(nineMatrixValues);
1450 }))
1453 }), allow_raw_pointers())
1454
1457 size_t dstRowBytes, int srcX, int srcY) {
1458 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1460
1461 return self.readPixels(dstInfo, pixels, dstRowBytes, srcX, srcY);
1462 }), allow_raw_pointers())
1471 }), allow_raw_pointers())
1474 }))
1480 size_t srcRowBytes, int dstX, int dstY) {
1481 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1483
1484 return self.writePixels(dstInfo, pixels, srcRowBytes, dstX, dstY);
1485 }));
1486
1487 class_<SkColorFilter>("ColorFilter")
1492 }))
1496 .class_function(
"_makeMatrix", optional_override([](
WASMPointerF32 fPtr) {
1497 float* twentyFloats = reinterpret_cast<float*>(fPtr);
1499 }))
1502
1503 class_<SkContourMeasureIter>("ContourMeasureIter")
1506
1507 class_<SkContourMeasure>("ContourMeasure")
1513 if (!
self.getPosTan(
distance, pointAndVector, pointAndVector + 1)) {
1514 SkDebugf(
"zero-length path in getPosTan\n");
1515 }
1516 }))
1520 bool ok =
self.getSegment(startD, stopD, &
p, startWithMoveTo);
1523 }
1525 }))
1528
1529#ifndef CK_NO_FONTS
1530 class_<SkFont>("Font")
1531 .constructor<>()
1540
1543 self.getWidthsBounds(
glyphs, numGlyphs, outputWidths, outputRects,
paint);
1544 }), allow_raw_pointers())
1546 size_t strLen, size_t expectedCodePoints,
1548 char* str = reinterpret_cast<char*>(sptr);
1550
1552 glyphIDs, expectedCodePoints);
1553 return actualCodePoints;
1554 }))
1557 self.getMetrics(&fm);
1558
1559 JSObject j = emscripten::val::object();
1564 const float rect[] = {
1566 };
1568 }
1569 return j;
1570 }))
1571 .function(
"_getGlyphIntercepts", optional_override([](
SkFont&
self,
1577 if (
glyphs.size() > (
pos.size() >> 1)) {
1578 return emscripten::val("Not enough x,y position pairs for glyphs");
1579 }
1583 }), allow_raw_pointers())
1599
1600 class_<SkFontMgr>("FontMgr")
1602 .class_function(
"_fromData", optional_override([](
WASMPointerU32 dPtr,
1605 auto datas = reinterpret_cast<const uint8_t**>(dPtr);
1606 auto sizes = reinterpret_cast<const size_t*>(sPtr);
1607
1608 std::unique_ptr<sk_sp<SkData>[]> skdatas(
new sk_sp<SkData>[numFonts]);
1609 for (
int i = 0;
i < numFonts; ++
i) {
1611 }
1612
1614 }), allow_raw_pointers())
1616 .function(
"getFamilyName", optional_override([](
SkFontMgr&
self,
int index)->JSString {
1617 if (index < 0 || index >=
self.countFamilies()) {
1618 return emscripten::val::null();
1619 }
1621 self.getFamilyName(index, &
s);
1622 return emscripten::val(
s.c_str());
1623 }))
1624 .function(
"matchFamilyStyle", optional_override([](
SkFontMgr&
self, std::string
name, emscripten::val jsFontStyle)->sk_sp<
SkTypeface> {
1628
1630
1631 return self.matchFamilyStyle(
name.c_str(), style);
1632 }), allow_raw_pointers())
1635 int numFam =
self.countFamilies();
1636 SkDebugf(
"There are %d font families\n", numFam);
1637 for (
int i = 0 ;
i< numFam;
i++) {
1639 self.getFamilyName(
i, &
s);
1641 }
1642 }))
1643#endif
1644 .function(
"_makeTypefaceFromData", optional_override([](
SkFontMgr&
self,
1647 uint8_t*
font =
reinterpret_cast<uint8_t*
>(fPtr);
1649
1650 return self.makeFromData(fontData);
1651 }), allow_raw_pointers());
1652#endif
1653
1654 class_<SkImage>("Image")
1656#ifdef CK_ENABLE_WEBGL
1657 .class_function("_makeFromGenerator", &MakeImageFromGenerator)
1658#endif
1659
1661 return self->imageInfo().refColorSpace();
1662 }), allow_raw_pointers())
1664
1672 }))
1678 }))
1679#if defined(ENABLE_GPU)
1682 int quality,
1685 }), allow_raw_pointers())
1686#endif
1688 return self->withDefaultMipmaps();
1689 }))
1696 : nullptr);
1697 }), allow_raw_pointers())
1703 return self->makeShader(tx, ty, {filter, mipmap}, mPtr ? &localMatrix :
nullptr);
1704 }), allow_raw_pointers())
1705#if defined(ENABLE_GPU)
1708 size_t dstRowBytes, int srcX, int srcY,
1710 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1712 return self->readPixels(dContext, ii, pixels, dstRowBytes, srcX, srcY);
1713 }), allow_raw_pointers())
1714#endif
1717 size_t dstRowBytes, int srcX, int srcY)->bool {
1718 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
1720 return self->readPixels(
nullptr, ii, pixels, dstRowBytes, srcX, srcY);
1721 }), allow_raw_pointers())
1723
1724 class_<SkImageFilter>("ImageFilter")
1731 }))
1735 }))
1736 .class_function(
"MakeBlur", optional_override([](
SkScalar sigmaX,
SkScalar sigmaY,
1739 }))
1743 }))
1745 .class_function(
"MakeDilate", optional_override([](
SkScalar radiusX,
SkScalar radiusY,
1748 }))
1749 .class_function(
"MakeDisplacementMap", optional_override([](
SkColorChannel xChannelSelector,
1755 }))
1758 }))
1764 }))
1765 .class_function(
"_MakeDropShadowOnly", optional_override([](
SkScalar dx,
SkScalar dy,
1770 }))
1771 .class_function(
"MakeErode", optional_override([](
SkScalar radiusX,
SkScalar radiusY,
1774 }))
1784 }
1786 }))
1797 }
1799 }))
1800 .class_function("_MakeMatrixTransformCubic",
1805 }))
1806 .class_function("_MakeMatrixTransformOptions",
1811 }))
1815 }));
1816
1817 class_<SkMaskFilter>("MaskFilter")
1820
1822 }), allow_raw_pointers());
1823
1824 class_<SkPaint>("Paint")
1825 .constructor<>()
1829 }))
1830
1833 float* fourFloats = reinterpret_cast<float*>(cPtr);
1834 memcpy(fourFloats, c.vec(), 4 *
sizeof(
SkScalar));
1835 }))
1847 }))
1849 self.setColor(SkColor4f::FromColor(
color),
nullptr);
1850 }))
1853 self.setColor(SkColor4f::FromColor(
color), colorSpace.
get());
1854 }))
1866
1867 class_<SkColorSpace>("ColorSpace")
1871 }))
1872
1873
1875 .class_function(
"_MakeDisplayP3", optional_override([]()->sk_sp<
SkColorSpace> {
1877 }))
1878 .class_function(
"_MakeAdobeRGB", optional_override([]()->sk_sp<
SkColorSpace> {
1880 }));
1881
1882 class_<SkPathEffect>("PathEffect")
1887 const float* intervals = reinterpret_cast<const float*>(cptr);
1889 }), allow_raw_pointers())
1891 .class_function(
"_MakeLine2D", optional_override([](
SkScalar width,
1894 const SkScalar* nineMatrixValues =
reinterpret_cast<const SkScalar*
>(mPtr);
1895 matrix.set9(nineMatrixValues);
1897 }), allow_raw_pointers())
1899 .class_function(
"_MakePath2D", optional_override([](
WASMPointerF32 mPtr,
1902 const SkScalar* nineMatrixValues =
reinterpret_cast<const SkScalar*
>(mPtr);
1903 matrix.set9(nineMatrixValues);
1905 }), allow_raw_pointers());
1906
1907
1908 class_<SkPath>("Path")
1909 .constructor<>()
1910#ifdef CK_INCLUDE_PATHOPS
1911 .class_function("MakeFromOp", &MakePathFromOp)
1912#endif
1918 .function(
"_addArc", optional_override([](
SkPath&
self,
1923 }))
1924 .function(
"_addOval", optional_override([](
SkPath&
self,
1926 bool ccw,
unsigned start)->void {
1929 }))
1930 .function(
"_addCircle", optional_override([](
SkPath&
self,
1934 bool ccw)->void {
1936 }))
1937
1939 .function(
"_addPoly", optional_override([](
SkPath&
self,
1941 int count,
bool close)->void {
1944 }))
1945 .function(
"_addRect", optional_override([](
SkPath&
self,
1947 bool ccw)->void {
1950 }))
1951 .function(
"_addRRect", optional_override([](
SkPath&
self,
1953 bool ccw)->void {
1955 }))
1957 .function(
"_arcToOval", optional_override([](
SkPath&
self,
1962 }))
1970 .function(
"_getPoint", optional_override([](
SkPath&
self,
int index,
1974 }))
1989 .function(
"_transform", select_overload<
void(
SkPath&,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar,
SkScalar)>(&
ApplyTransform))
1990
1991
1995
1996#ifdef CK_INCLUDE_PATHOPS
1997
2000 .function("makeAsWinding", &MakeAsWinding)
2001#endif
2002
2004 .function(
"toCmds", &
ToCmds)
2005
2008 .function(
"_getBounds", optional_override([](
SkPath&
self,
2012 }))
2013 .function(
"_computeTightBounds", optional_override([](
SkPath&
self,
2017 }))
2018 .function(
"equals", &
Equals)
2020#ifdef SK_DEBUG
2021 .function(
"dump", select_overload<
void()
const>(&
SkPath::dump))
2023#endif
2024 ;
2025
2027 class_<SkPictureRecorder>("PictureRecorder")
2028 .constructor<>()
2034 }), allow_raw_pointers())
2037 return self.finishRecordingAsPicture();
2038 }), allow_raw_pointers());
2039
2040 class_<SkPicture>("Picture")
2047 return self.makeShader(
tmx,
tmy,
mode, mPtr ? &localMatrix :
nullptr, tileRect);
2048 }), allow_raw_pointers())
2053 }))
2055#ifdef CK_SERIALIZE_SKP
2056
2057
2058
2060
2061
2062
2063
2064
2069 };
2070
2073 return emscripten::val::null();
2074 }
2076 }), allow_raw_pointers())
2077#endif
2078 ;
2079
2080 class_<SkShader>("Shader")
2083 .class_function("_MakeColor",
2086 })
2087 )
2088 .class_function("MakeFractalNoise", optional_override([](
2091 int tileW,
int tileH)->sk_sp<
SkShader> {
2092
2095 }))
2096
2097
2098
2099 .class_function("_MakeLinearGradient", optional_override([](
2109
2114 mPtr ? &localMatrix : nullptr);
2119 mPtr ? &localMatrix : nullptr);
2120 }
2122 return nullptr;
2123 }), allow_raw_pointers())
2124 .class_function("_MakeRadialGradient", optional_override([](
2137 mPtr ? &localMatrix : nullptr);
2142 mPtr ? &localMatrix : nullptr);
2143 }
2145 return nullptr;
2146 }), allow_raw_pointers())
2147 .class_function(
"_MakeSweepGradient", optional_override([](
SkScalar cx,
SkScalar cy,
2161 mPtr ? &localMatrix : nullptr);
2166 mPtr ? &localMatrix : nullptr);
2167 }
2169 return nullptr;
2170 }), allow_raw_pointers())
2171 .class_function("MakeTurbulence", optional_override([](
2174 int tileW,
int tileH)->sk_sp<
SkShader> {
2175
2178 }))
2179 .class_function("_MakeTwoPointConicalGradient", optional_override([](
2187 const SkPoint* startAndEnd =
reinterpret_cast<const SkPoint*
>(fourFloatsPtr);
2190
2194 startAndEnd[1], endRadius,
2197 mPtr ? &localMatrix : nullptr);
2201 startRadius,
2202 startAndEnd[1],
2203 endRadius,
2205 positions,
2209 mPtr ? &localMatrix : nullptr);
2210 }
2212 return nullptr;
2213 }), allow_raw_pointers());
2214
2215#ifdef CK_INCLUDE_RUNTIME_EFFECT
2216 class_<SkSL::DebugTrace>("DebugTrace")
2220 self.writeTrace(&wstream);
2222 return std::string(
reinterpret_cast<const char*
>(trace->
bytes()), trace->
size());
2223 }));
2224
2225 value_object<SkRuntimeEffect::TracedShader>("TracedShader")
2228
2229 class_<SkRuntimeEffect>("RuntimeEffect")
2231 .class_function("_Make", optional_override([](std::string sksl,
2232 emscripten::val errHandler
2234 SkString s(sksl.c_str(), sksl.length());
2236 if (!effect) {
2237 errHandler.call<void>("onError", val(errorText.c_str()));
2238 return nullptr;
2239 }
2240 return effect;
2241 }))
2242 .class_function("_MakeForBlender", optional_override([](std::string sksl,
2243 emscripten::val errHandler
2245 SkString s(sksl.c_str(), sksl.length());
2247 if (!effect) {
2248 errHandler.call<void>("onError", val(errorText.c_str()));
2249 return nullptr;
2250 }
2251 return effect;
2252 }))
2253 .class_function("MakeTraced", optional_override([](
2255 int traceCoordX,
2258 }))
2261 size_t fLen,
2262 bool shouldOwnUniforms,
2264 void* uniformData = reinterpret_cast<void*>(fPtr);
2265 castUniforms(uniformData, fLen,
self);
2267 if (shouldOwnUniforms) {
2269 } else {
2271 }
2272
2274 return self.makeShader(uniforms,
nullptr, 0, mPtr ? &localMatrix :
nullptr);
2275 }))
2278 size_t fLen,
2279 bool shouldOwnUniforms,
2281 size_t cLen,
2283 void* uniformData = reinterpret_cast<void*>(fPtr);
2284 castUniforms(uniformData, fLen,
self);
2286 if (shouldOwnUniforms) {
2288 } else {
2290 }
2291
2294 for (
size_t i = 0;
i < cLen;
i++) {
2295
2296
2297 children[
i] = sk_ref_sp<SkShader>(childrenPtrs[
i]);
2298 }
2300 auto s =
self.makeShader(uniforms, children, cLen, mPtr ? &localMatrix :
nullptr);
2301 delete[] children;
2303 }))
2306 size_t fLen,
2307 bool shouldOwnUniforms)->sk_sp<
SkBlender> {
2308 void* uniformData = reinterpret_cast<void*>(fPtr);
2309 castUniforms(uniformData, fLen,
self);
2311 if (shouldOwnUniforms) {
2313 } else {
2315 }
2316
2317 return self.makeBlender(uniforms, {});
2318 }))
2320 return self.uniforms().size();
2321 }))
2323 return self.uniformSize() /
sizeof(
float);
2324 }))
2326 auto it =
self.uniforms().begin() +
i;
2327 return emscripten::val(std::string(it->name).c_str());
2328 }))
2329 .function(
"getUniform", optional_override([](
SkRuntimeEffect&
self,
int i)->RuntimeEffectUniform {
2330 auto it =
self.uniforms().begin() +
i;
2331 RuntimeEffectUniform su = fromUniform(*it);
2332 return su;
2333 }));
2334
2335 value_object<RuntimeEffectUniform>("RuntimeEffectUniform")
2336 .field("columns", &RuntimeEffectUniform::columns)
2337 .field("rows", &RuntimeEffectUniform::rows)
2338 .field("slot", &RuntimeEffectUniform::slot)
2339 .field("isInteger", &RuntimeEffectUniform::isInteger);
2340
2341 constant("rt_effect", true);
2342#endif
2343
2344 class_<SkSurface>("Surface")
2346 .class_function(
"_makeRasterDirect", optional_override([](
const SimpleImageInfo ii,
2349 uint8_t* pixels = reinterpret_cast<uint8_t*>(pPtr);
2352 }), allow_raw_pointers())
2354#ifdef CK_ENABLE_WEBGL
2356#endif
2357 }))
2360 const auto& ii =
self.imageInfo();
2362 }))
2364#ifdef CK_ENABLE_WEBGL
2365 .function(
"_makeImageFromTexture", optional_override([](
SkSurface&
self,
2366 uint32_t webglHandle, uint32_t texHandle,
2368 auto releaseCtx = new TextureReleaseContext{webglHandle, texHandle};
2373
2375 gbt,
2380 deleteJSTexture,
2381 releaseCtx);
2382 }))
2383#endif
2384#ifdef CK_ENABLE_WEBGPU
2385 .function(
"_replaceBackendTexture", optional_override([](
SkSurface&
self,
2386 uint32_t texHandle, uint32_t texFormat,
2388 return ReplaceBackendTexture(
self, texHandle, texFormat,
width,
height);
2389 }))
2390#endif
2394 return self.makeImageSnapshot();
2395 }
2397 }))
2400 }), allow_raw_pointers())
2401#ifdef ENABLE_GPU
2403 return self.getCanvas()->recordingContext() !=
nullptr;
2404 }))
2405 .function(
"sampleCnt", optional_override([](
SkSurface&
self)->int {
2408 return (backendRT.isValid()) ? backendRT.sampleCnt() : 0;
2409 }))
2410 .function(
"_resetContext",optional_override([](
SkSurface&
self)->void {
2412 }))
2413#else
2414 .function(
"reportBackendTypeIsGPU", optional_override([](
SkSurface&
self) ->
bool {
2415 return false;
2416 }))
2417#endif
2419
2420#ifndef CK_NO_FONTS
2421 class_<SkTextBlob>("TextBlob")
2423 .class_function(
"_MakeFromRSXform", optional_override([](
WASMPointerU8 sptr,
2424 size_t strBtyes,
2427 const char* str = reinterpret_cast<const char*>(sptr);
2429
2431 }), allow_raw_pointers())
2432 .class_function(
"_MakeFromRSXformGlyphs", optional_override([](
WASMPointerU16 gPtr,
2433 size_t byteLen,
2438
2440 }), allow_raw_pointers())
2441 .class_function(
"_MakeFromText", optional_override([](
WASMPointerU8 sptr,
2443 const char* str = reinterpret_cast<const char*>(sptr);
2445 }), allow_raw_pointers())
2446 .class_function(
"_MakeFromGlyphs", optional_override([](
WASMPointerU16 gPtr,
2450 }), allow_raw_pointers());
2451
2452 class_<SkTypeface>("Typeface")
2455#if defined(CK_EMBED_FONT)
2456 if (SK_EMBEDDED_FONTS.count == 0) {
2457 return nullptr;
2458 }
2461 once([] {
2463 auto stream = std::make_unique<SkMemoryStream>(fontEntry.
data, fontEntry.
size,
false);
2465 });
2466 return default_face;
2467#else
2468 return nullptr;
2469#endif
2470 }), allow_raw_pointers())
2471 .class_function("_MakeTypefaceFromData", optional_override([](
2473 uint8_t*
font =
reinterpret_cast<uint8_t*
>(fPtr);
2477 }), allow_raw_pointers())
2479 size_t strLen, size_t expectedCodePoints,
2481 char* str = reinterpret_cast<char*>(sptr);
2483
2485 glyphIDs, expectedCodePoints);
2486 return actualCodePoints;
2487 }));
2488#endif
2489
2490 class_<SkVertices>("Vertices")
2496 }))
2498
2499
2500 class_<SkVertices::Builder>("_VerticesBuilder")
2503
2505 }))
2508
2510 }))
2512
2514 }))
2516
2518 }));
2519
2520 enum_<SkAlphaType>("AlphaType")
2524
2525 enum_<SkBlendMode>("BlendMode")
2555
2556 enum_<SkBlurStyle>("BlurStyle")
2561
2562 enum_<SkClipOp>("ClipOp")
2565
2566 enum_<SkColorChannel>("ColorChannel")
2571
2572 enum_<SkColorType>("ColorType")
2582
2583 enum_<SkPathFillType>("FillType")
2586
2587 enum_<SkFilterMode>("FilterMode")
2590
2591
2592
2593 enum_<SkEncodedImageFormat>("ImageFormat")
2597
2598 enum_<SkMipmapMode>("MipmapMode")
2602
2603 enum_<SkPaint::Style>("PaintStyle")
2604 .value("Fill", SkPaint::Style::kFill_Style)
2605 .value("Stroke", SkPaint::Style::kStroke_Style);
2606
2607 enum_<SkPath1DPathEffect::Style>("Path1DEffect")
2608 .value("Translate", SkPath1DPathEffect::Style::kTranslate_Style)
2609 .value("Rotate", SkPath1DPathEffect::Style::kRotate_Style)
2610 .value("Morph", SkPath1DPathEffect::Style::kMorph_Style);
2611
2612#ifdef CK_INCLUDE_PATHOPS
2613 enum_<SkPathOp>("PathOp")
2619#endif
2620
2621 enum_<SkCanvas::PointMode>("PointMode")
2622 .value("Points", SkCanvas::PointMode::kPoints_PointMode)
2623 .value("Lines", SkCanvas::PointMode::kLines_PointMode)
2624 .value("Polygon", SkCanvas::PointMode::kPolygon_PointMode);
2625
2626 enum_<SkPaint::Cap>("StrokeCap")
2627 .value("Butt", SkPaint::Cap::kButt_Cap)
2628 .value("Round", SkPaint::Cap::kRound_Cap)
2629 .value("Square", SkPaint::Cap::kSquare_Cap);
2630
2631 enum_<SkPaint::Join>("StrokeJoin")
2632 .value("Miter", SkPaint::Join::kMiter_Join)
2633 .value("Round", SkPaint::Join::kRound_Join)
2634 .value("Bevel", SkPaint::Join::kBevel_Join);
2635
2636#ifndef CK_NO_FONTS
2637 enum_<SkFontHinting>("FontHinting")
2642
2643 enum_<SkFont::Edging>("FontEdging")
2644#ifndef CK_NO_ALIAS_FONT
2646#endif
2649#endif
2650
2651 enum_<SkTileMode>("TileMode")
2656
2657 enum_<SkVertices::VertexMode>("VertexMode")
2658 .value("Triangles", SkVertices::VertexMode::kTriangles_VertexMode)
2659 .value("TrianglesStrip", SkVertices::VertexMode::kTriangleStrip_VertexMode)
2660 .value("TriangleFan", SkVertices::VertexMode::kTriangleFan_VertexMode);
2661
2662
2663
2664
2665
2666 value_object<SimpleImageInfo>("ImageInfo")
2672
2673 value_object<StrokeOpts>("StrokeOpts")
2679
2680 constant(
"MOVE_VERB",
MOVE);
2681 constant(
"LINE_VERB",
LINE);
2682 constant(
"QUAD_VERB",
QUAD);
2683 constant(
"CONIC_VERB",
CONIC);
2684 constant(
"CUBIC_VERB",
CUBIC);
2685 constant(
"CLOSE_VERB",
CLOSE);
2686
2687 constant("SaveLayerInitWithPrevious", (int)SkCanvas::SaveLayerFlagsSet::kInitWithPrevious_SaveLayerFlag);
2688 constant("SaveLayerF16ColorType", (int)SkCanvas::SaveLayerFlagsSet::kF16ColorType);
2689
2693
2694#ifdef CK_INCLUDE_PARAGRAPH
2696#endif
2697}
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
@ 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
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
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
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)
SkPath CopyPath(const SkPath &a)
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)
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)
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)
const uint8_t * bytes() const
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={})
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
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)
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
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)
@ kFlushRead
back-end object is readable
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
@ 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
sk_sp< const SkImage > image
sk_sp< const SkImageFilter > backdrop
PODArray< SkRSXform > xforms
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SkSamplingOptions sampling
SK_API sk_sp< SkShader > Blend(SkBlendMode mode, sk_sp< SkShader > dst, sk_sp< SkShader > src)
SK_API sk_sp< SkShader > Color(SkColor)
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)
DEF_SWITCHES_START aot vmservice shared library name
font
Font Metadata and Metrics.
const myers::Point & get< 0 >(const myers::Segment &s)
SK_API void FlushAndSubmit(sk_sp< SkSurface >)
SkSamplingOptions(SkFilterMode::kLinear))
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)
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