mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Auto merge of #7696 - mskrzypkows:PaintContext_Units, r=mbrubeck
Draft. Change PaintContext rects to TypedRects #7023 I created draft. I'm not sure if we need any units conversion in PaintContext. There is also strange 'clear' method, we use PagePx origin and ScreenPx size is it OK? <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7696) <!-- Reviewable:end -->
This commit is contained in:
commit
8d8ffa8265
3 changed files with 46 additions and 43 deletions
|
@ -705,9 +705,9 @@ impl StackingContext {
|
|||
inverse_transform.m21, inverse_transform.m22,
|
||||
inverse_transform.m41, inverse_transform.m42);
|
||||
|
||||
let tile_size = Size2D::new(paint_context.screen_rect.size.width as f32,
|
||||
paint_context.screen_rect.size.height as f32);
|
||||
let tile_rect = Rect::new(Point2D::zero(), tile_size);
|
||||
let tile_size = Size2D::new(paint_context.screen_rect.as_f32().size.width,
|
||||
paint_context.screen_rect.as_f32().size.height);
|
||||
let tile_rect = Rect::new(Point2D::zero(), tile_size).to_untyped();
|
||||
let tile_rect = inverse_transform_2d.transform_rect(&tile_rect);
|
||||
|
||||
// Optimize the display list to throw out out-of-bounds display items and so forth.
|
||||
|
@ -1493,11 +1493,11 @@ impl DisplayItem {
|
|||
transform.translate(stacking_context.bounds
|
||||
.origin
|
||||
.x
|
||||
.to_nearest_pixel(pixels_per_px) as AzFloat,
|
||||
.to_nearest_pixel(pixels_per_px.get()) as AzFloat,
|
||||
stacking_context.bounds
|
||||
.origin
|
||||
.y
|
||||
.to_nearest_pixel(pixels_per_px) as AzFloat,
|
||||
.to_nearest_pixel(pixels_per_px.get()) as AzFloat,
|
||||
0.0);
|
||||
stacking_context.optimize_and_draw_into_context(paint_context,
|
||||
&new_transform,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue