canvas: Use Transform2D<f64> instead of Transform2D<f32> (#38316)

I mostly did dumb replacement so please check that this is correct. In
addition, `canvas_data::draw_with_shadow` needs some a bit of a closer
look.

Testing: This is covered by existing tests, and it is likely that WPT
tests are unaffected by the precision of the transform, even though it
is technically more correct.
Fixes: #38256

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-08-11 18:46:25 +02:00 committed by GitHub
parent 4ff1e8dbd9
commit 3f7f9ba6cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 91 additions and 97 deletions

View file

@ -462,7 +462,7 @@ pub enum Canvas2dMsg {
bool,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
DrawEmptyImage(
Size2D<u32>,
@ -470,7 +470,7 @@ pub enum Canvas2dMsg {
Rect<f64>,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
DrawImageInOther(
CanvasId,
@ -479,10 +479,10 @@ pub enum Canvas2dMsg {
bool,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
ClearRect(Rect<f32>, Transform2D<f32>),
ClipPath(Path, FillRule, Transform2D<f32>),
ClearRect(Rect<f32>, Transform2D<f64>),
ClipPath(Path, FillRule, Transform2D<f64>),
PopClips(usize),
FillPath(
FillOrStrokeStyle,
@ -490,7 +490,7 @@ pub enum Canvas2dMsg {
FillRule,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
FillText(
String,
@ -502,14 +502,14 @@ pub enum Canvas2dMsg {
TextOptions,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
FillRect(
Rect<f32>,
FillOrStrokeStyle,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
GetImageData(Option<Rect<u32>>, IpcSender<IpcSnapshot>),
MeasureText(String, IpcSender<TextMetrics>, TextOptions),
@ -520,7 +520,7 @@ pub enum Canvas2dMsg {
LineOptions,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
StrokePath(
Path,
@ -528,7 +528,7 @@ pub enum Canvas2dMsg {
LineOptions,
ShadowOptions,
CompositionOptions,
Transform2D<f32>,
Transform2D<f64>,
),
UpdateImage(IpcSender<()>),
}