mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
use HeapSizeOf plugin in gfx
This commit is contained in:
parent
f4bc92526a
commit
c1daf889af
5 changed files with 22 additions and 21 deletions
|
@ -27,7 +27,7 @@ use azure::azure::AzFloat;
|
|||
use azure::azure_hl::{Color};
|
||||
|
||||
use collections::linked_list::{self, LinkedList};
|
||||
use geom::{Matrix2D, Point2D, Rect, SideOffsets2D, Size2D, Matrix4};
|
||||
use geom::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D};
|
||||
use geom::approxeq::ApproxEq;
|
||||
use geom::num::Zero;
|
||||
use libc::uintptr_t;
|
||||
|
@ -254,7 +254,8 @@ pub struct StackingContext {
|
|||
pub blend_mode: mix_blend_mode::T,
|
||||
|
||||
/// A transform to be applied to this stacking context.
|
||||
pub transform: Matrix4<AzFloat>,
|
||||
#[ignore_heap_size]
|
||||
pub transform: Matrix2D<AzFloat>,
|
||||
}
|
||||
|
||||
impl StackingContext {
|
||||
|
@ -264,7 +265,7 @@ impl StackingContext {
|
|||
bounds: &Rect<Au>,
|
||||
overflow: &Rect<Au>,
|
||||
z_index: i32,
|
||||
transform: &Matrix4<AzFloat>,
|
||||
transform: &Matrix2D<AzFloat>,
|
||||
filters: filter::T,
|
||||
blend_mode: mix_blend_mode::T,
|
||||
layer: Option<Arc<PaintLayer>>)
|
||||
|
@ -285,7 +286,7 @@ impl StackingContext {
|
|||
pub fn optimize_and_draw_into_context(&self,
|
||||
paint_context: &mut PaintContext,
|
||||
tile_bounds: &Rect<AzFloat>,
|
||||
transform: &Matrix4<AzFloat>,
|
||||
transform: &Matrix2D<AzFloat>,
|
||||
clip_rect: Option<&Rect<Au>>) {
|
||||
let transform = transform.mul(&self.transform);
|
||||
let temporary_draw_target =
|
||||
|
@ -318,10 +319,7 @@ impl StackingContext {
|
|||
|
||||
// Set up our clip rect and transform.
|
||||
let old_transform = paint_subcontext.draw_target.get_transform();
|
||||
let xform_2d = Matrix2D::new(transform.m11, transform.m12,
|
||||
transform.m21, transform.m22,
|
||||
transform.m41, transform.m42);
|
||||
paint_subcontext.draw_target.set_transform(&xform_2d);
|
||||
paint_subcontext.draw_target.set_transform(&transform);
|
||||
paint_subcontext.push_clip_if_applicable();
|
||||
|
||||
// Steps 1 and 2: Borders and background for the root.
|
||||
|
@ -343,8 +341,7 @@ impl StackingContext {
|
|||
positioned_kid.bounds
|
||||
.origin
|
||||
.y
|
||||
.to_nearest_px() as AzFloat,
|
||||
0.0);
|
||||
.to_nearest_px() as AzFloat);
|
||||
let new_tile_rect =
|
||||
self.compute_tile_rect_for_child_stacking_context(tile_bounds,
|
||||
&**positioned_kid);
|
||||
|
@ -392,8 +389,7 @@ impl StackingContext {
|
|||
positioned_kid.bounds
|
||||
.origin
|
||||
.y
|
||||
.to_nearest_px() as AzFloat,
|
||||
0.0);
|
||||
.to_nearest_px() as AzFloat);
|
||||
let new_tile_rect =
|
||||
self.compute_tile_rect_for_child_stacking_context(tile_bounds,
|
||||
&**positioned_kid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue