mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Changes for separate reference frame PR (#2756)
This commit is contained in:
parent
823f3e2eb1
commit
01c0e2aba0
1 changed files with 21 additions and 11 deletions
|
@ -11,6 +11,7 @@ use display_list::items::{BorderDetails, ClipScrollNode, ClipScrollNodeIndex, Cl
|
||||||
use display_list::items::{DisplayItem, DisplayList, StackingContextType};
|
use display_list::items::{DisplayItem, DisplayList, StackingContextType};
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use webrender_api::{self, ClipAndScrollInfo, ClipId, DisplayListBuilder, GlyphRasterSpace};
|
use webrender_api::{self, ClipAndScrollInfo, ClipId, DisplayListBuilder, GlyphRasterSpace};
|
||||||
|
use webrender_api::LayoutPoint;
|
||||||
|
|
||||||
pub trait WebRenderDisplayListConverter {
|
pub trait WebRenderDisplayListConverter {
|
||||||
fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder;
|
fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder;
|
||||||
|
@ -218,23 +219,32 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
let stacking_context = &item.stacking_context;
|
let stacking_context = &item.stacking_context;
|
||||||
debug_assert_eq!(stacking_context.context_type, StackingContextType::Real);
|
debug_assert_eq!(stacking_context.context_type, StackingContextType::Real);
|
||||||
|
|
||||||
let reference_frame_clip_id = builder.push_stacking_context(
|
let mut info = webrender_api::LayoutPrimitiveInfo::new(stacking_context.bounds);
|
||||||
&webrender_api::LayoutPrimitiveInfo::new(stacking_context.bounds),
|
if let Some(frame_index) = stacking_context.established_reference_frame {
|
||||||
|
debug_assert!(
|
||||||
|
stacking_context.transform.is_some() ||
|
||||||
|
stacking_context.perspective.is_some()
|
||||||
|
);
|
||||||
|
|
||||||
|
let clip_id = builder.push_reference_frame(
|
||||||
|
&info.clone(),
|
||||||
|
stacking_context.transform.map(Into::into),
|
||||||
|
stacking_context.perspective,
|
||||||
|
);
|
||||||
|
clip_ids[frame_index.to_index()] = Some(clip_id);
|
||||||
|
|
||||||
|
info.rect.origin = LayoutPoint::zero();
|
||||||
|
info.clip_rect.origin = LayoutPoint::zero();
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.push_stacking_context(
|
||||||
|
&info,
|
||||||
None,
|
None,
|
||||||
stacking_context.transform.map(Into::into),
|
|
||||||
stacking_context.transform_style,
|
stacking_context.transform_style,
|
||||||
stacking_context.perspective,
|
|
||||||
stacking_context.mix_blend_mode,
|
stacking_context.mix_blend_mode,
|
||||||
stacking_context.filters.clone(),
|
stacking_context.filters.clone(),
|
||||||
GlyphRasterSpace::Screen,
|
GlyphRasterSpace::Screen,
|
||||||
);
|
);
|
||||||
|
|
||||||
match (reference_frame_clip_id, stacking_context.established_reference_frame) {
|
|
||||||
(Some(webrender_id), Some(frame_index)) =>
|
|
||||||
clip_ids[frame_index.to_index()] = Some(webrender_id),
|
|
||||||
(None, None) => {},
|
|
||||||
_ => warn!("Mismatch between reference frame establishment!"),
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
DisplayItem::PopStackingContext(_) => builder.pop_stacking_context(),
|
DisplayItem::PopStackingContext(_) => builder.pop_stacking_context(),
|
||||||
DisplayItem::DefineClipScrollNode(ref item) => {
|
DisplayItem::DefineClipScrollNode(ref item) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue