[DisplayList] Use internal conversion for opacity->alpha (#165349)

Removing an unnecessary dependence on an external library for doing
opacity->alpha conversions in DlPaint.
This commit is contained in:
Jim Graham
2025-03-17 18:09:13 -07:00
committed by GitHub
parent 879d80fde4
commit c5d4edfe9c

View File

@@ -76,8 +76,7 @@ class DlPaint {
DlPaint& setAlpha(uint8_t alpha) { return setColor(color_.withAlpha(alpha)); }
DlScalar getOpacity() const { return color_.getAlphaF(); }
DlPaint& setOpacity(DlScalar opacity) {
setAlpha(SkScalarRoundToInt(opacity * 0xff));
return *this;
return setAlpha(DlColor::toAlpha(opacity));
}
DlBlendMode getBlendMode() const {