-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#46122Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine team
Description
Blocks #134969.
I'm requesting help if anyone could use a simple~ish task to work on in the background.
The work required is roughly the following:
--- a/display_list/dl_color.h
+++ b/display_list/dl_color.h
@@ -12,7 +12,7 @@ namespace flutter {
struct DlColor {
public:
constexpr DlColor() : argb(0xFF000000) {}
- constexpr DlColor(uint32_t argb) : argb(argb) {}
+ constexpr explicit DlColor(uint32_t argb) : argb(argb) {}
static constexpr uint8_t toAlpha(SkScalar opacity) { return toC(opacity); }
static constexpr SkScalar toOpacity(uint8_t alpha) { return toF(alpha); }
@@ -77,7 +77,7 @@ struct DlColor {
: withAlpha(round(getAlpha() * opacity));
}
- operator uint32_t() const { return argb; }
+ explicit operator uint32_t() const { return argb; }
bool operator==(DlColor const& other) const { return argb == other.argb; }
bool operator!=(DlColor const& other) const { return argb != other.argb; }
bool operator==(uint32_t const& other) const { return argb == other; }... and then changing the rest of the repository to use DlColor(int_color) explicitly.
For going the other way, i.e. DlColor -> uint32_t(), I'd probably recommend just deleting the operator above, and adding into dl_sk_conversions something like:
inline SkColor ToSk(DlColor color) {
return static_cast<SkColor>(color);
}... for consistency.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine team