mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Add HTMLCanvasDataSource::Empty
that represent transparent black instead of HTMLCanvasDataSource::Image(None)
(#33519)
* `HTMLCanvasDataSource::Empty` that represent transparent black instead of Image(None)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Fix warning from 3a0d27b231
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
bab769a7cf
commit
3e29131d64
7 changed files with 41 additions and 36 deletions
|
@ -137,12 +137,12 @@ impl LayoutHTMLCanvasElementHelpers for LayoutDom<'_, HTMLCanvasElement> {
|
|||
let source = unsafe {
|
||||
match self.unsafe_get().context.borrow_for_layout().as_ref() {
|
||||
Some(CanvasContext::Context2d(context)) => {
|
||||
HTMLCanvasDataSource::Image(Some(context.to_layout().get_ipc_renderer()))
|
||||
HTMLCanvasDataSource::Image(context.to_layout().get_ipc_renderer())
|
||||
},
|
||||
Some(CanvasContext::WebGL(context)) => context.to_layout().canvas_data_source(),
|
||||
Some(CanvasContext::WebGL2(context)) => context.to_layout().canvas_data_source(),
|
||||
Some(CanvasContext::WebGPU(context)) => context.to_layout().canvas_data_source(),
|
||||
None => HTMLCanvasDataSource::Image(None),
|
||||
None => HTMLCanvasDataSource::Empty,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue