mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
This commit is contained in:
parent
b8dbf2dddd
commit
a3392610c3
15 changed files with 126 additions and 101 deletions
|
@ -22,10 +22,10 @@ pub struct CanvasId(pub u64);
|
|||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub enum CanvasMsg {
|
||||
Canvas2d(Canvas2dMsg, CanvasId),
|
||||
Create(IpcSender<CanvasId>, Size2D<i32>, webrender_api::RenderApiSender, bool),
|
||||
Create(IpcSender<CanvasId>, Size2D<u32>, webrender_api::RenderApiSender, bool),
|
||||
FromLayout(FromLayoutMsg, CanvasId),
|
||||
FromScript(FromScriptMsg, CanvasId),
|
||||
Recreate(Size2D<i32>, CanvasId),
|
||||
Recreate(Size2D<u32>, CanvasId),
|
||||
Close(CanvasId),
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ impl RadialGradientStyle {
|
|||
#[derive(Clone, Deserialize, Serialize)]
|
||||
pub struct SurfaceStyle {
|
||||
pub surface_data: ByteBuf,
|
||||
pub surface_size: Size2D<i32>,
|
||||
pub surface_size: Size2D<u32>,
|
||||
pub repeat_x: bool,
|
||||
pub repeat_y: bool,
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ pub struct SurfaceStyle {
|
|||
impl SurfaceStyle {
|
||||
pub fn new(
|
||||
surface_data: Vec<u8>,
|
||||
surface_size: Size2D<i32>,
|
||||
surface_size: Size2D<u32>,
|
||||
repeat_x: bool,
|
||||
repeat_y: bool,
|
||||
) -> Self {
|
||||
|
|
|
@ -36,10 +36,14 @@ pub struct WebGLCommandBacktrace {
|
|||
#[derive(Deserialize, Serialize)]
|
||||
pub enum WebGLMsg {
|
||||
/// Creates a new WebGLContext.
|
||||
CreateContext(WebGLVersion, Size2D<i32>, GLContextAttributes,
|
||||
WebGLSender<Result<(WebGLCreateContextResult), String>>),
|
||||
CreateContext(
|
||||
WebGLVersion,
|
||||
Size2D<u32>,
|
||||
GLContextAttributes,
|
||||
WebGLSender<Result<(WebGLCreateContextResult), String>>,
|
||||
),
|
||||
/// Resizes a WebGLContext.
|
||||
ResizeContext(WebGLContextId, Size2D<i32>, WebGLSender<Result<(), String>>),
|
||||
ResizeContext(WebGLContextId, Size2D<u32>, WebGLSender<Result<(), String>>),
|
||||
/// Drops a WebGLContext.
|
||||
RemoveContext(WebGLContextId),
|
||||
/// Runs a WebGLCommand in a specific WebGLContext.
|
||||
|
@ -141,10 +145,11 @@ impl WebGLMsgSender {
|
|||
|
||||
/// Send a resize message
|
||||
#[inline]
|
||||
pub fn send_resize(&self,
|
||||
size: Size2D<i32>,
|
||||
sender: WebGLSender<Result<(), String>>)
|
||||
-> WebGLSendResult {
|
||||
pub fn send_resize(
|
||||
&self,
|
||||
size: Size2D<u32>,
|
||||
sender: WebGLSender<Result<(), String>>,
|
||||
) -> WebGLSendResult {
|
||||
self.sender.send(WebGLMsg::ResizeContext(self.ctx_id, size, sender))
|
||||
}
|
||||
|
||||
|
@ -224,7 +229,7 @@ pub enum WebGLCommand {
|
|||
RenderbufferStorage(u32, u32, i32, i32),
|
||||
ReadPixels(i32, i32, i32, i32, u32, u32, IpcBytesSender),
|
||||
SampleCoverage(f32, bool),
|
||||
Scissor(i32, i32, i32, i32),
|
||||
Scissor(i32, i32, u32, u32),
|
||||
StencilFunc(u32, i32, u32),
|
||||
StencilFuncSeparate(u32, u32, i32, u32),
|
||||
StencilMask(u32),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue