6#include "flutter/impeller/aiks/aiks_unittests.h"
8#include "flutter/display_list/dl_blend_mode.h"
9#include "flutter/display_list/dl_builder.h"
10#include "flutter/display_list/dl_color.h"
11#include "flutter/display_list/dl_paint.h"
12#include "flutter/testing/testing.h"
33 auto size =
atlas->impeller_texture()->GetSize();
37 std::vector<SkRect> texture_coordinates = {
43 std::vector<SkRSXform> transforms = {
44 MakeTranslation(0, 0), MakeTranslation(half_width, 0),
45 MakeTranslation(0, half_height),
46 MakeTranslation(half_width, half_height)};
47 return std::make_tuple(texture_coordinates, transforms,
atlas);
54 auto [texture_coordinates, transforms,
atlas] = CreateTestData(
this);
56 builder.Scale(GetContentScale().
x, GetContentScale().
y);
57 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
58 nullptr, 4, DlBlendMode::kSrcOver,
61 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
66 auto [texture_coordinates, transforms,
atlas] = CreateTestData(
this);
71 builder.Scale(GetContentScale().
x, GetContentScale().
y);
72 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
73 colors.data(), 4, DlBlendMode::kModulate,
76 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
82 auto [texture_coordinates, transforms,
atlas] = CreateTestData(
this);
87 builder.Scale(GetContentScale().
x, GetContentScale().
y);
88 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
89 colors.data(), 4, DlBlendMode::kSrcATop,
92 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
99 auto [texture_coordinates, transforms,
atlas] = CreateTestData(
this);
103 builder.Scale(GetContentScale().
x, GetContentScale().
y);
104 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
105 nullptr, 4, DlBlendMode::kSrcOver,
109 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
114 auto size =
atlas->impeller_texture()->GetSize();
115 std::vector<SkRect> texture_coordinates = {
117 std::vector<SkRSXform> transforms = {MakeTranslation(0, 0)};
120 builder.Scale(GetContentScale().
x, GetContentScale().
y);
121 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
122 nullptr, 1, DlBlendMode::kSrcOver,
125 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
132 auto [texture_coordinates, transforms,
atlas] = CreateTestData(
this);
135 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
136 nullptr, 4, DlBlendMode::kModulate,
139 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
146 auto [texture_coordinates, transforms,
atlas] = CreateTestData(
this);
151 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
152 colors.data(), 4, DlBlendMode::kModulate,
155 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
160 EXPECT_EQ(
GetContext()->GetCapabilities()->GetDefaultColorFormat(),
164 auto [texture_coordinates, transforms,
atlas] = CreateTestData(
this);
168 builder.DrawAtlas(
atlas, transforms.data(), texture_coordinates.data(),
169 colors.data(), 4, DlBlendMode::kPlus,
172 ASSERT_TRUE(OpenPlaygroundHere(
builder.Build()));
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
SK_API GrDirectContext * GetContext(const SkImage *src)
sk_sp< const SkImage > atlas
PODArray< SkColor > colors
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
TEST_P(AiksTest, CanRenderAdvancedBlendColorFilterWithSaveLayer)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
static constexpr DlColor kBlue()
static constexpr DlColor kYellow()
static constexpr DlColor kRed()
static constexpr DlColor kGreen()