mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
canvas: Update the image as part of update the rendering (#35996)
* Create `update_rendering` in `CanvasState` instead of manually updating in layout Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Mark as dirty and do flushes Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup rebase Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update components/script/dom/htmlcanvaselement.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
ed995e61a6
commit
62737b3830
11 changed files with 72 additions and 51 deletions
|
@ -180,6 +180,21 @@ impl HTMLCanvasElement {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn mark_as_dirty(&self) {
|
||||
if let Some(ref context) = *self.context.borrow() {
|
||||
match *context {
|
||||
CanvasContext::Context2d(ref context) => context.mark_as_dirty(),
|
||||
CanvasContext::WebGL(ref context) => context.mark_as_dirty(),
|
||||
CanvasContext::WebGL2(ref context) => context.mark_as_dirty(),
|
||||
#[cfg(feature = "webgpu")]
|
||||
CanvasContext::WebGPU(ref context) => context.mark_as_dirty(),
|
||||
CanvasContext::Placeholder(ref _context) => {
|
||||
// TODO: Should this be marked as dirty?
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn set_natural_width(&self, value: u32, can_gc: CanGc) {
|
||||
let value = if value > UNSIGNED_LONG_MAX {
|
||||
DEFAULT_WIDTH
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue