Flutter Engine
 
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
20namespace impeller {
21namespace testing {
22
23using namespace flutter;
24
25namespace {
26std::shared_ptr<DlVertices> MakeVertices(
27 DlVertexMode mode,
28 std::vector<DlPoint> vertices,
29 std::vector<uint16_t> indices,
30 std::vector<DlPoint> texture_coordinates,
31 std::vector<DlColor> colors) {
33 {{texture_coordinates.size() > 0, colors.size() > 0}});
34 DlVertices::Builder builder(mode, vertices.size(), flags, indices.size());
35 if (colors.size() > 0) {
36 builder.store_colors(colors.data());
37 }
38 if (texture_coordinates.size() > 0) {
39 builder.store_texture_coordinates(texture_coordinates.data());
40 }
41 if (indices.size() > 0) {
42 builder.store_indices(indices.data());
43 }
44 builder.store_vertices(vertices.data());
45 return builder.build();
46}
47}; // namespace
48
49// Regression test for https://github.com/flutter/flutter/issues/135441 .
50TEST_P(AiksTest, VerticesGeometryUVPositionData) {
51 DisplayListBuilder builder;
52 DlPaint paint;
53 auto image =
54 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
55 auto size = image->impeller_texture()->GetSize();
56
57 paint.setColorSource(
58 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp));
59
60 std::vector<DlPoint> vertex_coordinates = {
61 DlPoint(0, 0),
62 DlPoint(size.width, 0),
63 DlPoint(0, size.height),
64 };
65 auto vertices = MakeVertices(DlVertexMode::kTriangleStrip, vertex_coordinates,
66 {0, 1, 2}, {}, {});
67
68 builder.DrawVertices(vertices, DlBlendMode::kSrcOver, paint);
69 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
70}
71
72// Regression test for https://github.com/flutter/flutter/issues/135441 .
73TEST_P(AiksTest, VerticesGeometryUVPositionDataWithTranslate) {
74 DisplayListBuilder builder;
75 DlPaint paint;
76 auto image =
77 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
78 auto size = image->impeller_texture()->GetSize();
79
80 DlMatrix matrix = DlMatrix::MakeTranslation({100, 100});
81 paint.setColorSource(
82 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp,
83 DlImageSampling::kLinear, &matrix));
84
85 std::vector<DlPoint> positions = {
86 DlPoint(0, 0),
87 DlPoint(size.width, 0),
88 DlPoint(0, size.height),
89 };
90 auto vertices =
91 MakeVertices(DlVertexMode::kTriangleStrip, positions, {0, 1, 2}, {}, {});
92
93 builder.DrawVertices(vertices, DlBlendMode::kSrcOver, paint);
94 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
95}
96
97// Regression test for https://github.com/flutter/flutter/issues/145707
98TEST_P(AiksTest, VerticesGeometryColorUVPositionData) {
99 DisplayListBuilder builder;
100 DlPaint paint;
101 auto image =
102 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
103 auto size = image->impeller_texture()->GetSize();
104
105 paint.setColorSource(
106 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp));
107
108 std::vector<DlPoint> positions = {
109 DlPoint(0, 0), DlPoint(size.width, 0),
110 DlPoint(0, size.height), DlPoint(size.width, 0),
111 DlPoint(0, 0), DlPoint(size.width, size.height),
112 };
113 std::vector<DlColor> colors = {
117 };
118
119 auto vertices =
120 MakeVertices(DlVertexMode::kTriangles, positions, {}, {}, colors);
121
122 builder.DrawVertices(vertices, DlBlendMode::kDstOver, paint);
123 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
124}
125
126TEST_P(AiksTest, VerticesGeometryColorUVPositionDataAdvancedBlend) {
127 DisplayListBuilder builder;
128 DlPaint paint;
129 auto image =
130 DlImageImpeller::Make(CreateTextureForFixture("table_mountain_nx.png"));
131 auto size = image->impeller_texture()->GetSize();
132
133 paint.setColorSource(
134 DlColorSource::MakeImage(image, DlTileMode::kClamp, DlTileMode::kClamp));
135
136 std::vector<DlPoint> positions = {
137 DlPoint(0, 0), DlPoint(size.width, 0),
138 DlPoint(0, size.height), DlPoint(size.width, 0),
139 DlPoint(0, 0), DlPoint(size.width, size.height),
140 };
141 std::vector<DlColor> colors = {
148 };
149
150 auto vertices =
151 MakeVertices(DlVertexMode::kTriangles, positions, {}, {}, colors);
152
153 builder.DrawVertices(vertices, DlBlendMode::kColorBurn, paint);
154 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
155}
156
157// Draw a hexagon using triangle fan
158TEST_P(AiksTest, CanConvertTriangleFanToTriangles) {
159 constexpr Scalar hexagon_radius = 125;
160 auto hex_start = Point(200.0, -hexagon_radius + 200.0);
161 auto center_to_flat = 1.73 / 2 * hexagon_radius;
162
163 // clang-format off
164 std::vector<DlPoint> vertices = {
165 DlPoint(hex_start.x, hex_start.y),
166 DlPoint(hex_start.x + center_to_flat, hex_start.y + 0.5 * hexagon_radius),
167 DlPoint(hex_start.x + center_to_flat, hex_start.y + 1.5 * hexagon_radius),
168 DlPoint(hex_start.x + center_to_flat, hex_start.y + 1.5 * hexagon_radius),
169 DlPoint(hex_start.x, hex_start.y + 2 * hexagon_radius),
170 DlPoint(hex_start.x, hex_start.y + 2 * hexagon_radius),
171 DlPoint(hex_start.x - center_to_flat, hex_start.y + 1.5 * 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 + 0.5 * hexagon_radius)
174 };
175 // clang-format on
177 auto dl_vertices = flutter::DlVertices::Make(
178 flutter::DlVertexMode::kTriangleFan, vertices.size(), vertices.data(),
179 nullptr, nullptr);
181 builder.DrawVertices(dl_vertices, flutter::DlBlendMode::kSrcOver, paint);
182 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
183}
184
185TEST_P(AiksTest, DrawVerticesSolidColorTrianglesWithoutIndices) {
186 // Use negative coordinates and then scale the transform by -1, -1 to make
187 // sure coverage is taking the transform into account.
188 std::vector<DlPoint> positions = {
189 DlPoint(-100, -300),
190 DlPoint(-200, -100),
191 DlPoint(-300, -300),
192 };
193 std::vector<flutter::DlColor> colors = {flutter::DlColor::kWhite(),
196
197 auto vertices = flutter::DlVertices::Make(
198 flutter::DlVertexMode::kTriangles, 3, positions.data(),
199 /*texture_coordinates=*/nullptr, colors.data());
200
202 flutter::DlPaint paint;
203
204 paint.setColor(flutter::DlColor::kRed().modulateOpacity(0.5));
205 builder.Scale(-1, -1);
206 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
207
208 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
209}
210
211TEST_P(AiksTest, DrawVerticesLinearGradientWithoutIndices) {
212 std::vector<DlPoint> positions = {
213 DlPoint(100, 300),
214 DlPoint(200, 100),
215 DlPoint(300, 300),
216 };
217
218 auto vertices = flutter::DlVertices::Make(
219 flutter::DlVertexMode::kTriangles, 3, positions.data(),
220 /*texture_coordinates=*/nullptr, /*colors=*/nullptr);
221
222 std::vector<flutter::DlColor> colors = {flutter::DlColor::kBlue(),
224 const float stops[2] = {0.0, 1.0};
225
227 {100.0, 100.0}, {300.0, 300.0}, 2, colors.data(), stops,
229
231 flutter::DlPaint paint;
232
233 paint.setColorSource(linear);
234 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
235
236 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
237}
238
239TEST_P(AiksTest, DrawVerticesLinearGradientWithTextureCoordinates) {
240 std::vector<DlPoint> positions = {
241 DlPoint(100, 300),
242 DlPoint(200, 100),
243 DlPoint(300, 300),
244 };
245 std::vector<DlPoint> texture_coordinates = {
246 DlPoint(300, 100),
247 DlPoint(100, 200),
248 DlPoint(300, 300),
249 };
250
251 auto vertices = flutter::DlVertices::Make(
252 flutter::DlVertexMode::kTriangles, 3, positions.data(),
253 texture_coordinates.data(), /*colors=*/nullptr);
254
255 std::vector<flutter::DlColor> colors = {flutter::DlColor::kBlue(),
257 const float stops[2] = {0.0, 1.0};
258
260 {100.0, 100.0}, {300.0, 300.0}, 2, colors.data(), stops,
262
264 flutter::DlPaint paint;
265
266 paint.setColorSource(linear);
267 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
268
269 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
270}
271
272TEST_P(AiksTest, DrawVerticesImageSourceWithTextureCoordinates) {
273 auto texture = CreateTextureForFixture("embarcadero.jpg");
274 auto dl_image = DlImageImpeller::Make(texture);
275 std::vector<DlPoint> positions = {
276 DlPoint(100, 300),
277 DlPoint(200, 100),
278 DlPoint(300, 300),
279 };
280 std::vector<DlPoint> texture_coordinates = {
281 DlPoint(0, 0),
282 DlPoint(100, 200),
283 DlPoint(200, 100),
284 };
285
286 auto vertices = flutter::DlVertices::Make(
287 flutter::DlVertexMode::kTriangles, 3, positions.data(),
288 texture_coordinates.data(), /*colors=*/nullptr);
289
291 flutter::DlPaint paint;
292
293 auto image_source = flutter::DlColorSource::MakeImage(
295
296 paint.setColorSource(image_source);
297 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
298
299 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
300}
301
303 DrawVerticesImageSourceWithTextureCoordinatesAndColorBlending) {
304 auto texture = CreateTextureForFixture("embarcadero.jpg");
305 auto dl_image = DlImageImpeller::Make(texture);
306 std::vector<DlPoint> positions = {
307 DlPoint(100, 300),
308 DlPoint(200, 100),
309 DlPoint(300, 300),
310 };
311 std::vector<flutter::DlColor> colors = {flutter::DlColor::kWhite(),
314 std::vector<DlPoint> texture_coordinates = {
315 DlPoint(0, 0),
316 DlPoint(100, 200),
317 DlPoint(200, 100),
318 };
319
320 auto vertices = flutter::DlVertices::Make(
321 flutter::DlVertexMode::kTriangles, 3, positions.data(),
322 texture_coordinates.data(), colors.data());
323
325 flutter::DlPaint paint;
326
327 auto image_source = flutter::DlColorSource::MakeImage(
329
330 paint.setColorSource(image_source);
331 builder.DrawVertices(vertices, flutter::DlBlendMode::kModulate, paint);
332
333 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
334}
335
336TEST_P(AiksTest, DrawVerticesSolidColorTrianglesWithIndices) {
337 std::vector<DlPoint> positions = {
338 DlPoint(100, 300),
339 DlPoint(200, 100),
340 DlPoint(300, 300),
341 DlPoint(200, 500),
342 };
343 std::vector<uint16_t> indices = {0, 1, 2, 0, 2, 3};
344
345 auto vertices = flutter::DlVertices::Make(
346 flutter::DlVertexMode::kTriangles, positions.size(), positions.data(),
347 /*texture_coordinates=*/nullptr, /*colors=*/nullptr, indices.size(),
348 indices.data());
349
351 flutter::DlPaint paint;
352
354 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
355
356 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
357}
358
359TEST_P(AiksTest, DrawVerticesPremultipliesColors) {
360 std::vector<DlPoint> positions = {
361 DlPoint(100, 300),
362 DlPoint(200, 100),
363 DlPoint(300, 300),
364 DlPoint(200, 500),
365 };
366 auto color = flutter::DlColor::kBlue().withAlpha(0x99);
367 std::vector<uint16_t> indices = {0, 1, 2, 0, 2, 3};
368 std::vector<flutter::DlColor> colors = {color, color, color, color};
369
370 auto vertices = flutter::DlVertices::Make(
371 flutter::DlVertexMode::kTriangles, positions.size(), positions.data(),
372 /*texture_coordinates=*/nullptr, colors.data(), indices.size(),
373 indices.data());
374
376 flutter::DlPaint paint;
377 paint.setBlendMode(flutter::DlBlendMode::kSrcOver);
379
380 builder.DrawRect(DlRect::MakeLTRB(0, 0, 400, 400), paint);
381 builder.DrawVertices(vertices, flutter::DlBlendMode::kDst, paint);
382
383 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
384}
385
386TEST_P(AiksTest, DrawVerticesWithInvalidIndices) {
387 std::vector<DlPoint> positions = {
388 DlPoint(100, 300),
389 DlPoint(200, 100),
390 DlPoint(300, 300),
391 DlPoint(200, 500),
392 };
393 std::vector<uint16_t> indices = {0, 1, 2, 0, 2, 3, 99, 100, 101};
394
395 auto vertices = flutter::DlVertices::Make(
396 flutter::DlVertexMode::kTriangles, positions.size(), positions.data(),
397 /*texture_coordinates=*/nullptr, /*colors=*/nullptr, indices.size(),
398 indices.data());
399
400 EXPECT_EQ(vertices->GetBounds(), DlRect::MakeLTRB(100, 100, 300, 500));
401
403 flutter::DlPaint paint;
404 paint.setBlendMode(flutter::DlBlendMode::kSrcOver);
406
407 builder.DrawRect(DlRect::MakeLTRB(0, 0, 400, 400), paint);
408 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrc, paint);
409
410 AiksContext renderer(GetContext(), nullptr);
411 std::shared_ptr<Texture> image =
412 DisplayListToTexture(builder.Build(), {1024, 768}, renderer);
413 EXPECT_TRUE(image);
414}
415
416// All four vertices should form a solid red rectangle with no gaps.
417// The blue rectangle drawn under them should not be visible.
418TEST_P(AiksTest, DrawVerticesTextureCoordinatesWithFragmentShader) {
419 std::vector<DlPoint> positions_lt = {
420 DlPoint(0, 0), //
421 DlPoint(50, 0), //
422 DlPoint(0, 50), //
423 DlPoint(50, 50), //
424 };
425
426 auto vertices_lt = flutter::DlVertices::Make(
427 flutter::DlVertexMode::kTriangleStrip, positions_lt.size(),
428 positions_lt.data(),
429 /*texture_coordinates=*/positions_lt.data(), /*colors=*/nullptr,
430 /*index_count=*/0,
431 /*indices=*/nullptr);
432
433 std::vector<DlPoint> positions_rt = {
434 DlPoint(50, 0), //
435 DlPoint(100, 0), //
436 DlPoint(50, 50), //
437 DlPoint(100, 50), //
438 };
439
440 auto vertices_rt = flutter::DlVertices::Make(
441 flutter::DlVertexMode::kTriangleStrip, positions_rt.size(),
442 positions_rt.data(),
443 /*texture_coordinates=*/positions_rt.data(), /*colors=*/nullptr,
444 /*index_count=*/0,
445 /*indices=*/nullptr);
446
447 std::vector<DlPoint> positions_lb = {
448 DlPoint(0, 50), //
449 DlPoint(50, 50), //
450 DlPoint(0, 100), //
451 DlPoint(50, 100), //
452 };
453
454 auto vertices_lb = flutter::DlVertices::Make(
455 flutter::DlVertexMode::kTriangleStrip, positions_lb.size(),
456 positions_lb.data(),
457 /*texture_coordinates=*/positions_lb.data(), /*colors=*/nullptr,
458 /*index_count=*/0,
459 /*indices=*/nullptr);
460
461 std::vector<DlPoint> positions_rb = {
462 DlPoint(50, 50), //
463 DlPoint(100, 50), //
464 DlPoint(50, 100), //
465 DlPoint(100, 100), //
466 };
467
468 auto vertices_rb = flutter::DlVertices::Make(
469 flutter::DlVertexMode::kTriangleStrip, positions_rb.size(),
470 positions_rb.data(),
471 /*texture_coordinates=*/positions_rb.data(), /*colors=*/nullptr,
472 /*index_count=*/0,
473 /*indices=*/nullptr);
474
476 flutter::DlPaint paint;
477 flutter::DlPaint rect_paint;
478 rect_paint.setColor(DlColor::kBlue());
479
480 auto runtime_stages =
481 OpenAssetAsRuntimeStage("runtime_stage_simple.frag.iplr");
482
483 auto runtime_stage =
484 runtime_stages[PlaygroundBackendToRuntimeStageBackend(GetBackend())];
485 ASSERT_TRUE(runtime_stage);
486
487 auto runtime_effect = DlRuntimeEffectImpeller::Make(runtime_stage);
488 auto uniform_data = std::make_shared<std::vector<uint8_t>>();
490 runtime_effect, {}, uniform_data);
491
492 paint.setColorSource(color_source);
493
494 builder.Scale(GetContentScale().x, GetContentScale().y);
495 builder.Save();
496 builder.DrawRect(DlRect::MakeLTRB(0, 0, 100, 100), rect_paint);
497 builder.DrawVertices(vertices_lt, flutter::DlBlendMode::kSrcOver, paint);
498 builder.DrawVertices(vertices_rt, flutter::DlBlendMode::kSrcOver, paint);
499 builder.DrawVertices(vertices_lb, flutter::DlBlendMode::kSrcOver, paint);
500 builder.DrawVertices(vertices_rb, flutter::DlBlendMode::kSrcOver, paint);
501 builder.Restore();
502
503 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
504}
505
506// The vertices should form a solid red rectangle with no gaps.
507// The blue rectangle drawn under them should not be visible.
509 DrawVerticesTextureCoordinatesWithFragmentShaderNonZeroOrigin) {
510 std::vector<DlPoint> positions_lt = {
511 DlPoint(200, 200), //
512 DlPoint(250, 200), //
513 DlPoint(200, 250), //
514 DlPoint(250, 250), //
515 };
516
517 auto vertices = flutter::DlVertices::Make(
518 flutter::DlVertexMode::kTriangleStrip, positions_lt.size(),
519 positions_lt.data(),
520 /*texture_coordinates=*/positions_lt.data(), /*colors=*/nullptr,
521 /*index_count=*/0,
522 /*indices=*/nullptr);
523
525 flutter::DlPaint paint;
526 flutter::DlPaint rect_paint;
527 rect_paint.setColor(DlColor::kBlue());
528
529 auto runtime_stages =
530 OpenAssetAsRuntimeStage("runtime_stage_position.frag.iplr");
531
532 auto runtime_stage =
533 runtime_stages[PlaygroundBackendToRuntimeStageBackend(GetBackend())];
534 ASSERT_TRUE(runtime_stage);
535
536 auto runtime_effect = DlRuntimeEffectImpeller::Make(runtime_stage);
537 auto rect_data = std::vector<Rect>{Rect::MakeLTRB(200, 200, 250, 250)};
538
539 auto uniform_data = std::make_shared<std::vector<uint8_t>>();
540 uniform_data->resize(rect_data.size() * sizeof(Rect));
541 memcpy(uniform_data->data(), rect_data.data(), uniform_data->size());
542
544 runtime_effect, {}, uniform_data);
545
546 paint.setColorSource(color_source);
547
548 builder.Scale(GetContentScale().x, GetContentScale().y);
549 builder.DrawRect(DlRect::MakeLTRB(200, 200, 250, 250), rect_paint);
550 builder.DrawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint);
551
552 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
553}
554
555// Regression test for https://github.com/flutter/flutter/issues/170480 .
556TEST_P(AiksTest, VerticesGeometryWithMaskFilter) {
557 DisplayListBuilder builder;
558 DlPaint paint;
559 paint.setMaskFilter(DlBlurMaskFilter::Make(DlBlurStyle::kNormal, 10));
560
561 std::vector<DlPoint> vertex_coordinates = {
562 DlPoint(0, 0),
563 DlPoint(400, 0),
564 DlPoint(0, 400),
565 };
566 auto vertices = MakeVertices(DlVertexMode::kTriangleStrip, vertex_coordinates,
567 {0, 1, 2}, {}, {});
568
569 builder.DrawVertices(vertices, DlBlendMode::kSrcOver, paint);
570 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
571}
572
573} // namespace testing
574} // 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)
std::shared_ptr< Texture > DisplayListToTexture(const sk_sp< flutter::DisplayList > &display_list, ISize size, AiksContext &context, bool reset_host_buffer, bool generate_mips)
Render the provided display list to a texture with the given size.
float Scalar
Definition scalar.h:19
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