mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
canvas: Remove the raqote
backend (#38962)
In general, `raqote` is essentially umaintained and has issues with quality (for instance text rendering has lots of issues) and removing it finally lets us remove our dependency on `font-kit`. Although, `vello_cpu` performance is not yet equal to raqote, rendering quality is a lot better. It's expected that `vello` and `vello_cpu` performance will keep improving. Testing: This is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
0089e652c5
commit
de69040e47
13 changed files with 5 additions and 982 deletions
|
@ -295,8 +295,6 @@ impl CanvasPaintThread {
|
|||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
enum Canvas {
|
||||
#[cfg(feature = "raqote")]
|
||||
Raqote(CanvasData<raqote::DrawTarget>),
|
||||
#[cfg(feature = "vello")]
|
||||
Vello(CanvasData<crate::vello_backend::VelloDrawTarget>),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -319,12 +317,6 @@ impl Canvas {
|
|||
compositor_api,
|
||||
font_context,
|
||||
))),
|
||||
#[cfg(feature = "raqote")]
|
||||
"" | "auto" | "raqote" => Some(Self::Raqote(CanvasData::new(
|
||||
size,
|
||||
compositor_api,
|
||||
font_context,
|
||||
))),
|
||||
#[cfg(feature = "vello")]
|
||||
"" | "auto" | "vello" => Some(Self::Vello(CanvasData::new(
|
||||
size,
|
||||
|
@ -340,8 +332,6 @@ impl Canvas {
|
|||
|
||||
fn image_key(&self) -> ImageKey {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.image_key(),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.image_key(),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -351,8 +341,6 @@ impl Canvas {
|
|||
|
||||
fn pop_clips(&mut self, clips: usize) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.pop_clips(clips),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.pop_clips(clips),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -375,19 +363,6 @@ impl Canvas {
|
|||
transform: Transform2D<f64>,
|
||||
) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.fill_text(
|
||||
text,
|
||||
x,
|
||||
y,
|
||||
max_width,
|
||||
is_rtl,
|
||||
style,
|
||||
text_options,
|
||||
shadow_options,
|
||||
composition_options,
|
||||
transform,
|
||||
),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.fill_text(
|
||||
text,
|
||||
|
@ -426,10 +401,6 @@ impl Canvas {
|
|||
transform: Transform2D<f64>,
|
||||
) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => {
|
||||
canvas_data.fill_rect(rect, style, shadow_options, composition_options, transform)
|
||||
},
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => {
|
||||
canvas_data.fill_rect(rect, style, shadow_options, composition_options, transform)
|
||||
|
@ -451,15 +422,6 @@ impl Canvas {
|
|||
transform: Transform2D<f64>,
|
||||
) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.stroke_rect(
|
||||
rect,
|
||||
style,
|
||||
line_options,
|
||||
shadow_options,
|
||||
composition_options,
|
||||
transform,
|
||||
),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.stroke_rect(
|
||||
rect,
|
||||
|
@ -491,15 +453,6 @@ impl Canvas {
|
|||
transform: Transform2D<f64>,
|
||||
) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.fill_path(
|
||||
path,
|
||||
fill_rule,
|
||||
style,
|
||||
shadow_options,
|
||||
composition_options,
|
||||
transform,
|
||||
),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.fill_path(
|
||||
path,
|
||||
|
@ -531,15 +484,6 @@ impl Canvas {
|
|||
transform: Transform2D<f64>,
|
||||
) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.stroke_path(
|
||||
path,
|
||||
style,
|
||||
line_options,
|
||||
shadow_options,
|
||||
composition_options,
|
||||
transform,
|
||||
),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.stroke_path(
|
||||
path,
|
||||
|
@ -563,8 +507,6 @@ impl Canvas {
|
|||
|
||||
fn clear_rect(&mut self, rect: &Rect<f32>, transform: Transform2D<f64>) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.clear_rect(rect, transform),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.clear_rect(rect, transform),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -584,16 +526,6 @@ impl Canvas {
|
|||
transform: Transform2D<f64>,
|
||||
) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.draw_image(
|
||||
snapshot,
|
||||
dest_rect,
|
||||
source_rect,
|
||||
smoothing_enabled,
|
||||
shadow_options,
|
||||
composition_options,
|
||||
transform,
|
||||
),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.draw_image(
|
||||
snapshot,
|
||||
|
@ -619,8 +551,6 @@ impl Canvas {
|
|||
|
||||
fn read_pixels(&mut self, read_rect: Option<Rect<u32>>) -> Snapshot {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.read_pixels(read_rect),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.read_pixels(read_rect),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -630,8 +560,6 @@ impl Canvas {
|
|||
|
||||
fn measure_text(&mut self, text: String, text_options: TextOptions) -> TextMetrics {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.measure_text(text, text_options),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.measure_text(text, text_options),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -641,8 +569,6 @@ impl Canvas {
|
|||
|
||||
fn clip_path(&mut self, path: &Path, fill_rule: FillRule, transform: Transform2D<f64>) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.clip_path(path, fill_rule, transform),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.clip_path(path, fill_rule, transform),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -652,8 +578,6 @@ impl Canvas {
|
|||
|
||||
fn put_image_data(&mut self, snapshot: Snapshot, rect: Rect<u32>) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.put_image_data(snapshot, rect),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.put_image_data(snapshot, rect),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -663,8 +587,6 @@ impl Canvas {
|
|||
|
||||
fn update_image_rendering(&mut self) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.update_image_rendering(),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.update_image_rendering(),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
@ -674,8 +596,6 @@ impl Canvas {
|
|||
|
||||
fn recreate(&mut self, size: Option<Size2D<u64>>) {
|
||||
match self {
|
||||
#[cfg(feature = "raqote")]
|
||||
Canvas::Raqote(canvas_data) => canvas_data.recreate(size),
|
||||
#[cfg(feature = "vello")]
|
||||
Canvas::Vello(canvas_data) => canvas_data.recreate(size),
|
||||
#[cfg(feature = "vello_cpu")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue