aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas/raqote_backend.rs
diff options
context:
space:
mode:
authorpylbrecht <palbrecht@mailbox.org>2019-12-07 21:47:00 +0100
committerpylbrecht <palbrecht@mailbox.org>2019-12-17 19:52:02 +0100
commit25d036f05c9ff4c7538c58c9064c12d3a9c269f1 (patch)
tree703de15e7a30c2be0d77db9fe035d5ff2493b326 /components/canvas/raqote_backend.rs
parent1cdcbb25fa990cbeb773798ea6c872df4d2bcda6 (diff)
downloadservo-25d036f05c9ff4c7538c58c9064c12d3a9c269f1.tar.gz
servo-25d036f05c9ff4c7538c58c9064c12d3a9c269f1.zip
Set images' ExtendMode based on available information
Diffstat (limited to 'components/canvas/raqote_backend.rs')
-rw-r--r--components/canvas/raqote_backend.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/components/canvas/raqote_backend.rs b/components/canvas/raqote_backend.rs
index 7905af3b2a1..4276c0aa187 100644
--- a/components/canvas/raqote_backend.rs
+++ b/components/canvas/raqote_backend.rs
@@ -776,6 +776,11 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle {
},
Surface(ref surface) => {
let data = &surface.surface_data[..];
+ let extend = if surface.repeat_x || surface.repeat_y {
+ raqote::ExtendMode::Repeat
+ } else {
+ raqote::ExtendMode::Pad
+ };
Some(raqote::Source::Image(
raqote::Image {
data: unsafe {
@@ -784,7 +789,7 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle {
width: surface.surface_size.width as i32,
height: surface.surface_size.height as i32,
},
- raqote::ExtendMode::Repeat, // TODO: repeat-x, repeat-y ?
+ extend,
raqote::FilterMode::Bilinear,
raqote::Transform::identity(),
))