mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update euclid
This commit is contained in:
parent
b944a6e281
commit
fccfff11c5
15 changed files with 5 additions and 84 deletions
|
@ -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>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue