Update euclid

This commit is contained in:
Manish Goregaokar 2020-04-06 17:41:55 -07:00
parent b944a6e281
commit fccfff11c5
15 changed files with 5 additions and 84 deletions

4
Cargo.lock generated
View file

@ -1479,9 +1479,9 @@ dependencies = [
[[package]] [[package]]
name = "euclid" name = "euclid"
version = "0.20.3" version = "0.20.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46a3516f04c5e05870f71ae6242a97e8f72ee12cfc2f7f5deb16111a98b0670" checksum = "a8813df82772c5ef4c2e9cd4a986773c125ffeafdc08204c9d5c2f06e0abdc17"
dependencies = [ dependencies = [
"num-traits", "num-traits",
"serde", "serde",

View file

@ -1057,7 +1057,7 @@ impl<'a> CanvasData<'a> {
self.drawtarget.get_format(), self.drawtarget.get_format(),
); );
let matrix = Transform2D::identity() 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); .pre_transform(&self.state.transform);
draw_target.set_transform(&matrix); draw_target.set_transform(&matrix);
draw_target 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 { pub trait RectExt {
fn to_u64(&self) -> Rect<u64>; fn to_u64(&self) -> Rect<u64>;
} }

View file

@ -26,7 +26,6 @@ use crate::dom::node::{Node, NodeDamage};
use crate::dom::offscreencanvas::{OffscreenCanvas, OffscreenCanvasContext}; use crate::dom::offscreencanvas::{OffscreenCanvas, OffscreenCanvasContext};
use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope; use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
use crate::dom::textmetrics::TextMetrics; use crate::dom::textmetrics::TextMetrics;
use crate::euclidext::Size2DExt;
use crate::unpremultiplytable::UNPREMULTIPLY_TABLE; use crate::unpremultiplytable::UNPREMULTIPLY_TABLE;
use canvas_traits::canvas::{Canvas2dMsg, CanvasId, CanvasMsg}; use canvas_traits::canvas::{Canvas2dMsg, CanvasId, CanvasMsg};
use canvas_traits::canvas::{CompositionOrBlending, FillOrStrokeStyle, FillRule}; use canvas_traits::canvas::{CompositionOrBlending, FillOrStrokeStyle, FillRule};

View file

@ -22,7 +22,6 @@ use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlcanvaselement::HTMLCanvasElement; use crate::dom::htmlcanvaselement::HTMLCanvasElement;
use crate::dom::imagedata::ImageData; use crate::dom::imagedata::ImageData;
use crate::dom::textmetrics::TextMetrics; use crate::dom::textmetrics::TextMetrics;
use crate::euclidext::Size2DExt;
use canvas_traits::canvas::{Canvas2dMsg, CanvasId, CanvasMsg}; use canvas_traits::canvas::{Canvas2dMsg, CanvasId, CanvasMsg};
use dom_struct::dom_struct; use dom_struct::dom_struct;
use euclid::default::{Point2D, Rect, Size2D}; use euclid::default::{Point2D, Rect, Size2D};

View file

@ -27,7 +27,6 @@ use crate::dom::webgl2renderingcontext::WebGL2RenderingContext;
use crate::dom::webglrenderingcontext::{ use crate::dom::webglrenderingcontext::{
LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext, LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext,
}; };
use crate::euclidext::Size2DExt;
use crate::script_runtime::JSContext; use crate::script_runtime::JSContext;
use base64; use base64;
use canvas_traits::canvas::{CanvasId, CanvasMsg, FromScriptMsg}; use canvas_traits::canvas::{CanvasId, CanvasMsg, FromScriptMsg};

View file

@ -184,13 +184,3 @@ impl ImageDataMethods for ImageData {
NonNull::new(self.data.get()).expect("got a null pointer") 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);
}
}

View file

@ -21,7 +21,6 @@ use crate::dom::canvaspattern::CanvasPattern;
use crate::dom::canvasrenderingcontext2d::CanvasRenderingContext2D; use crate::dom::canvasrenderingcontext2d::CanvasRenderingContext2D;
use crate::dom::dommatrix::DOMMatrix; use crate::dom::dommatrix::DOMMatrix;
use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope; use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
use crate::euclidext::Size2DExt;
use canvas_traits::canvas::CanvasImageData; use canvas_traits::canvas::CanvasImageData;
use canvas_traits::canvas::CanvasMsg; use canvas_traits::canvas::CanvasMsg;
use canvas_traits::canvas::FromLayoutMsg; use canvas_traits::canvas::FromLayoutMsg;

View file

@ -25,8 +25,7 @@ use crate::dom::webglprogram::WebGLProgram;
use crate::dom::webglquery::WebGLQuery; use crate::dom::webglquery::WebGLQuery;
use crate::dom::webglrenderbuffer::WebGLRenderbuffer; use crate::dom::webglrenderbuffer::WebGLRenderbuffer;
use crate::dom::webglrenderingcontext::{ use crate::dom::webglrenderingcontext::{
uniform_get, uniform_typed, LayoutCanvasWebGLRenderingContextHelpers, Size2DExt, uniform_get, uniform_typed, LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext,
WebGLRenderingContext,
}; };
use crate::dom::webglsampler::{WebGLSampler, WebGLSamplerValue}; use crate::dom::webglsampler::{WebGLSampler, WebGLSamplerValue};
use crate::dom::webglshader::WebGLShader; use crate::dom::webglshader::WebGLShader;

View file

@ -2,29 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use euclid::default::{Rect, Size2D}; use euclid::default::Rect;
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()
}
}
pub trait RectExt { pub trait RectExt {
fn to_u64(&self) -> Rect<u64>; fn to_u64(&self) -> Rect<u64>;

View file

@ -1,5 +0,0 @@
[2d.path.stroke.scale2.html]
type: testharness
[Stroke line widths are scaled by the current transformation matrix]
expected: FAIL

View file

@ -1,5 +0,0 @@
[2d.path.stroke.skew.html]
type: testharness
[Strokes lines are skewed by the current transformation matrix]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.path.stroke.scale2.html]
[Stroke line widths are scaled by the current transformation matrix]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.path.stroke.scale2.worker.html]
[Stroke line widths are scaled by the current transformation matrix]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.path.stroke.skew.html]
[Strokes lines are skewed by the current transformation matrix]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.path.stroke.skew.worker.html]
[Strokes lines are skewed by the current transformation matrix]
expected: FAIL