mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
canvas: Remove Backend
trait (#38262)
After #38214 `Backend` trait is only used as DrawTarget builder and as type holder. By moving types and DrawTarget creation into `GenericDrawTarget` trait, we can completely remove `Backend` trait. Testing: Just refactor, but code is covered by WPT tests. Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
5cd57f9dba
commit
420a5a64a7
4 changed files with 46 additions and 77 deletions
|
@ -23,7 +23,6 @@ use pixels::Snapshot;
|
|||
use webrender_api::ImageKey;
|
||||
|
||||
use crate::canvas_data::*;
|
||||
use crate::raqote_backend::RaqoteBackend;
|
||||
|
||||
pub struct CanvasPaintThread {
|
||||
canvases: HashMap<CanvasId, Canvas>,
|
||||
|
@ -120,12 +119,8 @@ impl CanvasPaintThread {
|
|||
let canvas_id = self.next_canvas_id;
|
||||
self.next_canvas_id.0 += 1;
|
||||
|
||||
let canvas_data = CanvasData::new(
|
||||
size,
|
||||
self.compositor_api.clone(),
|
||||
self.font_context.clone(),
|
||||
RaqoteBackend,
|
||||
);
|
||||
let canvas_data =
|
||||
CanvasData::new(size, self.compositor_api.clone(), self.font_context.clone());
|
||||
let image_key = canvas_data.image_key();
|
||||
self.canvases.insert(canvas_id, Canvas::Raqote(canvas_data));
|
||||
|
||||
|
@ -301,7 +296,7 @@ impl CanvasPaintThread {
|
|||
}
|
||||
|
||||
enum Canvas {
|
||||
Raqote(CanvasData<RaqoteBackend>),
|
||||
Raqote(CanvasData<raqote::DrawTarget>),
|
||||
}
|
||||
|
||||
impl Canvas {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue