Add an implementation for fill_rect

Again, this is probably incomplete but it'll do for now
This commit is contained in:
Bastien Orivel 2019-08-08 16:26:29 +02:00
parent 0a878da500
commit c39af71aeb

View file

@ -238,11 +238,23 @@ impl GenericDrawTarget for raqote::DrawTarget {
} }
fn fill_rect( fn fill_rect(
&mut self, &mut self,
_rect: &Rect<f32>, rect: &Rect<f32>,
_pattern: Pattern, pattern: Pattern,
_draw_options: Option<&DrawOptions>, _draw_options: Option<&DrawOptions>,
) { ) {
unimplemented!(); let mut pb = raqote::PathBuilder::new();
pb.rect(
rect.origin.x,
rect.origin.y,
rect.size.width,
rect.size.height,
);
raqote::DrawTarget::fill(
self,
&pb.finish(),
pattern.as_raqote(),
&raqote::DrawOptions::new(),
);
} }
fn get_format(&self) -> SurfaceFormat { fn get_format(&self) -> SurfaceFormat {
unimplemented!(); unimplemented!();