[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user