mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update euclid
This commit is contained in:
parent
b944a6e281
commit
fccfff11c5
15 changed files with 5 additions and 84 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1479,9 +1479,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "euclid"
|
||||
version = "0.20.3"
|
||||
version = "0.20.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f46a3516f04c5e05870f71ae6242a97e8f72ee12cfc2f7f5deb16111a98b0670"
|
||||
checksum = "a8813df82772c5ef4c2e9cd4a986773c125ffeafdc08204c9d5c2f06e0abdc17"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
"serde",
|
||||
|
|
|
@ -1057,7 +1057,7 @@ impl<'a> CanvasData<'a> {
|
|||
self.drawtarget.get_format(),
|
||||
);
|
||||
let matrix = Transform2D::identity()
|
||||
.pre_translate(-source_rect.origin.to_vector().cast())
|
||||
.pre_translate(-source_rect.origin.to_vector().cast::<f32>())
|
||||
.pre_transform(&self.state.transform);
|
||||
draw_target.set_transform(&matrix);
|
||||
draw_target
|
||||
|
@ -1198,22 +1198,6 @@ impl RectToi32 for Rect<f64> {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait Size2DExt {
|
||||
fn to_u64(&self) -> Size2D<u64>;
|
||||
}
|
||||
|
||||
impl Size2DExt for Size2D<f64> {
|
||||
fn to_u64(&self) -> Size2D<u64> {
|
||||
self.cast()
|
||||
}
|
||||
}
|
||||
|
||||
impl Size2DExt for Size2D<u32> {
|
||||
fn to_u64(&self) -> Size2D<u64> {
|
||||
self.cast()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait RectExt {
|
||||
fn to_u64(&self) -> Rect<u64>;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ use crate::dom::node::{Node, NodeDamage};
|
|||
use crate::dom::offscreencanvas::{OffscreenCanvas, OffscreenCanvasContext};
|
||||
use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
|
||||
use crate::dom::textmetrics::TextMetrics;
|
||||
use crate::euclidext::Size2DExt;
|
||||
use crate::unpremultiplytable::UNPREMULTIPLY_TABLE;
|
||||
use canvas_traits::canvas::{Canvas2dMsg, CanvasId, CanvasMsg};
|
||||
use canvas_traits::canvas::{CompositionOrBlending, FillOrStrokeStyle, FillRule};
|
||||
|
|
|
@ -22,7 +22,6 @@ use crate::dom::globalscope::GlobalScope;
|
|||
use crate::dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use crate::dom::imagedata::ImageData;
|
||||
use crate::dom::textmetrics::TextMetrics;
|
||||
use crate::euclidext::Size2DExt;
|
||||
use canvas_traits::canvas::{Canvas2dMsg, CanvasId, CanvasMsg};
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
|
|
|
@ -27,7 +27,6 @@ use crate::dom::webgl2renderingcontext::WebGL2RenderingContext;
|
|||
use crate::dom::webglrenderingcontext::{
|
||||
LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext,
|
||||
};
|
||||
use crate::euclidext::Size2DExt;
|
||||
use crate::script_runtime::JSContext;
|
||||
use base64;
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg, FromScriptMsg};
|
||||
|
|
|
@ -184,13 +184,3 @@ impl ImageDataMethods for ImageData {
|
|||
NonNull::new(self.data.get()).expect("got a null pointer")
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Size2DExt {
|
||||
fn to_u64(&self) -> Size2D<u64>;
|
||||
}
|
||||
|
||||
impl Size2DExt for Size2D<u32> {
|
||||
fn to_u64(&self) -> Size2D<u64> {
|
||||
return Size2D::new(self.width as u64, self.height as u64);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ use crate::dom::canvaspattern::CanvasPattern;
|
|||
use crate::dom::canvasrenderingcontext2d::CanvasRenderingContext2D;
|
||||
use crate::dom::dommatrix::DOMMatrix;
|
||||
use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
|
||||
use crate::euclidext::Size2DExt;
|
||||
use canvas_traits::canvas::CanvasImageData;
|
||||
use canvas_traits::canvas::CanvasMsg;
|
||||
use canvas_traits::canvas::FromLayoutMsg;
|
||||
|
|
|
@ -25,8 +25,7 @@ use crate::dom::webglprogram::WebGLProgram;
|
|||
use crate::dom::webglquery::WebGLQuery;
|
||||
use crate::dom::webglrenderbuffer::WebGLRenderbuffer;
|
||||
use crate::dom::webglrenderingcontext::{
|
||||
uniform_get, uniform_typed, LayoutCanvasWebGLRenderingContextHelpers, Size2DExt,
|
||||
WebGLRenderingContext,
|
||||
uniform_get, uniform_typed, LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext,
|
||||
};
|
||||
use crate::dom::webglsampler::{WebGLSampler, WebGLSamplerValue};
|
||||
use crate::dom::webglshader::WebGLShader;
|
||||
|
|
|
@ -2,29 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use euclid::default::{Rect, Size2D};
|
||||
|
||||
pub trait Size2DExt {
|
||||
fn to_u64(&self) -> Size2D<u64>;
|
||||
}
|
||||
|
||||
impl Size2DExt for Size2D<f32> {
|
||||
fn to_u64(&self) -> Size2D<u64> {
|
||||
self.cast()
|
||||
}
|
||||
}
|
||||
|
||||
impl Size2DExt for Size2D<f64> {
|
||||
fn to_u64(&self) -> Size2D<u64> {
|
||||
self.cast()
|
||||
}
|
||||
}
|
||||
|
||||
impl Size2DExt for Size2D<u32> {
|
||||
fn to_u64(&self) -> Size2D<u64> {
|
||||
self.cast()
|
||||
}
|
||||
}
|
||||
use euclid::default::Rect;
|
||||
|
||||
pub trait RectExt {
|
||||
fn to_u64(&self) -> Rect<u64>;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[2d.path.stroke.scale2.html]
|
||||
type: testharness
|
||||
[Stroke line widths are scaled by the current transformation matrix]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[2d.path.stroke.skew.html]
|
||||
type: testharness
|
||||
[Strokes lines are skewed by the current transformation matrix]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.path.stroke.scale2.html]
|
||||
[Stroke line widths are scaled by the current transformation matrix]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.path.stroke.scale2.worker.html]
|
||||
[Stroke line widths are scaled by the current transformation matrix]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.path.stroke.skew.html]
|
||||
[Strokes lines are skewed by the current transformation matrix]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.path.stroke.skew.worker.html]
|
||||
[Strokes lines are skewed by the current transformation matrix]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue