mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #24422 - pylbrecht:raqote, r=jdm
Use raqote for 2D canvas rendering <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23431 <!-- Either: --> <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24422) <!-- Reviewable:end -->
This commit is contained in:
commit
bcd8c5e597
2 changed files with 16 additions and 13 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -3886,8 +3886,8 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "raqote"
|
||||
version = "0.6.5-alpha.0"
|
||||
source = "git+https://github.com/jrmuizel/raqote#c9d6d9c65ffac5fe91e2699f9854b3fbaa3c85c2"
|
||||
version = "0.7.4-alpha.0"
|
||||
source = "git+https://github.com/jrmuizel/raqote#2a801bca7253e053767ef5ea11b0ee77c52617c9"
|
||||
dependencies = [
|
||||
"euclid",
|
||||
"font-kit",
|
||||
|
@ -5090,9 +5090,9 @@ checksum = "c666f0fed8e1e20e057af770af9077d72f3d5a33157b8537c1475dd8ffd6d32b"
|
|||
|
||||
[[package]]
|
||||
name = "sw-composite"
|
||||
version = "0.5.10"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5eba1755094da86216f071f7a28b0453345c3e6e558ea2fd7821c55eef8fb9b2"
|
||||
checksum = "71bd71d7772bdbb7e5fbe37f767c5b2506bd23e72c12186a63f78c0980f64e9b"
|
||||
|
||||
[[package]]
|
||||
name = "swapper"
|
||||
|
|
|
@ -180,9 +180,11 @@ impl DrawOptions {
|
|||
impl Path {
|
||||
pub fn transformed_copy_to_builder(
|
||||
&self,
|
||||
_transform: &Transform2D<f32>,
|
||||
transform: &Transform2D<f32>,
|
||||
) -> Box<dyn GenericPathBuilder> {
|
||||
unimplemented!()
|
||||
Box::new(PathBuilder(Some(raqote::PathBuilder::from(
|
||||
self.as_raqote().clone().transform(transform),
|
||||
))))
|
||||
}
|
||||
|
||||
pub fn contains_point(&self, x: f64, y: f64, _path_transform: &Transform2D<f32>) -> bool {
|
||||
|
@ -306,7 +308,7 @@ impl GenericDrawTarget for raqote::DrawTarget {
|
|||
_sigma: f32,
|
||||
_operator: CompositionOp,
|
||||
) {
|
||||
unimplemented!();
|
||||
warn!("no support for drawing shadows");
|
||||
}
|
||||
fn fill(&mut self, path: &Path, pattern: Pattern, draw_options: &DrawOptions) {
|
||||
self.fill(
|
||||
|
@ -355,7 +357,7 @@ impl GenericDrawTarget for raqote::DrawTarget {
|
|||
self.set_transform(matrix);
|
||||
}
|
||||
fn snapshot(&self) -> SourceSurface {
|
||||
unimplemented!();
|
||||
SourceSurface::Raqote(self.snapshot_data_owned())
|
||||
}
|
||||
fn stroke(
|
||||
&mut self,
|
||||
|
@ -633,11 +635,12 @@ pub trait ToRaqoteGradientStop {
|
|||
|
||||
impl ToRaqoteGradientStop for CanvasGradientStop {
|
||||
fn to_raqote(&self) -> raqote::GradientStop {
|
||||
let color: u32 = ((self.color.alpha as u32) << 8 * 3 |
|
||||
(self.color.red as u32) << 8 * 2 |
|
||||
(self.color.green as u32) << 8 * 1 |
|
||||
(self.color.blue as u32) << 8 * 0)
|
||||
.into();
|
||||
let color = raqote::Color::new(
|
||||
self.color.alpha,
|
||||
self.color.red,
|
||||
self.color.green,
|
||||
self.color.blue,
|
||||
);
|
||||
let position = self.offset as f32;
|
||||
raqote::GradientStop { position, color }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue