729 {
731
735
737 }
738
741 }
742
744 paint.setShader(fShader);
745
747
748
749 for (bool gpuBuffer : {false, true}) {
750 auto ctx = gpuBuffer ? dc : nullptr;
751
752
753 static constexpr int kVBRects = 2;
754
755
756
757 static constexpr int kUpdatesRects = 3;
758
761
763 for (
int i = 0;
i < kUpdatesRects; ++
i) {
767 } else {
769 }
770
774
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]};
782
785
786 std::memset(vertices, 0, sizeof(vertices));
787
788 int rectCount =
std::min(
i + 1, kVBRects);
791 vb,
792 6 * rectCount,
793 0,
794 nullptr,
795 {},
797
798 if (!
result.mesh.isValid()) {
801 }
802
804
806 }
807
808
809
810
811 static constexpr int kIBRects = 2;
812
813
814 static constexpr int kNumIBUpdates = 3;
815
816
819 for (
int i = 0;
i < kNumIBUpdates; ++
i) {
825 } else {
827 }
828
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)));
835 }
836
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));
850
853 vb,
854 4 * kNumIBUpdates,
855 0,
856 ib,
857 6,
859 nullptr,
860 {},
862
863 if (!
result.mesh.isValid()) {
866 }
867
869 }
871 }
872
874 }
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
constexpr SkColor SK_ColorBLACK
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
constexpr uint16_t SkToU16(S x)
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)
void clear(SkColor color)
static SkMatrix RotateDeg(SkScalar deg)
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)
static float min(float r, float g, float b)
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
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)
void toQuad(SkPoint quad[4]) const
constexpr SkRect makeOffset(float dx, float dy) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float height() const
static constexpr SkRect MakeWH(float w, float h)