Skip to content

Commit

Permalink
Remove REPAINT damage in Fragment::build_display_list
Browse files Browse the repository at this point in the history
Previously, the code that called this function was responsible for this.
Some code paths neglected to do it.  This moves the damage removal to one
central location.
  • Loading branch information
mbrubeck committed Jun 20, 2016
1 parent 8f7cfb1 commit 25a1934
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions components/layout/block.rs
Expand Up @@ -50,7 +50,7 @@ use layout_thread::DISPLAY_PORT_SIZE_FACTOR;
use model::{CollapsibleMargins, MaybeAuto, specified, specified_or_none};
use model::{self, IntrinsicISizes, MarginCollapseInfo};
use rustc_serialize::{Encodable, Encoder};
use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT};
use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW};
use std::cmp::{max, min};
use std::fmt;
use std::sync::Arc;
Expand Down Expand Up @@ -2134,7 +2134,6 @@ impl Flow for BlockFlow {

fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
self.build_display_list_for_block(state, BorderPaintingMode::Separate);
self.fragment.restyle_damage.remove(REPAINT);
}

fn repair_style(&mut self, new_style: &Arc<ServoComputedValues>) {
Expand Down
2 changes: 2 additions & 0 deletions components/layout/display_list_builder.rs
Expand Up @@ -38,6 +38,7 @@ use model::{self, MaybeAuto, ToGfxMatrix};
use net_traits::image::base::PixelFormat;
use net_traits::image_cache_thread::UsePlaceholder;
use range::Range;
use script_layout_interface::restyle_damage::REPAINT;
use std::default::Default;
use std::sync::Arc;
use std::{cmp, f32};
Expand Down Expand Up @@ -1011,6 +1012,7 @@ impl FragmentDisplayListBuilding for Fragment {
display_list_section: DisplayListSection,
clip: &ClippingRegion,
stacking_relative_display_port: &Rect<Au>) {
self.restyle_damage.remove(REPAINT);
if self.style().get_inheritedbox().visibility != visibility::T::visible {
return
}
Expand Down
8 changes: 2 additions & 6 deletions components/layout/inline.rs
Expand Up @@ -24,8 +24,8 @@ use gfx_traits::StackingContextId;
use layout_debug;
use model::IntrinsicISizesContribution;
use range::{Range, RangeIndex};
use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW};
use script_layout_interface::restyle_damage::{REPAINT, RESOLVE_GENERATED_CONTENT};
use script_layout_interface::restyle_damage::{BUBBLE_ISIZES, REFLOW};
use script_layout_interface::restyle_damage::{REFLOW_OUT_OF_FLOW, RESOLVE_GENERATED_CONTENT};
use script_layout_interface::wrapper_traits::PseudoElementType;
use std::cmp::max;
use std::collections::VecDeque;
Expand Down Expand Up @@ -1642,10 +1642,6 @@ impl Flow for InlineFlow {

fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
self.build_display_list_for_inline(state);

for fragment in &mut self.fragments.fragments {
fragment.restyle_damage.remove(REPAINT);
}
}

fn repair_style(&mut self, _: &Arc<ServoComputedValues>) {}
Expand Down

0 comments on commit 25a1934

Please sign in to comment.