Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
aiks_dl_vertices_unittests.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
10
19#include "third_party/abseil-cpp/absl/status/status_matchers.h"
20
21namespace impeller {
22namespace testing {
23
24using namespace flutter;
25
26namespace {
27std::shared_ptr<DlVertices> MakeVertices(
28 DlVertexMode mode,
29 std::vector<DlPoint> vertices,
30 std::vector<uint16_t> indices,
31 std::vector<DlPoint> texture_coordinates,
32 std::vector<DlColor> colors) {
34 {{texture_coordinates.size() > 0, colors.size() > 0}});
35 DlVertices::Builder builder(mode, vertices.size(), flags, indices.size());
36 if (colors.size() > 0) {
37 builder.store_colors(colors.data());
38 }
39 if (texture_coordinates.size() > 0) {
40 builder.store_texture_coordinates(texture_coordinates.data());
41 }
42 if (indices.size() > 0) {
43 builder.store_indices(indices.data());
44 }
45 builder.store_vertices(vertices.data());
46 return builder.build();
47}
48}; // namespace
49
50// Regression test for https://github.com/flutter/flutter/issues/135441 .
51TEST_P(AiksTest, VerticesGeometryUVPositionData) {
52 DisplayListBuilder builder;
53 DlPaint paint;
54 auto image =
55 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
56 auto size = image->impeller_texture()->GetSize();
57
58 paint.setColorSource(
59 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp));
60
61 std::vector<DlPoint> vertex_coordinates = {
62 DlPoint(0, 0),
63 DlPoint(size.width, 0),
64 DlPoint(0, size.height),
65 };
66 auto vertices = MakeVertices(DlVertexMode::kTriangleStrip, vertex_coordinates,
67 {0, 1, 2}, {}, {});
68
69 builder.DrawVertices(vertices, DlBlendMode::kSrcOver, paint);
70 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
71}
72
73// Regression test for https://github.com/flutter/flutter/issues/135441 .
74TEST_P(AiksTest, VerticesGeometryUVPositionDataWithTranslate) {
75 DisplayListBuilder builder;
76 DlPaint paint;
77 auto image =
78 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
79 auto size = image->impeller_texture()->GetSize();
80
81 DlMatrix matrix = DlMatrix::MakeTranslation({100, 100});
82 paint.setColorSource(
83 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp,
84 DlImageSampling::kLinear, &matrix));
85
86 std::vector<DlPoint> positions = {
87 DlPoint(0, 0),
88 DlPoint(size.width, 0),
89 DlPoint(0, size.height),
90 };
91 auto vertices =
92 MakeVertices(DlVertexMode::kTriangleStrip, positions, {0, 1, 2}, {}, {});
93
94 builder.DrawVertices(vertices, DlBlendMode::kSrcOver, paint);
95 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
96}
97
98// Regression test for https://github.com/flutter/flutter/issues/145707
99TEST_P(AiksTest, VerticesGeometryColorUVPositionData) {
100 DisplayListBuilder builder;
101 DlPaint paint;
102 auto image =
103 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
104 auto size = image->impeller_texture()->GetSize();
105
106 paint.setColorSource(
107 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp));
108
109 std::vector<DlPoint> positions = {
110 DlPoint(0, 0), DlPoint(size.width, 0),
111 DlPoint(0, size.height), DlPoint(size.width, 0),
112 DlPoint(0, 0), DlPoint(size.width, size.height),
113 };
114 std::vector<DlColor> colors = {
118 };
119
120 auto vertices =
121 MakeVertices(DlVertexMode::kTriangles, positions, {}, {}, colors);
122
123 builder.DrawVertices(vertices, DlBlendMode::kDstOver, paint);
124 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
125}
126
127TEST_P(AiksTest, VerticesGeometryColorUVPositionDataAdvancedBlend) {
128 DisplayListBuilder builder;
129 DlPaint paint;
130 auto image =
131 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
132 auto size = image->impeller_texture()->GetSize();
133
134 paint.setColorSource(
135 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp));
136
137 std::vector<DlPoint> positions = {
138 DlPoint(0, 0), DlPoint(size.width, 0),
139 DlPoint(0, size.height), DlPoint(size.width, 0),
140 DlPoint(0, 0), DlPoint(size.width, size.height),
141 };
142 std::vector<DlColor> colors = {
149 };
150
151 auto vertices =
152 MakeVertices(DlVertexMode::kTriangles, positions, {}, {}, colors);
153
154 builder.DrawVertices(vertices, DlBlendMode::kColorBurn, paint);
155 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
156}
157
158// Draw a hexagon using triangle fan
159TEST_P(AiksTest, CanConvertTriangleFanToTriangles) {
160 constexpr Scalar hexagon_radius = 125;
161 auto hex_start = Point(200.0, -hexagon_radius + 200.0);
162 auto center_to_flat = 1.73 / 2 * hexagon_radius;
163
164 // clang-format off
165 std::vector<DlPoint> vertices = {
166 DlPoint(hex_start.x, hex_start.y),
167 DlPoint(hex_start.x + center_to_flat, hex_start.y + 0.5 * hexagon_radius),
168 DlPoint(hex_start.x + center_to_flat, hex_start.y + 1.5 * hexagon_radius),
169 DlPoint(hex_start.x + center_to_flat, hex_start.y + 1.5 * hexagon_radius),
170 DlPoint(hex_start.x, hex_start.y + 2 * hexagon_radius),
171 DlPoint(hex_start.x, hex_start.y + 2 * hexagon_radius),
172 DlPoint(hex_start.x - center_to_flat, hex_start.y + 1.5 * hexagon_radius),
173 DlPoint(hex_start.x - center_to_flat, hex_start.y + 1.5 * hexagon_radius),
174 DlPoint(hex_start.x - center_to_flat, hex_start.y + 0.5 * hexagon_radius)
175 };
176 // clang-format on
178 auto dl_vertices = flutter::DlVertices::Make(
179 flutter::DlVertexMode::kTriangleFan, vertices.size(), vertices.data(),
180 nullptr, nullptr);
182 builder.DrawVertices(dl_vertices, flutter::DlBlendMode::kSrcOver, paint);
183 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
184}
185
186TEST_P(AiksTest, DrawVerticesSolidColorTrianglesWithoutIndices) {
187 // Use negative coordinates and then scale the transform by -1, -1 to make
188 // sure coverage is taking the transform into account.
189 std::vector<DlPoint> positions = {
190 DlPoint(-100, -300),
191 DlPoint(-200, -100),
192 DlPoint(-300, -300),
193 };
194 std::vector<flutter::DlColor> colors = {flutter::DlColor::kWhite(),
197
198 auto vertices = flutter::DlVertices::Make(
199 flutter::DlVertexMode::kTriangles, 3, positions.data(),
200 /*texture_coordinates=*/nullptr, colors.data());
201
203 flutter::DlPaint paint;
204
205 paint.setColor(flutter::DlColor::kRed().modulateOpacity(0.5));
206 builder.Scale(-1, -1);
207 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
208
209 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
210}
211
212TEST_P(AiksTest, DrawVerticesLinearGradientWithoutIndices) {
213 std::vector<DlPoint> positions = {
214 DlPoint(100, 300),
215 DlPoint(200, 100),
216 DlPoint(300, 300),
217 };
218
219 auto vertices = flutter::DlVertices::Make(
220 flutter::DlVertexMode::kTriangles, 3, positions.data(),
221 /*texture_coordinates=*/nullptr, /*colors=*/nullptr);
222
223 std::vector<flutter::DlColor> colors = {flutter::DlColor::kBlue(),
225 const float stops[2] = {0.0, 1.0};
226
228 {100.0, 100.0}, {300.0, 300.0}, 2, colors.data(), stops,
230
232 flutter::DlPaint paint;
233
234 paint.setColorSource(linear);
235 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
236
237 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
238}
239
240TEST_P(AiksTest, DrawVerticesLinearGradientWithTextureCoordinates) {
241 std::vector<DlPoint> positions = {
242 DlPoint(100, 300),
243 DlPoint(200, 100),
244 DlPoint(300, 300),
245 };
246 std::vector<DlPoint> texture_coordinates = {
247 DlPoint(300, 100),
248 DlPoint(100, 200),
249 DlPoint(300, 300),
250 };
251
252 auto vertices = flutter::DlVertices::Make(
253 flutter::DlVertexMode::kTriangles, 3, positions.data(),
254 texture_coordinates.data(), /*colors=*/nullptr);
255
256 std::vector<flutter::DlColor> colors = {flutter::DlColor::kBlue(),
258 const float stops[2] = {0.0, 1.0};
259
261 {100.0, 100.0}, {300.0, 300.0}, 2, colors.data(), stops,
263
265 flutter::DlPaint paint;
266
267 paint.setColorSource(linear);
268 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
269
270 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
271}
272
273TEST_P(AiksTest, DrawVerticesImageSourceWithTextureCoordinates) {
274 auto texture = CreateTextureForFixture("embarcadero.jpg");
275 auto dl_image = DlImageImpeller::Make(texture);
276 std::vector<DlPoint> positions = {
277 DlPoint(100, 300),
278 DlPoint(200, 100),
279 DlPoint(300, 300),
280 };
281 std::vector<DlPoint> texture_coordinates = {
282 DlPoint(0, 0),
283 DlPoint(100, 200),
284 DlPoint(200, 100),
285 };
286
287 auto vertices = flutter::DlVertices::Make(
288 flutter::DlVertexMode::kTriangles, 3, positions.data(),
289 texture_coordinates.data(), /*colors=*/nullptr);
290
292 flutter::DlPaint paint;
293
294 auto image_source = flutter::DlColorSource::MakeImage(
296
297 paint.setColorSource(image_source);
298 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
299
300 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
301}
302
304 DrawVerticesImageSourceWithTextureCoordinatesAndColorBlending) {
305 auto texture = CreateTextureForFixture("embarcadero.jpg");
306 auto dl_image = DlImageImpeller::Make(texture);
307 std::vector<DlPoint> positions = {
308 DlPoint(100, 300),
309 DlPoint(200, 100),
310 DlPoint(300, 300),
311 };
312 std::vector<flutter::DlColor> colors = {flutter::DlColor::kWhite(),
315 std::vector<DlPoint> texture_coordinates = {
316 DlPoint(0, 0),
317 DlPoint(100, 200),
318 DlPoint(200, 100),
319 };
320
321 auto vertices = flutter::DlVertices::Make(
322 flutter::DlVertexMode::kTriangles, 3, positions.data(),
323 texture_coordinates.data(), colors.data());
324
326 flutter::DlPaint paint;
327
328 auto image_source = flutter::DlColorSource::MakeImage(
330
331 paint.setColorSource(image_source);
332 builder.DrawVertices(vertices, flutter::DlBlendMode::kModulate, paint);
333
334 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
335}
336
337TEST_P(AiksTest, DrawVerticesSolidColorTrianglesWithIndices) {
338 std::vector<DlPoint> positions = {
339 DlPoint(100, 300),
340 DlPoint(200, 100),
341 DlPoint(300, 300),
342 DlPoint(200, 500),
343 };
344 std::vector<uint16_t> indices = {0, 1, 2, 0, 2, 3};
345
346 auto vertices = flutter::DlVertices::Make(
347 flutter::DlVertexMode::kTriangles, positions.size(), positions.data(),
348 /*texture_coordinates=*/nullptr, /*colors=*/nullptr, indices.size(),
349 indices.data());
350
352 flutter::DlPaint paint;
353
355 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
356
357 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
358}
359
360TEST_P(AiksTest, DrawVerticesPremultipliesColors) {
361 std::vector<DlPoint> positions = {
362 DlPoint(100, 300),
363 DlPoint(200, 100),
364 DlPoint(300, 300),
365 DlPoint(200, 500),
366 };
367 auto color = flutter::DlColor::kBlue().withAlpha(0x99);
368 std::vector<uint16_t> indices = {0, 1, 2, 0, 2, 3};
369 std::vector<flutter::DlColor> colors = {color, color, color, color};
370
371 auto vertices = flutter::DlVertices::Make(
372 flutter::DlVertexMode::kTriangles, positions.size(), positions.data(),
373 /*texture_coordinates=*/nullptr, colors.data(), indices.size(),
374 indices.data());
375
377 flutter::DlPaint paint;
378 paint.setBlendMode(flutter::DlBlendMode::kSrcOver);
380
381 builder.DrawRect(DlRect::MakeLTRB(0, 0, 400, 400), paint);
382 builder.DrawVertices(vertices, flutter::DlBlendMode::kDst, paint);
383
384 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
385}
386
387TEST_P(AiksTest, DrawVerticesWithInvalidIndices) {
388 std::vector<DlPoint> positions = {
389 DlPoint(100, 300),
390 DlPoint(200, 100),
391 DlPoint(300, 300),
392 DlPoint(200, 500),
393 };
394 std::vector<uint16_t> indices = {0, 1, 2, 0, 2, 3, 99, 100, 101};
395
396 auto vertices = flutter::DlVertices::Make(
397 flutter::DlVertexMode::kTriangles, positions.size(), positions.data(),
398 /*texture_coordinates=*/nullptr, /*colors=*/nullptr, indices.size(),
399 indices.data());
400
401 EXPECT_EQ(vertices->GetBounds(), DlRect::MakeLTRB(100, 100, 300, 500));
402
404 flutter::DlPaint paint;
405 paint.setBlendMode(flutter::DlBlendMode::kSrcOver);
407
408 builder.DrawRect(DlRect::MakeLTRB(0, 0, 400, 400), paint);
409 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrc, paint);
410
411 AiksContext renderer(GetContext(), nullptr);
412 std::shared_ptr<Texture> image =
413 DisplayListToTexture(builder.Build(), {1024, 768}, renderer);
414 EXPECT_TRUE(image);
415}
416
417// All four vertices should form a solid red rectangle with no gaps.
418// The blue rectangle drawn under them should not be visible.
419TEST_P(AiksTest, DrawVerticesTextureCoordinatesWithFragmentShader) {
420 std::vector<DlPoint> positions_lt = {
421 DlPoint(0, 0), //
422 DlPoint(50, 0), //
423 DlPoint(0, 50), //
424 DlPoint(50, 50), //
425 };
426
427 auto vertices_lt = flutter::DlVertices::Make(
428 flutter::DlVertexMode::kTriangleStrip, positions_lt.size(),
429 positions_lt.data(),
430 /*texture_coordinates=*/positions_lt.data(), /*colors=*/nullptr,
431 /*index_count=*/0,
432 /*indices=*/nullptr);
433
434 std::vector<DlPoint> positions_rt = {
435 DlPoint(50, 0), //
436 DlPoint(100, 0), //
437 DlPoint(50, 50), //
438 DlPoint(100, 50), //
439 };
440
441 auto vertices_rt = flutter::DlVertices::Make(
442 flutter::DlVertexMode::kTriangleStrip, positions_rt.size(),
443 positions_rt.data(),
444 /*texture_coordinates=*/positions_rt.data(), /*colors=*/nullptr,
445 /*index_count=*/0,
446 /*indices=*/nullptr);
447
448 std::vector<DlPoint> positions_lb = {
449 DlPoint(0, 50), //
450 DlPoint(50, 50), //
451 DlPoint(0, 100), //
452 DlPoint(50, 100), //
453 };
454
455 auto vertices_lb = flutter::DlVertices::Make(
456 flutter::DlVertexMode::kTriangleStrip, positions_lb.size(),
457 positions_lb.data(),
458 /*texture_coordinates=*/positions_lb.data(), /*colors=*/nullptr,
459 /*index_count=*/0,
460 /*indices=*/nullptr);
461
462 std::vector<DlPoint> positions_rb = {
463 DlPoint(50, 50), //
464 DlPoint(100, 50), //
465 DlPoint(50, 100), //
466 DlPoint(100, 100), //
467 };
468
469 auto vertices_rb = flutter::DlVertices::Make(
470 flutter::DlVertexMode::kTriangleStrip, positions_rb.size(),
471 positions_rb.data(),
472 /*texture_coordinates=*/positions_rb.data(), /*colors=*/nullptr,
473 /*index_count=*/0,
474 /*indices=*/nullptr);
475
477 flutter::DlPaint paint;
478 flutter::DlPaint rect_paint;
479 rect_paint.setColor(DlColor::kBlue());
480
481 auto runtime_stages_result =
482 OpenAssetAsRuntimeStage("runtime_stage_simple.frag.iplr");
483 ABSL_ASSERT_OK(runtime_stages_result);
484 std::shared_ptr<RuntimeStage> runtime_stage =
485 runtime_stages_result
486 .value()[PlaygroundBackendToRuntimeStageBackend(GetBackend())];
487 ASSERT_TRUE(runtime_stage);
488
489 auto runtime_effect = DlRuntimeEffectImpeller::Make(runtime_stage);
490 auto uniform_data = std::make_shared<std::vector<uint8_t>>();
492 runtime_effect, {}, uniform_data);
493
494 paint.setColorSource(color_source);
495
496 builder.Scale(GetContentScale().x, GetContentScale().y);
497 builder.Save();
498 builder.DrawRect(DlRect::MakeLTRB(0, 0, 100, 100), rect_paint);
499 builder.DrawVertices(vertices_lt, flutter::DlBlendMode::kSrcOver, paint);
500 builder.DrawVertices(vertices_rt, flutter::DlBlendMode::kSrcOver, paint);
501 builder.DrawVertices(vertices_lb, flutter::DlBlendMode::kSrcOver, paint);
502 builder.DrawVertices(vertices_rb, flutter::DlBlendMode::kSrcOver, paint);
503 builder.Restore();
504
505 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
506}
507
508// The vertices should form a solid red rectangle with no gaps.
509// The blue rectangle drawn under them should not be visible.
511 DrawVerticesTextureCoordinatesWithFragmentShaderNonZeroOrigin) {
512 std::vector<DlPoint> positions_lt = {
513 DlPoint(200, 200), //
514 DlPoint(250, 200), //
515 DlPoint(200, 250), //
516 DlPoint(250, 250), //
517 };
518
519 auto vertices = flutter::DlVertices::Make(
520 flutter::DlVertexMode::kTriangleStrip, positions_lt.size(),
521 positions_lt.data(),
522 /*texture_coordinates=*/positions_lt.data(), /*colors=*/nullptr,
523 /*index_count=*/0,
524 /*indices=*/nullptr);
525
527 flutter::DlPaint paint;
528 flutter::DlPaint rect_paint;
529 rect_paint.setColor(DlColor::kBlue());
530
531 auto runtime_stages_result =
532 OpenAssetAsRuntimeStage("runtime_stage_position.frag.iplr");
533 ABSL_ASSERT_OK(runtime_stages_result);
534 std::shared_ptr<RuntimeStage> runtime_stage =
535 runtime_stages_result
536 .value()[PlaygroundBackendToRuntimeStageBackend(GetBackend())];
537 ASSERT_TRUE(runtime_stage);
538
539 auto runtime_effect = DlRuntimeEffectImpeller::Make(runtime_stage);
540 auto rect_data = std::vector<Rect>{Rect::MakeLTRB(200, 200, 250, 250)};
541
542 auto uniform_data = std::make_shared<std::vector<uint8_t>>();
543 uniform_data->resize(rect_data.size() * sizeof(Rect));
544 memcpy(uniform_data->data(), rect_data.data(), uniform_data->size());
545
547 runtime_effect, {}, uniform_data);
548
549 paint.setColorSource(color_source);
550
551 builder.Scale(GetContentScale().x, GetContentScale().y);
552 builder.DrawRect(DlRect::MakeLTRB(200, 200, 250, 250), rect_paint);
553 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
554
555 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
556}
557
558// Regression test for https://github.com/flutter/flutter/issues/170480 .
559TEST_P(AiksTest, VerticesGeometryWithMaskFilter) {
560 DisplayListBuilder builder;
561 DlPaint paint;
562 paint.setMaskFilter(DlBlurMaskFilter::Make(DlBlurStyle::kNormal, 10));
563
564 std::vector<DlPoint> vertex_coordinates = {
565 DlPoint(0, 0),
566 DlPoint(400, 0),
567 DlPoint(0, 400),
568 };
569 auto vertices = MakeVertices(DlVertexMode::kTriangleStrip, vertex_coordinates,
570 {0, 1, 2}, {}, {});
571
572 builder.DrawVertices(vertices, DlBlendMode::kSrcOver, paint);
573 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
574}
575
576} // namespace testing
577} // namespace impeller
void DrawVertices(const std::shared_ptr< DlVertices > &vertices, DlBlendMode mode, const DlPaint &paint) override
void Scale(DlScalar sx, DlScalar sy) override
sk_sp< DisplayList > Build()
Definition dl_builder.cc:66
void DrawRect(const DlRect &rect, const DlPaint &paint) override
static std::shared_ptr< DlMaskFilter > Make(DlBlurStyle style, SkScalar sigma, bool respect_ctm=true)
static std::shared_ptr< DlColorSource > MakeImage(const sk_sp< const DlImage > &image, DlTileMode horizontal_tile_mode, DlTileMode vertical_tile_mode, DlImageSampling sampling=DlImageSampling::kLinear, const DlMatrix *matrix=nullptr)
static std::shared_ptr< DlColorSource > MakeLinear(const DlPoint start_point, const DlPoint end_point, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const DlMatrix *matrix=nullptr)
static std::shared_ptr< DlColorSource > MakeRuntimeEffect(sk_sp< DlRuntimeEffect > runtime_effect, std::vector< std::shared_ptr< DlColorSource > > samplers, std::shared_ptr< std::vector< uint8_t > > uniform_data)
DlPaint & setColor(DlColor color)
Definition dl_paint.h:70
DlPaint & setBlendMode(DlBlendMode mode)
Definition dl_paint.h:85
DlPaint & setMaskFilter(std::nullptr_t filter)
Definition dl_paint.h:185
DlPaint & setColorSource(std::nullptr_t source)
Definition dl_paint.h:131
static sk_sp< DlRuntimeEffect > Make(std::shared_ptr< impeller::RuntimeStage > runtime_stage)
A utility class to build up a |DlVertices| object one set of data at a time.
Definition dl_vertices.h:73
static std::shared_ptr< DlVertices > Make(DlVertexMode mode, int vertex_count, const DlPoint vertices[], const DlPoint texture_coordinates[], const DlColor colors[], int index_count=0, const uint16_t indices[]=nullptr, const DlRect *bounds=nullptr)
Constructs a DlVector with compact inline storage for all of its required and optional lists of data.
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
int32_t x
FlutterVulkanImage * image
FlTexture * texture
double y
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all 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
DlVertexMode
Defines the way in which the vertices of a DlVertices object are separated into triangles into which ...
Definition dl_vertices.h:18
@ kTriangles
The vertices are taken 3 at a time to form a triangle.
impeller::Point DlPoint
TEST_P(AiksTest, DrawAtlasNoColor)
float Scalar
Definition scalar.h:19
std::shared_ptr< Texture > DisplayListToTexture(const sk_sp< flutter::DisplayList > &display_list, ISize size, AiksContext &context, bool reset_host_buffer, bool generate_mips, std::optional< PixelFormat > target_pixel_format)
Render the provided display list to a texture with the given size.
constexpr RuntimeStageBackend PlaygroundBackendToRuntimeStageBackend(PlaygroundBackend backend)
Definition playground.h:33
static constexpr DlColor kWhite()
Definition dl_color.h:70
static constexpr DlColor kBlue()
Definition dl_color.h:73
static constexpr DlColor kRed()
Definition dl_color.h:71
static constexpr DlColor kGreen()
Definition dl_color.h:72
static constexpr DlColor kDarkGrey()
Definition dl_color.h:77
DlColor withAlpha(uint8_t alpha) const
Definition dl_color.h:120
constexpr DlColor modulateOpacity(DlScalar opacity) const
Definition dl_color.h:150
A 4x4 matrix using column-major storage.
Definition matrix.h:37
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition matrix.h:95
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
Definition rect.h:129
flags to indicate/promise which of the optional texture coordinates or colors will be supplied during...
Definition dl_vertices.h:78