Skip to content

Commit 1badde1

Browse files
committed
gem gem
1 parent 0802ac3 commit 1badde1

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

‎engine/src/flutter/impeller/display_list/aiks_dl_vertices_unittests.cc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ TEST_P(AiksTest, DrawVerticesImageSourceWithUpperAdvancedBlendModes) {
187187
DlPoint(size.width, size.height),
188188
};
189189
std::vector<DlColor> colors = {
190-
DlColor::kRed().modulateOpacity(0.5),
191-
DlColor::kBlue().modulateOpacity(0.5),
192-
DlColor::kGreen().modulateOpacity(0.5),
193-
DlColor::kRed().modulateOpacity(0.5),
190+
DlColor::kRed().modulateOpacity(0.5f),
191+
DlColor::kBlue().modulateOpacity(0.5f),
192+
DlColor::kGreen().modulateOpacity(0.5f),
193+
DlColor::kRed().modulateOpacity(0.5f),
194194
};
195195
auto vertices =
196196
MakeVertices(DlVertexMode::kTriangleStrip, positions, {}, {}, colors);

‎engine/src/flutter/impeller/playground/yuv_test_textures.cc‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ Vector3 RGBToYUV(Vector3 rgb, YUVColorSpace yuv_color_space) {
2828
Vector3 yuv;
2929
switch (yuv_color_space) {
3030
case YUVColorSpace::kBT601FullRange:
31-
yuv.x = rgb.x * 0.299 + rgb.y * 0.587 + rgb.z * 0.114;
32-
yuv.y = rgb.x * -0.169 + rgb.y * -0.331 + rgb.z * 0.5 + 0.5;
33-
yuv.z = rgb.x * 0.5 + rgb.y * -0.419 + rgb.z * -0.081 + 0.5;
31+
yuv.x = rgb.x * 0.299f + rgb.y * 0.587f + rgb.z * 0.114f;
32+
yuv.y = rgb.x * -0.169f + rgb.y * -0.331f + rgb.z * 0.5f + 0.5f;
33+
yuv.z = rgb.x * 0.5f + rgb.y * -0.419f + rgb.z * -0.081f + 0.5f;
3434
break;
3535
case YUVColorSpace::kBT601LimitedRange:
36-
yuv.x = rgb.x * 0.257 + rgb.y * 0.516 + rgb.z * 0.100 + 0.063;
37-
yuv.y = rgb.x * -0.145 + rgb.y * -0.291 + rgb.z * 0.439 + 0.5;
38-
yuv.z = rgb.x * 0.429 + rgb.y * -0.368 + rgb.z * -0.071 + 0.5;
36+
yuv.x = rgb.x * 0.257f + rgb.y * 0.516f + rgb.z * 0.100f + 0.063f;
37+
yuv.y = rgb.x * -0.145f + rgb.y * -0.291f + rgb.z * 0.439f + 0.5f;
38+
yuv.z = rgb.x * 0.429f + rgb.y * -0.368f + rgb.z * -0.071f + 0.5f;
3939
break;
4040
}
4141
return yuv;
@@ -75,10 +75,10 @@ std::shared_ptr<Texture> CreateTextureWithData(const Context& context,
7575
std::optional<TestYUVTextures> CreateTestYUVTextures(
7676
const Context& context,
7777
YUVColorSpace yuv_color_space) {
78-
const Vector3 red = {244.0 / 255.0, 67.0 / 255.0, 54.0 / 255.0};
79-
const Vector3 green = {76.0 / 255.0, 175.0 / 255.0, 80.0 / 255.0};
80-
const Vector3 blue = {33.0 / 255.0, 150.0 / 255.0, 243.0 / 255.0};
81-
const Vector3 white = {1.0, 1.0, 1.0};
78+
const Vector3 red = {244.0f / 255.0f, 67.0f / 255.0f, 54.0f / 255.0f};
79+
const Vector3 green = {76.0f / 255.0f, 175.0f / 255.0f, 80.0f / 255.0f};
80+
const Vector3 blue = {33.0f / 255.0f, 150.0f / 255.0f, 243.0f / 255.0f};
81+
const Vector3 white = {1.0f, 1.0f, 1.0f};
8282
const std::array<Vector3, 4> yuvs = {
8383
RGBToYUV(red, yuv_color_space), RGBToYUV(green, yuv_color_space),
8484
RGBToYUV(blue, yuv_color_space), RGBToYUV(white, yuv_color_space)};
@@ -92,9 +92,9 @@ std::optional<TestYUVTextures> CreateTestYUVTextures(
9292
y_data.reserve(kYSize.Area());
9393
uv_data.reserve(kUVSize.Area() * 2);
9494
for (const Vector3& yuv : yuvs) {
95-
uint8_t y = std::round(yuv.x * 255.0);
96-
uint8_t u = std::round(yuv.y * 255.0);
97-
uint8_t v = std::round(yuv.z * 255.0);
95+
uint8_t y = std::round(yuv.x * 255.0f);
96+
uint8_t u = std::round(yuv.y * 255.0f);
97+
uint8_t v = std::round(yuv.z * 255.0f);
9898
for (int j = 0; j < kYSize.width * 2; j++) {
9999
y_data.push_back(y);
100100
}

0 commit comments

Comments
 (0)