зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1632705 - Part 1 - Remove complex clips from scroll frame definitions. r=kats,Bert
They aren't used, so can easily be removed as the first part of this seried of patches. If this functionality is ever required, it can be handled by the caller defining complex clip nodes explicitly. Differential Revision: https://phabricator.services.mozilla.com/D72261
This commit is contained in:
Родитель
15d2acc180
Коммит
63892870eb
|
@ -2532,7 +2532,6 @@ pub extern "C" fn wr_dp_define_scroll_layer(
|
|||
Some(ExternalScrollId(external_scroll_id, state.pipeline_id)),
|
||||
content_rect,
|
||||
clip_rect,
|
||||
vec![],
|
||||
ScrollSensitivity::Script,
|
||||
// TODO(gw): We should also update the Gecko-side APIs to provide
|
||||
// this as a vector rather than a point.
|
||||
|
|
|
@ -238,7 +238,6 @@ fn build_display_list(
|
|||
Some(scroll_id),
|
||||
LayoutRect::new(LayoutPoint::zero(), layout_size),
|
||||
LayoutRect::new(LayoutPoint::zero(), layout_size),
|
||||
Vec::new(),
|
||||
ScrollSensitivity::Script,
|
||||
LayoutVector2D::zero(),
|
||||
);
|
||||
|
|
|
@ -54,7 +54,6 @@ impl Example for App {
|
|||
None,
|
||||
(0, 0).by(1000, 1000),
|
||||
scrollbox,
|
||||
vec![],
|
||||
ScrollSensitivity::ScriptAndInputEvents,
|
||||
LayoutVector2D::zero(),
|
||||
);
|
||||
|
@ -87,7 +86,6 @@ impl Example for App {
|
|||
None,
|
||||
(0, 100).to(300, 1000),
|
||||
(0, 100).to(200, 300),
|
||||
vec![],
|
||||
ScrollSensitivity::ScriptAndInputEvents,
|
||||
LayoutVector2D::zero(),
|
||||
);
|
||||
|
|
|
@ -801,15 +801,13 @@ impl<'a> SceneBuilder<'a> {
|
|||
|
||||
fn build_scroll_frame(
|
||||
&mut self,
|
||||
item: &DisplayItemRef,
|
||||
info: &ScrollFrameDisplayItem,
|
||||
parent_node_index: SpatialNodeIndex,
|
||||
pipeline_id: PipelineId,
|
||||
) {
|
||||
let current_offset = self.current_offset(parent_node_index);
|
||||
let clip_region = ClipRegion::create_for_clip_node(
|
||||
info.clip_rect,
|
||||
item.complex_clip().iter(),
|
||||
let clip_region = ClipRegion::create_for_clip_node_with_local_clip(
|
||||
&info.clip_rect,
|
||||
¤t_offset,
|
||||
);
|
||||
// Just use clip rectangle as the frame rect for this scroll frame.
|
||||
|
@ -1479,7 +1477,6 @@ impl<'a> SceneBuilder<'a> {
|
|||
DisplayItem::ScrollFrame(ref info) => {
|
||||
let parent_space = self.get_space(&info.parent_space_and_clip.spatial_id);
|
||||
self.build_scroll_frame(
|
||||
&item,
|
||||
info,
|
||||
parent_space,
|
||||
pipeline_id,
|
||||
|
|
|
@ -189,7 +189,7 @@ pub enum DebugDisplayItem {
|
|||
Clip(ClipDisplayItem, Vec<ComplexClipRegion>),
|
||||
ClipChain(ClipChainItem, Vec<ClipId>),
|
||||
|
||||
ScrollFrame(ScrollFrameDisplayItem, Vec<ComplexClipRegion>),
|
||||
ScrollFrame(ScrollFrameDisplayItem),
|
||||
StickyFrame(StickyFrameDisplayItem),
|
||||
Iframe(IframeDisplayItem),
|
||||
PushReferenceFrame(ReferenceFrameDisplayListItem),
|
||||
|
@ -296,7 +296,7 @@ pub struct ScrollFrameDisplayItem {
|
|||
/// should be added to those display item coordinates in order to get a
|
||||
/// normalized value that is consistent across display lists.
|
||||
pub external_scroll_offset: LayoutVector2D,
|
||||
} // IMPLICIT: complex_clips: Vec<ComplexClipRegion>
|
||||
}
|
||||
|
||||
/// A solid or an animating color to draw (may not actually be a rectangle due to complex clips)
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Serialize, PeekPoke)]
|
||||
|
|
|
@ -435,10 +435,7 @@ impl BuiltDisplayList {
|
|||
v,
|
||||
item.iter.cur_clip_chain_items.iter().collect()
|
||||
),
|
||||
Real::ScrollFrame(v) => Debug::ScrollFrame(
|
||||
v,
|
||||
item.iter.cur_complex_clip.iter().collect()
|
||||
),
|
||||
Real::ScrollFrame(v) => Debug::ScrollFrame(v),
|
||||
Real::Text(v) => Debug::Text(
|
||||
v,
|
||||
item.iter.cur_glyphs.iter().collect()
|
||||
|
@ -683,14 +680,9 @@ impl<'a> BuiltDisplayListIter<'a> {
|
|||
self.cur_clip_chain_items = skip_slice::<di::ClipId>(&mut self.data);
|
||||
self.debug_stats.log_slice("clip_chain.clip_ids", &self.cur_clip_chain_items);
|
||||
}
|
||||
Clip(_) | ScrollFrame(_) => {
|
||||
Clip(_) => {
|
||||
self.cur_complex_clip = skip_slice::<di::ComplexClipRegion>(&mut self.data);
|
||||
let name = if let Clip(_) = self.cur_item {
|
||||
"clip.complex_clips"
|
||||
} else {
|
||||
"scroll_frame.complex_clips"
|
||||
};
|
||||
self.debug_stats.log_slice(name, &self.cur_complex_clip);
|
||||
self.debug_stats.log_slice("clip.complex_clips", &self.cur_complex_clip);
|
||||
}
|
||||
Text(_) => {
|
||||
self.cur_glyphs = skip_slice::<GlyphInstance>(&mut self.data);
|
||||
|
@ -851,10 +843,9 @@ impl<'de> Deserialize<'de> for BuiltDisplayList {
|
|||
DisplayListBuilder::push_iter_impl(&mut temp, clip_chain_ids);
|
||||
Real::ClipChain(v)
|
||||
}
|
||||
Debug::ScrollFrame(v, complex_clips) => {
|
||||
Debug::ScrollFrame(v) => {
|
||||
total_spatial_nodes += 1;
|
||||
total_clip_nodes += 1;
|
||||
DisplayListBuilder::push_iter_impl(&mut temp, complex_clips);
|
||||
Real::ScrollFrame(v)
|
||||
}
|
||||
Debug::StickyFrame(v) => {
|
||||
|
@ -1698,20 +1689,15 @@ impl DisplayListBuilder {
|
|||
di::ClipChainId(self.next_clip_chain_id - 1, self.pipeline_id)
|
||||
}
|
||||
|
||||
pub fn define_scroll_frame<I>(
|
||||
pub fn define_scroll_frame(
|
||||
&mut self,
|
||||
parent_space_and_clip: &di::SpaceAndClipInfo,
|
||||
external_id: Option<di::ExternalScrollId>,
|
||||
content_rect: LayoutRect,
|
||||
clip_rect: LayoutRect,
|
||||
complex_clips: I,
|
||||
scroll_sensitivity: di::ScrollSensitivity,
|
||||
external_scroll_offset: LayoutVector2D,
|
||||
) -> di::SpaceAndClipInfo
|
||||
where
|
||||
I: IntoIterator<Item = di::ComplexClipRegion>,
|
||||
I::IntoIter: ExactSizeIterator + Clone,
|
||||
{
|
||||
) -> di::SpaceAndClipInfo {
|
||||
let clip_id = self.generate_clip_index();
|
||||
let scroll_frame_id = self.generate_spatial_index();
|
||||
let item = di::DisplayItem::ScrollFrame(di::ScrollFrameDisplayItem {
|
||||
|
@ -1726,7 +1712,6 @@ impl DisplayListBuilder {
|
|||
});
|
||||
|
||||
self.push_item(&item);
|
||||
self.push_iter(complex_clips);
|
||||
|
||||
di::SpaceAndClipInfo {
|
||||
spatial_id: scroll_frame_id,
|
||||
|
|
|
@ -1803,8 +1803,6 @@ impl YamlFrameReader {
|
|||
|
||||
let numeric_id = yaml["id"].as_i64().map(|id| id as u64);
|
||||
|
||||
let complex_clips = self.to_complex_clip_regions(&yaml["complex"]);
|
||||
|
||||
let external_id = yaml["scroll-offset"].as_point().map(|size| {
|
||||
let id = ExternalScrollId((self.scroll_offsets.len() + 1) as u64, dl.pipeline_id);
|
||||
self.scroll_offsets.insert(id, LayoutPoint::new(size.x, size.y));
|
||||
|
@ -1816,7 +1814,6 @@ impl YamlFrameReader {
|
|||
external_id,
|
||||
content_rect,
|
||||
clip_rect,
|
||||
complex_clips,
|
||||
ScrollSensitivity::ScriptAndInputEvents,
|
||||
external_scroll_offset,
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче