950 {
954
956 }
957
960 }
961
962 static constexpr SkPoint kTri[]{{10, 10}, {20, 10}, {10, 20}};
963
964 static constexpr uint16_t kTiIndices[]{1, 2};
965
966
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];
971
975 for (
size_t j = 0; j <
std::size(kTri); ++j) {
977 &kTri[j],
978 spec->stride()*j + posOffset,
979 sizeof(kTri[j])));
980 }
981
982
983
984
985 size_t indexUploadOffset =
i == 0 ? 4 : 0;
986 size_t indexMeshOffset =
i == 0 ? 2 : 0;
987
990 SkAssertResult(ib->update(ctx, kTiIndices, indexUploadOffset,
sizeof(kTiIndices)));
991
996 std::move(vb),
998 0,
999 std::move(ib),
1001 indexMeshOffset,
1002 nullptr,
1003 {},
1005 if (!
result.mesh.isValid()) {
1008 }
1009
1011
1012
1015 if (ctx) {
1016
1017
1022 }
1023 }
1024 }
1025
1027 }
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kDstOver
r = d + (1-da)*s
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
bool abandoned() override
static sk_sp< SkBlender > Mode(SkBlendMode mode)
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
void drawMesh(const SkMesh &mesh, sk_sp< SkBlender > blender, const SkPaint &paint)
const Attribute * findAttribute(std::string_view name) const
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)
Optional< SkRect > bounds
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
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)