Skip to content

Commit

Permalink
[Impeller] move Aiks path unittests to DL (flutter#53799)
Browse files Browse the repository at this point in the history
Move more impeller tests to display list format. This allows our integration tests to also test the display list -> aiks interop and be future compatible with the new canvas backend that removes AIKS.

Part of flutter/flutter#142054
  • Loading branch information
jonahwilliams authored Jul 12, 2024
1 parent b555f8f commit d4df563
Show file tree
Hide file tree
Showing 7 changed files with 479 additions and 464 deletions.
1 change: 0 additions & 1 deletion ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
../../../flutter/impeller/aiks/aiks_blend_unittests.cc
../../../flutter/impeller/aiks/aiks_blur_unittests.cc
../../../flutter/impeller/aiks/aiks_gradient_unittests.cc
../../../flutter/impeller/aiks/aiks_path_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.cc
../../../flutter/impeller/aiks/aiks_unittests.h
../../../flutter/impeller/aiks/canvas_unittests.cc
Expand Down
9 changes: 9 additions & 0 deletions display_list/dl_color.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ struct DlColor {
constexpr DlColor() : argb_(0xFF000000) {}
constexpr explicit DlColor(uint32_t argb) : argb_(argb) {}

/// @brief Construct a 32 bit color from a floating point A, R, G, and B color
/// channel.
constexpr explicit DlColor(SkScalar a, SkScalar r, SkScalar g, SkScalar b)
: argb_(static_cast<uint8_t>(std::round(a * 255)) << 24 | //
static_cast<uint8_t>(std::round(r * 255)) << 16 | //
static_cast<uint8_t>(std::round(g * 255)) << 8 | //
static_cast<uint8_t>(std::round(b * 255)) << 0 //
) {}

static constexpr uint8_t toAlpha(SkScalar opacity) { return toC(opacity); }
static constexpr SkScalar toOpacity(uint8_t alpha) { return toF(alpha); }

Expand Down
1 change: 0 additions & 1 deletion impeller/aiks/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ template("aiks_unittests_component") {
"aiks_blend_unittests.cc",
"aiks_blur_unittests.cc",
"aiks_gradient_unittests.cc",
"aiks_path_unittests.cc",
"aiks_unittests.cc",
"aiks_unittests.h",
]
Expand Down
Loading

0 comments on commit d4df563

Please sign in to comment.