From 677c70aa8a274b3a74fec4a2f9457c5f773794b1 Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 04:27:48 +0000 Subject: [PATCH] Reverts "Hooks up framework wide gamut to engine wide gamut (#54567)" (flutter/engine#54884) Reverts: flutter/engine#54567 Initiated by: chingjun Reason for reverting: Breaking internal tests. See b/363125155 Original PR Author: gaaclarke Reviewed By: {jonahwilliams, chinmaygarde} This change reverts the following previous change: issue: https://github.com/flutter/flutter/issues/127855 integration test: https://github.com/flutter/engine/pull/54415 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../display_list/aiks_dl_vertices_unittests.cc | 6 +----- engine/src/flutter/lib/ui/painting/paint.cc | 13 ++++++++----- .../testing/impeller_golden_tests_output.txt | 3 +++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/engine/src/flutter/impeller/display_list/aiks_dl_vertices_unittests.cc b/engine/src/flutter/impeller/display_list/aiks_dl_vertices_unittests.cc index e66ac91996..fdcd5b2b68 100644 --- a/engine/src/flutter/impeller/display_list/aiks_dl_vertices_unittests.cc +++ b/engine/src/flutter/impeller/display_list/aiks_dl_vertices_unittests.cc @@ -12,7 +12,6 @@ #include "flutter/display_list/dl_color.h" #include "flutter/display_list/dl_paint.h" #include "flutter/testing/testing.h" -#include "impeller/display_list/dl_dispatcher.h" #include "impeller/display_list/dl_image_impeller.h" namespace impeller { @@ -376,10 +375,7 @@ TEST_P(AiksTest, DrawVerticesWithInvalidIndices) { builder.DrawRect(SkRect::MakeLTRB(0, 0, 400, 400), paint); builder.DrawVertices(vertices, flutter::DlBlendMode::kSrc, paint); - AiksContext renderer(GetContext(), nullptr); - std::shared_ptr image = - DisplayListToTexture(builder.Build(), {1024, 768}, renderer); - EXPECT_TRUE(image); + ASSERT_TRUE(OpenPlaygroundHere(builder.Build())); } // All four vertices should form a solid red rectangle with no gaps. diff --git a/engine/src/flutter/lib/ui/painting/paint.cc b/engine/src/flutter/lib/ui/painting/paint.cc index 19a535520c..ab746738bb 100644 --- a/engine/src/flutter/lib/ui/painting/paint.cc +++ b/engine/src/flutter/lib/ui/painting/paint.cc @@ -71,11 +71,14 @@ DlColor ReadColor(const tonic::DartByteData& byte_data) { // Invert alpha so 0 initialized buffer has default value; float alpha = 1.f - float_data[kColorAlphaIndex]; uint32_t colorspace = uint_data[kColorSpaceIndex]; - - DlColor dl_color(alpha, red, green, blue, - static_cast(colorspace)); - - return dl_color.withColorSpace(DlColorSpace::kExtendedSRGB); + (void)colorspace; + uint32_t encoded_color = + static_cast(std::round(alpha * 255.f)) << 24 | // + static_cast(std::round(red * 255.f)) << 16 | // + static_cast(std::round(green * 255.f)) << 8 | // + static_cast(std::round(blue * 255.f)) << 0; + // TODO(gaaclarke): Pass down color info to DlColor. + return DlColor(encoded_color); } } // namespace diff --git a/engine/src/flutter/testing/impeller_golden_tests_output.txt b/engine/src/flutter/testing/impeller_golden_tests_output.txt index d219c25783..f212cbfa0f 100644 --- a/engine/src/flutter/testing/impeller_golden_tests_output.txt +++ b/engine/src/flutter/testing/impeller_golden_tests_output.txt @@ -614,6 +614,9 @@ impeller_Play_AiksTest_DrawVerticesTextureCoordinatesWithFragmentShaderNonZeroOr impeller_Play_AiksTest_DrawVerticesTextureCoordinatesWithFragmentShader_Metal.png impeller_Play_AiksTest_DrawVerticesTextureCoordinatesWithFragmentShader_OpenGLES.png impeller_Play_AiksTest_DrawVerticesTextureCoordinatesWithFragmentShader_Vulkan.png +impeller_Play_AiksTest_DrawVerticesWithInvalidIndices_Metal.png +impeller_Play_AiksTest_DrawVerticesWithInvalidIndices_OpenGLES.png +impeller_Play_AiksTest_DrawVerticesWithInvalidIndices_Vulkan.png impeller_Play_AiksTest_EmptySaveLayerIgnoresPaint_Metal.png impeller_Play_AiksTest_EmptySaveLayerIgnoresPaint_OpenGLES.png impeller_Play_AiksTest_EmptySaveLayerIgnoresPaint_Vulkan.png