mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Don't attempt to resize Offscreencanvas without a rendering context (#36855)
When the canvas context mode is a placeholder then we shouldn't resize the context. Testing: Includes a new test Fixes: https://github.com/servo/servo/issues/36846 --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
d2afe00f7b
commit
dc0e7587bf
5 changed files with 65 additions and 30 deletions
|
@ -125,7 +125,11 @@ impl CanvasContext for RenderingContext {
|
|||
|
||||
fn resize(&self) {
|
||||
match self {
|
||||
RenderingContext::Placeholder(context) => (*context.context().unwrap()).resize(),
|
||||
RenderingContext::Placeholder(offscreen_canvas) => {
|
||||
if let Some(context) = offscreen_canvas.context() {
|
||||
context.resize()
|
||||
}
|
||||
},
|
||||
RenderingContext::Context2d(context) => context.resize(),
|
||||
RenderingContext::WebGL(context) => context.resize(),
|
||||
RenderingContext::WebGL2(context) => context.resize(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue