49 static const Varying kVaryings[]{
53 static constexpr char kVS[] = R
"(
54 half4 unswizzle_color(half4 color) { return color.garb; }
56 Varyings main(const in Attributes attributes) {
58 varyings.color = unswizzle_color(attributes.brag);
59 varyings.uv = attributes.xuyv.yw;
60 varyings.position = attributes.xuyv.xz;
64 static constexpr char kFS[] = R
"(
65 uniform colorFilter filter;
67 float2 main(const in Varyings varyings, out float4 color) {
68 color = filter.eval(varyings.color);
80 fSpecWithColor = std::move(spec);
86 static const Varying kVaryings[]{
89 static constexpr char kVS[] = R
"(
90 Varyings main(const in Attributes a) {
93 v.position = a.xuyv.xz;
97 static constexpr char kFS[] = R
"(
98 float2 helper(in float2 vux2) { return vux2.yx/2; }
99 float2 main(const in Varyings varyings) {
100 return helper(varyings.vux2);
104 sizeof(NoColorVertex),
111 fSpecWithNoColor = std::move(spec);
125 this->ensureBuffers();
126 if (!dc || dc->abandoned()) {
133 if (!fColorVB || !fColorIndexedVB || !fIB[1]) {
142 fColorIndexedVB =
nullptr;
144 this->ensureBuffers();
156 for (uint8_t alpha : {0xFF , 0x40})
157 for (
bool colors : {
false,
true})
158 for (
bool shader : {
false,
true}) {
183 auto ib = (i % 4 == 0) ? fIB[0] : fIB[1];
210 if (!
result.mesh.isValid()) {
217 paint.setShader(shader ? fShader :
nullptr);
218 paint.setAlpha(alpha);
232 void ensureBuffers() {
240 std::memcpy(SkTAddOffset<void>(data->writable_data(), kNoColorOffset),
242 sizeof(kNoColorQuad));
246 if (!fColorIndexedVB) {
249 std::memcpy(SkTAddOffset<void>(
data->writable_data(), kColorIndexedOffset),
251 sizeof(kColorIndexedQuad));
255 if (!fNoColorIndexedVB) {
263 std::memcpy(SkTAddOffset<void>(
data->writable_data(), kIndexOffset),
281 struct NoColorVertex {
288 static constexpr ColorVertex kColorQuad[] {
289 {0, 0x00FFFF00, {kRect.left(), kUV.left(), kRect.top(), kUV.top() }},
290 {0, 0x00FFFFFF, {kRect.right(), kUV.right(), kRect.top(), kUV.top() }},
291 {0, 0xFFFF00FF, {kRect.left(), kUV.left(), kRect.bottom(), kUV.bottom()}},
292 {0, 0xFFFFFF00, {kRect.right(), kUV.right(), kRect.bottom(), kUV.bottom()}},
295 static constexpr NoColorVertex kNoColorQuad[]{
296 {{kRect.left(), kUV.left(), kRect.top(), kUV.top() }},
297 {{kRect.right(), kUV.right(), kRect.top(), kUV.top() }},
298 {{kRect.left(), kUV.left(), kRect.bottom(), kUV.bottom()}},
299 {{kRect.right(), kUV.right(), kRect.bottom(), kUV.bottom()}},
304 static constexpr ColorVertex kColorIndexedQuad[] {
305 {0, 0x00FFFF00, {kRect.left(), kUV.left(), kRect.top(), kUV.top() }},
306 {0, 0x00000000, { 100.f, 0.f, 100.f, 5.f }},
307 {0, 0x00FFFFFF, {kRect.right(), kUV.right(), kRect.top(), kUV.top() }},
308 {0, 0x00000000, { 200.f, 10.f, 200.f, 10.f }},
309 {0, 0xFFFF00FF, {kRect.left(), kUV.left(), kRect.bottom(), kUV.bottom()}},
310 {0, 0xFFFFFF00, {kRect.right(), kUV.right(), kRect.bottom(), kUV.bottom()}},
313 static constexpr NoColorVertex kNoColorIndexedQuad[]{
314 {{kRect.left(), kUV.left(), kRect.top(), kUV.top() }},
315 {{ 100.f, 0.f, 100.f, 5.f }},
316 {{kRect.right(), kUV.right(), kRect.top(), kUV.top() }},
317 {{ 200.f, 10.f, 200.f, 10.f }},
318 {{kRect.left(), kUV.left(), kRect.bottom(), kUV.bottom()}},
319 {{kRect.right(), kUV.right(), kRect.bottom(), kUV.bottom()}},
322 static constexpr uint16_t kIndices[]{0, 2, 4, 2, 5, 4};
325 static constexpr size_t kNoColorOffset =
sizeof(NoColorVertex);
326 static constexpr size_t kColorIndexedOffset = 2*
sizeof(ColorVertex);
327 static constexpr size_t kIndexOffset = 6;
360 static const Varying kVaryings[]{
363 static constexpr char kPremulVS[] = R
"(
364 Varyings main(const in Attributes attributes) {
366 varyings.color = half4(attributes.color.a*attributes.color.rgb,
368 varyings.position = attributes.pos;
372 static constexpr char kUnpremulVS[] = R
"(
373 Varyings main(const in Attributes attributes) {
375 varyings.color = attributes.color;
376 varyings.position = attributes.pos;
380 static constexpr char kFS[] = R
"(
381 float2 main(in const Varyings varyings, out half4 color) {
382 color = varyings.color;
383 return varyings.position;
386 for (
bool unpremul : {
false,
true}) {
388 auto vs = unpremul ? kUnpremulVS : kPremulVS;
389 for (
bool spin : {
false,
true}) {
392 cs = cs->makeColorSpin();
406 fSpecs[SpecIndex(unpremul,
spin)] = std::move(spec);
432 for (
bool useShader : {
false,
true})
433 for (
bool unpremul : {
false,
true}) {
435 for (
bool spin : {
false,
true}) {
444 if (!
result.mesh.isValid()) {
450 paint.setShader(useShader ? fShader :
nullptr);
472 static int SpecIndex(
bool spin,
bool unpremul) {
473 return static_cast<int>(
spin) + 2*
static_cast<int>(unpremul);
511DEF_GM(
return new MeshColorSpaceGM;)
528 static const Varying kVaryings[]{
533 static constexpr char kVS[] = R
"(
536 Varyings main(in const Attributes attributes) {
538 varyings.coords = (m*float3(attributes.coords + float2(t[0], t[1]), 1)).xy;
539 varyings.position = attributes.pos;
543 static constexpr char kFS[] = R
"(
545 layout(color) uniform half4 color;
546 float2 main(const Varyings varyings, out half4 c) {
548 return (m*float3(varyings.coords, 1)).xy;
562 fSpec = std::move(spec);
584 for (
const auto& m : matrices) {
588 static_assert(
sizeof(
SkPoint) == 2*
sizeof(
float));
592 std::memcpy(SkTAddOffset<void>(unis->writable_data(), u->
offset),
596 u = fSpec->findUniform(
"m");
598 for (
size_t offset = u->
offset, col = 0; col < 3; ++col) {
599 for (
size_t row = 0; row < 3; ++row,
offset +=
sizeof(float)) {
600 *SkTAddOffset<float>(unis->writable_data(),
offset) = m.rc(row, col);
604 u = fSpec->findUniform(
"color");
606 std::memcpy(SkTAddOffset<void>(unis->writable_data(), u->
offset),
619 if (!
result.mesh.isValid()) {
621 return DrawResult::kFail;
625 paint.setShader(fShader);
630 return DrawResult::kOk;
653 static constexpr SkPoint kCoordTrans = {75, -37};
654 static constexpr auto kCoordRect =
SkRect::MakeXYWH(kCoordTrans.
x(), kCoordTrans.
y(), 1, 1);
656 static constexpr SkPoint kGradCenter = {0.3f, 0.2f};
676DEF_GM(
return new MeshUniformsGM())
693 static const Varying kVaryings[]{
696 static constexpr char kVS[] = R
"(
697 Varyings main(const in Attributes attributes) {
699 varyings.coords = attributes.coords;
700 varyings.position = attributes.pos;
704 static constexpr char kFS[] = R
"(
705 float2 main(const Varyings varyings) { return varyings.coords; }
717 fSpec = std::move(spec);
736 return DrawResult::kSkip;
740 return DrawResult::kSkip;
744 paint.setShader(fShader);
749 for (
bool gpuBuffer : {
false,
true}) {
750 auto ctx = gpuBuffer ? dc :
nullptr;
753 static constexpr int kVBRects = 2;
757 static constexpr int kUpdatesRects = 3;
763 for (
int i = 0; i < kUpdatesRects; ++i) {
776 vertices[0] = {{p.left(), p.top()}, t[0]};
777 vertices[1] = {{p.left(), p.bottom()}, t[3]};
778 vertices[2] = {{p.right(), p.top()}, t[1]};
779 vertices[3] = vertices[2];
780 vertices[4] = vertices[1];
781 vertices[5] = {{p.right(), p.bottom()}, t[2]};
786 std::memset(vertices, 0,
sizeof(vertices));
788 int rectCount = std::min(i + 1, kVBRects);
798 if (!
result.mesh.isValid()) {
800 return DrawResult::kFail;
811 static constexpr int kIBRects = 2;
814 static constexpr int kNumIBUpdates = 3;
819 for (
int i = 0; i < kNumIBUpdates; ++i) {
832 Vertex vertices[4]{{p[0], t[0]}, {p[1], t[1]}, {p[2], t[2]}, {p[3], t[3]}};
834 vb->update(ctx, vertices, i*4*
sizeof(
Vertex), 4*
sizeof(
Vertex)));
838 ctx,
nullptr, kIBRects * 6 *
sizeof(uint16_t));
840 for (
int i = 0; i < kNumIBUpdates; ++i) {
841 uint16_t indices[6] = {
SkToU16(0 + 4*i),
847 size_t offset = 6*(i % kIBRects)*
sizeof(uint16_t);
849 std::memset(indices, 0, 6*
sizeof(uint16_t));
863 if (!
result.mesh.isValid()) {
865 return DrawResult::kFail;
873 return DrawResult::kOk;
887DEF_GM(
return new MeshUpdateGM())
909 static constexpr char kVS[] = R
"(
910 Varyings main(const in Attributes attributes) {
912 varyings.color = attributes.color;
913 varyings.position = attributes.pos;
917 static constexpr char kFS[] = R
"(
918 float2 main(const Varyings varyings, out half4 color) {
919 color = varyings.color;
920 return varyings.position;
930 if (!
result.specification) {
933 fSpec[0] = std::move(
result.specification);
942 if (!
result.specification) {
945 fSpec[1] = std::move(
result.specification);
955 return DrawResult::kSkip;
959 return DrawResult::kSkip;
962 static constexpr SkPoint kTri[]{{10, 10}, {20, 10}, {10, 20}};
964 static constexpr uint16_t kTiIndices[]{1, 2};
967 for (
bool gpuBuffer : {
false,
true}) {
968 auto ctx = gpuBuffer ? dc :
nullptr;
969 for (
int i = 0; i < 2; ++i) {
970 const auto& spec = fSpec[i];
972 size_t posOffset = spec->findAttribute(
"pos")->offset;
975 for (
size_t j = 0; j < std::size(kTri); ++j) {
978 spec->stride()*j + posOffset,
985 size_t indexUploadOffset = i == 0 ? 4 : 0;
986 size_t indexMeshOffset = i == 0 ? 2 : 0;
990 SkAssertResult(ib->update(ctx, kTiIndices, indexUploadOffset,
sizeof(kTiIndices)));
993 bounds.setBounds(kTri, std::size(kTri));
1000 std::size(kTiIndices) + 1,
1005 if (!
result.mesh.isValid()) {
1007 return DrawResult::kFail;
1014 canvas->
translate(bounds.width() + 10, 0);
1026 return DrawResult::kOk;
1033DEF_GM(
return new MeshZeroInitGM())
1051 static const Varying kVaryings[]{
1054 static constexpr char kVS[] = R
"(
1055 Varyings main(in const Attributes attributes) {
1057 varyings.position = attributes.pos;
1062 uniform float2 offset;
1063 float2 main(const Varyings varyings, out float4 color) {
1064 float2 tl = float2(%f, %f);
1065 float2 wh = float2(%f, %f);
1066 float2 c = tl + wh/2;
1067 float r = length(wh)/4;
1068 color.rba = float3(1);
1069 color.g = min(1, length(varyings.position - c + offset) / r);
1070 return varyings.position;
1073 auto [spec,
error] =
1084 fSpec = std::move(spec);
1091 for (
size_t i = 0; i < std::size(colors) - 1; ++i) {
1094 colors[std::size(colors) - 1] = colors[0];
1114 paint.setShader(fShader);
1117 for (
bool picture : {
false,
true}) {
1119 for (
bool gpu : {
false,
true}) {
1123 float offset[2] = {8, 8};
1124 for (
size_t i = 0; i < 4; ++i) {
1134 std::move(uniforms),
1144 std::move(uniforms),
1156 2 * (
sizeof(uint16_t)),
1157 std::move(uniforms),
1169 2 *
sizeof(uint16_t),
1170 std::move(uniforms),
1178 return DrawResult::kFail;
1199 return DrawResult::kOk;
1219 static constexpr uint16_t
kIndices[] = {1000, 2000, 1, 2, 3, 4, 5, 6};
1230DEF_GM(
return new PictureMesh())
1236 kMeshWithPaintColor,
1237 kMeshWithPaintImage,
1243 this->onAnimate(0.0);
1255 fIndices.push_back(TL);
1256 fIndices.push_back(TR);
1257 fIndices.push_back(BL);
1259 fIndices.push_back(BR);
1260 fIndices.push_back(BL);
1261 fIndices.push_back(TR);
1274 static const Attribute kAttributes[] = {
1278 static const Varying kVaryings[] = {
1281 static constexpr char kVS[] = R
"(
1282 Varyings main(const in Attributes attributes) {
1284 varyings.uv = attributes.uv;
1285 varyings.position = attributes.position;
1289 static constexpr char kFS[] = R
"(
1290 uniform shader myShader1;
1291 uniform shader myShader2;
1292 uniform colorFilter myColorFilter;
1293 uniform blender myBlend;
1295 float2 main(const in Varyings varyings, out half4 color) {
1296 half4 color1 = myShader1.eval(varyings.uv);
1297 half4 color2 = myShader2.eval(varyings.uv);
1299 // Apply a inverse color filter to the first image.
1300 color1 = myColorFilter.eval(color1);
1302 // Fade in the second image horizontally, leveraging the UVs.
1303 color2 *= varyings.uv.x / 128.0;
1305 // Combine the two images by using a blender (set to dst-over).
1306 color = myBlend.eval(color1, color2);
1319 fSpec = std::move(spec);
1324 case Type::kMeshWithImage: {
1328 fColorFilter =
nullptr;
1330 fPaintShader =
nullptr;
1333 case Type::kMeshWithEffects: {
1334 uint8_t inverseTable[256];
1335 for (
int index = 0; index < 256; ++index) {
1336 inverseTable[index] = 255 - index;
1348 fPaintShader =
nullptr;
1351 case Type::kMeshWithPaintColor: {
1355 fColorFilter =
nullptr;
1360 case Type::kMeshWithPaintImage: {
1364 fColorFilter =
nullptr;
1377 this->ensureBuffers();
1378 if (!dc || dc->abandoned()) {
1379 return DrawResult::kOk;
1384 return (!fVB || !fIB) ? DrawResult::kFail
1392 this->ensureBuffers();
1397 case Type::kMeshWithImage:
return SkString(
"mesh_with_image");
1398 case Type::kMeshWithEffects:
return SkString(
"mesh_with_effects");
1399 case Type::kMeshWithPaintColor:
return SkString(
"mesh_with_paint_color");
1400 case Type::kMeshWithPaintImage:
return SkString(
"mesh_with_paint_image");
1407 double periodic = nanos / 4'000'000'000.;
1408 periodic -= std::floor(periodic);
1412 for (
int index = 0; index <
kMeshSize; ++index) {
1413 xOff[index] = std::sin(periodic) * kRippleSize;
1414 yOff[index] = std::sin(periodic + 10.0) * kRippleSize;
1424 Vertex* vert = &fVerts.push_back();
1427 vert->uv[0] = kUV.left() + xf * kUV.width();
1428 vert->uv[1] = kUV.top() + yf * kUV.height();
1440 fVB->update(dc, fVerts.data(), 0, fVerts.size_bytes());
1453 if (!
result.mesh.isValid()) {
1455 return DrawResult::kFail;
1459 paint.setShader(fPaintShader);
1462 return DrawResult::kOk;
1466 void ensureBuffers() {
1483 static constexpr float kRippleSize = 6.0f;
1500DEF_GM(
return new MeshWithShadersGM(MeshWithShadersGM::Type::kMeshWithImage))
1501DEF_GM(
return new MeshWithShadersGM(MeshWithShadersGM::Type::kMeshWithPaintColor))
1502DEF_GM(
return new MeshWithShadersGM(MeshWithShadersGM::Type::kMeshWithPaintImage))
1503DEF_GM(
return new MeshWithShadersGM(MeshWithShadersGM::Type::kMeshWithEffects))
1506 if (!canvas->recordingContext() && !canvas->recorder()) {
1507 *errorMsg = GM::kErrorMsg_DrawSkippedGpuOnly;
1508 return DrawResult::kSkip;
1530 enum class Managed :
bool {
kNo,
kYes };
1536 static constexpr char kVS[] = R
"(
1537 Varyings main(in const Attributes attributes) {
1539 varyings.position = attributes.pos;
1543 static constexpr char kManagedFS[] = R
"(
1544 layout(color) uniform half4 color;
1545 float2 main(const Varyings varyings, out half4 c) {
1547 return varyings.position;
1550 static constexpr char kRawFS[] = R
"(
1551 uniform half4 color;
1552 float2 main(const Varyings varyings, out half4 c) {
1554 return varyings.position;
1563 SkString(managed == Managed::kYes ? kManagedFS : kRawFS),
1564 std::move(workingCS),
1592 static const Config kConfigs[] = {
1595 {srgb, null, Managed::kYes},
1596 {srgb, srgb, Managed::kYes},
1597 {srgb,
spin, Managed::kYes},
1598 {srgb, wide, Managed::kYes},
1601 {
spin, srgb, Managed::kYes},
1603 {
spin, wide, Managed::kYes},
1613 for (
const Config& config : kConfigs) {
1614 SkMesh mesh = makeMesh(config.fManaged, config.fMeshCS);
1617 SkCanvas* offscreenCanvas = offscreen->getCanvas();
1622 paint.setColor(config.fExpectedColor);
1625 offscreen->draw(canvas, 0, 0);
1626 canvas->translate(0, 100);
1629 return DrawResult::kOk;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
static const uint16_t kIndices[]
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
#define SkAssertResult(cond)
@ kSaturation
saturation of source with hue and luminosity of destination
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
@ kDstOver
r = d + (1-da)*s
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
constexpr double SK_DoublePI
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
SK_API SkString static SkString SkStringPrintf()
constexpr uint16_t SkToU16(S x)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
bool abandoned() override
static sk_sp< SkBlender > Mode(SkBlendMode mode)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
virtual GrRecordingContext * recordingContext() const
void drawMesh(const SkMesh &mesh, sk_sp< SkBlender > blender, const SkPaint &paint)
void clear(SkColor color)
void drawPicture(const SkPicture *picture)
SkImageInfo imageInfo() const
static sk_sp< SkColorFilter > TableARGB(const uint8_t tableA[256], const uint8_t tableR[256], const uint8_t tableG[256], const uint8_t tableB[256])
static sk_sp< SkColorSpace > MakeSRGB()
sk_sp< SkColorSpace > makeColorSpin() const
static sk_sp< SkColorSpace > MakeRGB(const skcms_TransferFunction &transferFn, const skcms_Matrix3x3 &toXYZ)
static sk_sp< SkData > MakeUninitialized(size_t length)
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
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)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static SkMatrix RotateDeg(SkScalar deg)
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
static Result Make(SkSpan< const Attribute > attributes, size_t vertexStride, SkSpan< const Varying > varyings, const SkString &vs, const SkString &fs)
static Result Make(sk_sp< SkMeshSpecification >, Mode, sk_sp< VertexBuffer >, size_t vertexCount, size_t vertexOffset, sk_sp< const SkData > uniforms, SkSpan< ChildPtr > children, const SkRect &bounds)
static Result MakeIndexed(sk_sp< SkMeshSpecification >, Mode, sk_sp< VertexBuffer >, size_t vertexCount, size_t vertexOffset, sk_sp< IndexBuffer >, size_t indexCount, size_t indexOffset, sk_sp< const SkData > uniforms, SkSpan< ChildPtr > children, const SkRect &bounds)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
void onOnceBeforeDraw() override
SkString getName() const override
SkISize getISize() override
DrawResult onDraw(SkCanvas *canvas, SkString *error) override
DrawResult onGpuSetup(SkCanvas *canvas, SkString *string, GraphiteTestContext *) override
DrawResult onDraw(SkCanvas *canvas, SkString *) override
void onGpuTeardown() override
SkString getName() const override
SkISize getISize() override
void onOnceBeforeDraw() override
SkString getName() const override
DrawResult onDraw(SkCanvas *canvas, SkString *error) override
SkISize getISize() override
void onOnceBeforeDraw() override
void onOnceBeforeDraw() override
DrawResult onGpuSetup(SkCanvas *canvas, SkString *string, GraphiteTestContext *) override
bool onAnimate(double nanos) override
SkString getName() const override
MeshWithShadersGM(Type type)
SkISize getISize() override
void onGpuTeardown() override
DrawResult onDraw(SkCanvas *canvas, SkString *) override
SkISize getISize() override
DrawResult onDraw(SkCanvas *canvas, SkString *error) override
void onOnceBeforeDraw() override
SkString getName() const override
SkString getName() const override
SkISize getISize() override
DrawResult onDraw(SkCanvas *canvas, SkString *error) override
void onOnceBeforeDraw() override
const uint8_t uint32_t uint32_t GError ** error
#define DEF_SIMPLE_GM_CAN_FAIL(NAME, CANVAS, ERR_MSG, W, H)
SK_API sk_sp< SkImage > RasterFromPixmapCopy(const SkPixmap &pixmap)
SK_API sk_sp< SkMesh::IndexBuffer > CopyIndexBuffer(const sk_sp< SkMesh::IndexBuffer > &)
SK_API sk_sp< SkMesh::IndexBuffer > MakeIndexBuffer(const void *data, size_t size)
SK_API sk_sp< SkMesh::VertexBuffer > MakeVertexBuffer(const void *, size_t size)
SK_API sk_sp< SkMesh::VertexBuffer > CopyVertexBuffer(const sk_sp< SkMesh::VertexBuffer > &)
static constexpr skcms_Matrix3x3 kRec2020
static constexpr skcms_TransferFunction k2Dot2
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static float SineWave(double time, float periodInSecs, float phaseInSecs, float min, float max)
static double NanosToSeconds(double nanos)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
static sk_sp< SkMesh::VertexBuffer > make_vertex_buffer(GrDirectContext *ctx, const void *data, size_t size)
static sk_sp< SkMesh::IndexBuffer > make_index_buffer(GrDirectContext *ctx, const void *data, size_t size)
static SkImageInfo MakeN32Premul(int width, int height)
SkColorSpace * colorSpace() const
SkImageInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
constexpr float y() const
constexpr float x() const
static SkRect Make(const SkISize &size)
void toQuad(SkPoint quad[4]) const
constexpr float left() const
constexpr SkRect makeOffset(float dx, float dy) const
constexpr float top() const
SkScalar fLeft
smaller x-axis bounds
constexpr float x() const
constexpr float y() const
SkRect makeOutset(float dx, float dy) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float centerX() const
constexpr float height() const
constexpr float right() const
constexpr float centerY() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
constexpr float bottom() const
static constexpr SkScalar kMeshSize
static sk_sp< SkColorFilter > spin(sk_sp< SkColorFilter > cf)