diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-10-14 00:42:35 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-10-14 00:42:35 -0600 |
commit | fd70b366aeada7f8cb4b2457c04fd07f0ea9b143 (patch) | |
tree | 0fee2b9d89cf5b4382d606a3c7cddb96bb25556c /components/gfx/render_task.rs | |
parent | 5351c8572f564314f760037b9bcd355b43afa3aa (diff) | |
parent | bffaad118e2e73c3fbeee4a160f2b0d7d3ff4952 (diff) | |
download | servo-fd70b366aeada7f8cb4b2457c04fd07f0ea9b143.tar.gz servo-fd70b366aeada7f8cb4b2457c04fd07f0ea9b143.zip |
auto merge of #3654 : pcwalton/servo/clip-reform, r=mrobinson
We push down clipping areas during absolute position calculation. This
makes display items into a flat list, improving cache locality. It
dramatically simplifies the code all around.
Because we need to push down clip rects even for absolutely-positioned
children of non-absolutely-positioned flows, this patch alters the
parallel traversal to compute absolute positions for
absolutely-positioned children at the same time it computes absolute
positions for other children. This doesn't seem to break anything either
in theory (since the overall order remains correct) or in practice. It
simplifies the parallel traversal code quite a bit.
See the relevant Gecko bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=615734
r? @mrobinson
Diffstat (limited to 'components/gfx/render_task.rs')
-rw-r--r-- | components/gfx/render_task.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/components/gfx/render_task.rs b/components/gfx/render_task.rs index 92d9a2de2b0..8ddc5f232b2 100644 --- a/components/gfx/render_task.rs +++ b/components/gfx/render_task.rs @@ -25,13 +25,14 @@ use servo_msg::compositor_msg::{LayerMetadata, RenderListener, RenderingRenderSt use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineId}; use servo_msg::constellation_msg::{RendererReadyMsg}; use servo_msg::platform::surface::NativeSurfaceAzureMethods; -use servo_util::geometry; +use servo_util::geometry::{Au, mod}; use servo_util::opts::Opts; use servo_util::smallvec::{SmallVec, SmallVec1}; use servo_util::task::spawn_named_with_send_on_failure; use servo_util::time::{TimeProfilerChan, profile}; use servo_util::time; use std::comm::{Receiver, Sender, channel}; +use std::i32; use sync::Arc; use font_cache_task::FontCacheTask; @@ -356,8 +357,13 @@ impl<C:RenderListener + Send> RenderTask<C> { ctx.clear(); // Draw the display list. - profile(time::RenderingDrawingCategory, None, self.time_profiler_chan.clone(), || { - display_list.draw_into_context(&mut ctx, &matrix); + profile(time::RenderingDrawingCategory, + None, + self.time_profiler_chan.clone(), + || { + let clip_rect = Rect(Point2D(Au(i32::MIN), Au(i32::MIN)), + Size2D(Au(i32::MAX), Au(i32::MAX))); + display_list.draw_into_context(&mut ctx, &matrix, &clip_rect); ctx.draw_target.flush(); }); } |