mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use typed transforms in stacking contexts
This commit is contained in:
parent
615e38f186
commit
279cda65ed
6 changed files with 51 additions and 53 deletions
|
@ -17,7 +17,7 @@ use context::LayoutContext;
|
|||
use display_list::ToLayout;
|
||||
use display_list::background::{compute_background_image_size, tile_image_axis};
|
||||
use display_list::background::{convert_linear_gradient, convert_radial_gradient};
|
||||
use euclid::{Point2D, Rect, SideOffsets2D, Size2D, Transform3D, TypedSize2D, Vector2D, rect};
|
||||
use euclid::{rect, Point2D, Rect, SideOffsets2D, Size2D, TypedSize2D, Vector2D};
|
||||
use flex::FlexFlow;
|
||||
use flow::{BaseFlow, Flow, FlowFlags};
|
||||
use flow_ref::FlowRef;
|
||||
|
@ -76,9 +76,9 @@ use style_traits::cursor::CursorKind;
|
|||
use table_cell::CollapsedBordersForCell;
|
||||
use webrender_api::{self, BorderRadius, BorderSide, BoxShadowClipMode, ClipMode, ColorF};
|
||||
use webrender_api::{ComplexClipRegion, ExternalScrollId, FilterOp, GlyphInstance, ImageBorder};
|
||||
use webrender_api::{ImageRendering, LayoutRect, LayoutSize, LayoutVector2D, LineStyle, LocalClip};
|
||||
use webrender_api::{NinePatchDescriptor, NormalBorder, ScrollPolicy, ScrollSensitivity};
|
||||
use webrender_api::StickyOffsetBounds;
|
||||
use webrender_api::{ImageRendering, LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};
|
||||
use webrender_api::{LineStyle, LocalClip, NinePatchDescriptor, NormalBorder, ScrollPolicy};
|
||||
use webrender_api::{ScrollSensitivity, StickyOffsetBounds};
|
||||
|
||||
trait ResolvePercentage {
|
||||
fn resolve(&self, length: u32) -> u32;
|
||||
|
@ -2464,7 +2464,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
|||
|
||||
let perspective = self.fragment
|
||||
.perspective_matrix(&border_box)
|
||||
.unwrap_or_else(Transform3D::identity);
|
||||
.unwrap_or(LayoutTransform::identity());
|
||||
let transform = transform.pre_mul(&perspective).inverse();
|
||||
|
||||
let origin = &border_box.origin;
|
||||
|
@ -2766,10 +2766,8 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
|||
let content_size = self.base.overflow.scroll.origin + self.base.overflow.scroll.size;
|
||||
let content_size = Size2D::new(content_size.x, content_size.y);
|
||||
|
||||
let external_id = ExternalScrollId(
|
||||
self.fragment.unique_id(),
|
||||
state.pipeline_id.to_webrender()
|
||||
);
|
||||
let external_id =
|
||||
ExternalScrollId(self.fragment.unique_id(), state.pipeline_id.to_webrender());
|
||||
let new_clip_scroll_index = state.add_clip_scroll_node(ClipScrollNode {
|
||||
parent_index: self.clipping_and_scrolling().scrolling,
|
||||
clip: clip,
|
||||
|
|
|
@ -11,8 +11,7 @@ use gfx::display_list::{BorderDetails, ClipScrollNode};
|
|||
use gfx::display_list::{ClipScrollNodeIndex, ClipScrollNodeType, DisplayItem};
|
||||
use gfx::display_list::{DisplayList, StackingContextType};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use webrender_api::{self, ClipAndScrollInfo, ClipId};
|
||||
use webrender_api::{DisplayListBuilder, LayoutTransform};
|
||||
use webrender_api::{self, ClipAndScrollInfo, ClipId, DisplayListBuilder};
|
||||
|
||||
pub trait WebRenderDisplayListConverter {
|
||||
fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder;
|
||||
|
@ -224,19 +223,12 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
let stacking_context = &item.stacking_context;
|
||||
debug_assert_eq!(stacking_context.context_type, StackingContextType::Real);
|
||||
|
||||
let transform = stacking_context
|
||||
.transform
|
||||
.map(|transform| LayoutTransform::from_untyped(&transform).into());
|
||||
let perspective = stacking_context
|
||||
.perspective
|
||||
.map(|perspective| LayoutTransform::from_untyped(&perspective));
|
||||
|
||||
builder.push_stacking_context(
|
||||
&webrender_api::LayoutPrimitiveInfo::new(stacking_context.bounds),
|
||||
stacking_context.scroll_policy,
|
||||
transform,
|
||||
stacking_context.transform.map(Into::into),
|
||||
stacking_context.transform_style,
|
||||
perspective,
|
||||
stacking_context.perspective,
|
||||
stacking_context.mix_blend_mode,
|
||||
stacking_context.filters.clone(),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue