mirror of
https://github.com/servo/servo.git
synced 2025-06-19 14:48:59 +01:00
gfx: Make some minor formatting cleanups.
This commit is contained in:
parent
b66f17a445
commit
e835fb6514
1 changed files with 20 additions and 15 deletions
|
@ -960,14 +960,13 @@ impl<'a> PaintContext<'a> {
|
|||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||
let font = self.font_context.get_paint_font_from_template(
|
||||
&text.text_run.font_template, text.text_run.actual_pt_size);
|
||||
font
|
||||
.borrow()
|
||||
.draw_text(&temporary_draw_target.draw_target,
|
||||
&*text.text_run,
|
||||
&text.range,
|
||||
baseline_origin,
|
||||
text.text_color,
|
||||
opts::get().enable_text_antialiasing);
|
||||
font.borrow()
|
||||
.draw_text(&temporary_draw_target.draw_target,
|
||||
&*text.text_run,
|
||||
&text.range,
|
||||
baseline_origin,
|
||||
text.text_color,
|
||||
opts::get().enable_text_antialiasing);
|
||||
}
|
||||
|
||||
// Blur, if necessary.
|
||||
|
@ -1029,8 +1028,9 @@ impl<'a> PaintContext<'a> {
|
|||
|
||||
// Calculate the transform matrix.
|
||||
let old_transform = self.draw_target.get_transform();
|
||||
let inflated_size = Rect::new(Point2D::new(0.0, 0.0), Size2D::new(size.width as AzFloat,
|
||||
size.height as AzFloat));
|
||||
let inflated_size = Rect::new(Point2D::new(0.0, 0.0),
|
||||
Size2D::new(size.width as AzFloat,
|
||||
size.height as AzFloat));
|
||||
let temporary_draw_target_bounds = old_transform.transform_rect(&inflated_size);
|
||||
matrix = Matrix2D::identity().translate(
|
||||
-temporary_draw_target_bounds.origin.x as AzFloat,
|
||||
|
@ -1060,7 +1060,8 @@ impl<'a> PaintContext<'a> {
|
|||
self.draw_target.set_transform(&Matrix2D::identity());
|
||||
let rect = Rect::new(Point2D::new(0.0, 0.0), self.draw_target.get_size().to_azure_size());
|
||||
|
||||
let rect_temporary = Rect::new(Point2D::new(0.0, 0.0), temporary_draw_target.get_size().to_azure_size());
|
||||
let rect_temporary = Rect::new(Point2D::new(0.0, 0.0),
|
||||
temporary_draw_target.get_size().to_azure_size());
|
||||
|
||||
// Create the Azure filter pipeline.
|
||||
let mut accum_blur = Au(0);
|
||||
|
@ -1081,7 +1082,10 @@ impl<'a> PaintContext<'a> {
|
|||
self.pop_clip_if_applicable();
|
||||
|
||||
debug!("######### use expanded Rect.");
|
||||
self.draw_target.draw_filter(&filter_node, &rect_temporary, &rect_temporary.origin, draw_options);
|
||||
self.draw_target.draw_filter(&filter_node,
|
||||
&rect_temporary,
|
||||
&rect_temporary.origin,
|
||||
draw_options);
|
||||
self.push_clip_if_applicable();
|
||||
} else {
|
||||
debug!("######### use regular Rect.");
|
||||
|
@ -1132,9 +1136,10 @@ impl<'a> PaintContext<'a> {
|
|||
}
|
||||
|
||||
// Draw the shadow, and blur if we need to.
|
||||
temporary_draw_target.draw_target.fill(&path,
|
||||
Pattern::Color(ColorPattern::new(color)).to_pattern_ref(),
|
||||
&DrawOptions::new(1.0, CompositionOp::Over, AntialiasMode::None));
|
||||
temporary_draw_target.draw_target.fill(
|
||||
&path,
|
||||
Pattern::Color(ColorPattern::new(color)).to_pattern_ref(),
|
||||
&DrawOptions::new(1.0, CompositionOp::Over, AntialiasMode::None));
|
||||
self.blur_if_necessary(temporary_draw_target, blur_radius);
|
||||
|
||||
// Undo the draw target's clip if we need to, and push back the stacking context clip.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue