Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion webrender/examples/alpha_perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
Some(PropertyBinding::Binding(self.property_key)),
TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
api::ScrollPolicy::Scrollable,
None,
api::TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ impl Example for App {
builder.push_stacking_context(
&LayoutPrimitiveInfo::new(doc.content_rect),
None,
ScrollPolicy::Fixed,
None,
TransformStyle::Flat,
None,
Expand Down
2 changes: 0 additions & 2 deletions webrender/examples/frame_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ impl App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down Expand Up @@ -150,7 +149,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
2 changes: 0 additions & 2 deletions webrender/examples/iframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ impl Example for App {
sub_builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand All @@ -66,7 +65,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
Some(PropertyBinding::Binding(PropertyBindingKey::new(42))),
TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/image_resize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/multiwindow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ impl Window {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
2 changes: 0 additions & 2 deletions webrender/examples/scrolling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand All @@ -50,7 +49,6 @@ impl Example for App {
builder.push_stacking_context(
&LayoutPrimitiveInfo::new((10, 10).by(0, 0)),
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/texture_cache_stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
1 change: 0 additions & 1 deletion webrender/examples/yuv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ impl Example for App {
builder.push_stacking_context(
&info,
None,
ScrollPolicy::Scrollable,
None,
TransformStyle::Flat,
None,
Expand Down
21 changes: 4 additions & 17 deletions webrender/src/display_list_flattener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use api::{FilterOp, FontInstanceKey, GlyphInstance, GlyphOptions, GlyphRasterSpa
use api::{IframeDisplayItem, ImageKey, ImageRendering, ItemRange, LayoutPoint};
use api::{LayoutPrimitiveInfo, LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};
use api::{LineOrientation, LineStyle, LocalClip, NinePatchBorderSource, PipelineId};
use api::{PropertyBinding, RepeatMode, ScrollFrameDisplayItem, ScrollPolicy, ScrollSensitivity};
use api::{Shadow, SpecificDisplayItem, StackingContext, StickyFrameDisplayItem, TexelRect};
use api::{TileOffset, TransformStyle, YuvColorSpace, YuvData};
use api::{PropertyBinding, RepeatMode, ScrollFrameDisplayItem, ScrollSensitivity, Shadow};
use api::{SpecificDisplayItem, StackingContext, StickyFrameDisplayItem, TexelRect, TileOffset};
use api::{TransformStyle, YuvColorSpace, YuvData};
use app_units::Au;
use clip::{ClipRegion, ClipSource, ClipSources, ClipStore};
use clip_scroll_node::{ClipScrollNode, NodeType, StickyFrameInfo};
Expand Down Expand Up @@ -474,7 +474,7 @@ impl<'a> DisplayListFlattener<'a> {
item: &DisplayItemRef,
stacking_context: &StackingContext,
unreplaced_scroll_id: ClipId,
mut scroll_node_id: ClipId,
scroll_node_id: ClipId,
mut reference_frame_relative_offset: LayoutVector2D,
is_backface_visible: bool,
) {
Expand All @@ -498,11 +498,6 @@ impl<'a> DisplayListFlattener<'a> {
)
};

if stacking_context.scroll_policy == ScrollPolicy::Fixed {
scroll_node_id = self.current_reference_frame_id();
self.replacements.push((unreplaced_scroll_id, scroll_node_id));
}

let bounds = item.rect();
reference_frame_relative_offset += bounds.origin.to_vector();

Expand Down Expand Up @@ -547,10 +542,6 @@ impl<'a> DisplayListFlattener<'a> {
reference_frame_relative_offset,
);

if stacking_context.scroll_policy == ScrollPolicy::Fixed {
self.replacements.pop();
}

if stacking_context.reference_frame_id.is_some() {
self.replacements.pop();
self.pop_reference_frame();
Expand Down Expand Up @@ -1303,10 +1294,6 @@ impl<'a> DisplayListFlattener<'a> {
self.reference_frame_stack.last().unwrap().1
}

pub fn current_reference_frame_id(&self) -> ClipId{
self.reference_frame_stack.last().unwrap().0
}

pub fn setup_viewport_offset(
&mut self,
inner_rect: DeviceUintRect,
Expand Down
14 changes: 7 additions & 7 deletions webrender_api/src/display_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ pub struct PushStackingContextDisplayItem {

#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub struct StackingContext {
pub scroll_policy: ScrollPolicy,
pub transform: Option<PropertyBinding<LayoutTransform>>,
pub transform_style: TransformStyle,
pub perspective: Option<LayoutTransform>,
Expand All @@ -479,12 +478,6 @@ pub struct StackingContext {
pub glyph_raster_space: GlyphRasterSpace,
} // IMPLICIT: filters: Vec<FilterOp>

#[repr(u32)]
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub enum ScrollPolicy {
Scrollable = 0,
Fixed = 1,
}

#[repr(u32)]
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
Expand Down Expand Up @@ -836,6 +829,13 @@ impl ClipId {
_ => false,
}
}

pub fn is_root_reference_frame(&self) -> bool {
match *self {
ClipId::Clip(1, _) => true,
_ => false,
}
}
}

/// An external identifier that uniquely identifies a scroll frame independent of its ClipId, which
Expand Down
18 changes: 8 additions & 10 deletions webrender_api/src/display_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ use time::precise_time_ns;
use {AlphaType, BorderDetails, BorderDisplayItem, BorderRadius, BorderWidths, BoxShadowClipMode};
use {BoxShadowDisplayItem, ClipAndScrollInfo, ClipChainId, ClipChainItem, ClipDisplayItem, ClipId};
use {ColorF, ComplexClipRegion, DisplayItem, ExtendMode, ExternalScrollId, FilterOp};
use {FontInstanceKey, GlyphInstance, GlyphOptions, GlyphRasterSpace, Gradient, GradientDisplayItem, GradientStop};
use {IframeDisplayItem, ImageDisplayItem, ImageKey, ImageMask, ImageRendering};
use {LayoutPoint, LayoutPrimitiveInfo, LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};
use {LineDisplayItem, LineOrientation, LineStyle, MixBlendMode, PipelineId, PropertyBinding};
use {PushStackingContextDisplayItem, RadialGradient, RadialGradientDisplayItem};
use {RectangleDisplayItem, ScrollFrameDisplayItem, ScrollPolicy, ScrollSensitivity, Shadow};
use {SpecificDisplayItem, StackingContext, StickyFrameDisplayItem, StickyOffsetBounds};
use {TextDisplayItem, TransformStyle, YuvColorSpace, YuvData, YuvImageDisplayItem};
use {FontInstanceKey, GlyphInstance, GlyphOptions, GlyphRasterSpace, Gradient};
use {GradientDisplayItem, GradientStop, IframeDisplayItem, ImageDisplayItem, ImageKey, ImageMask};
use {ImageRendering, LayoutPoint, LayoutPrimitiveInfo, LayoutRect, LayoutSize, LayoutTransform};
use {LayoutVector2D, LineDisplayItem, LineOrientation, LineStyle, MixBlendMode, PipelineId};
use {PropertyBinding, PushStackingContextDisplayItem, RadialGradient, RadialGradientDisplayItem};
use {RectangleDisplayItem, ScrollFrameDisplayItem, ScrollSensitivity, Shadow, SpecificDisplayItem};
use {StackingContext, StickyFrameDisplayItem, StickyOffsetBounds, TextDisplayItem, TransformStyle};
use {YuvColorSpace, YuvData, YuvImageDisplayItem};

// We don't want to push a long text-run. If a text-run is too long, split it into several parts.
// This needs to be set to (renderer::MAX_VERTEX_TEXTURE_WIDTH - VECS_PER_PRIM_HEADER - VECS_PER_TEXT_RUN) * 2
Expand Down Expand Up @@ -1281,7 +1281,6 @@ impl DisplayListBuilder {
&mut self,
info: &LayoutPrimitiveInfo,
clip_node_id: Option<ClipId>,
scroll_policy: ScrollPolicy,
transform: Option<PropertyBinding<LayoutTransform>>,
transform_style: TransformStyle,
perspective: Option<LayoutTransform>,
Expand All @@ -1297,7 +1296,6 @@ impl DisplayListBuilder {

let item = SpecificDisplayItem::PushStackingContext(PushStackingContextDisplayItem {
stacking_context: StackingContext {
scroll_policy,
transform,
transform_style,
perspective,
Expand Down
9 changes: 0 additions & 9 deletions wrench/reftests/border/degenerate-curve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ root:
items:
-
bounds: [0, 0, 1024, 740]
"clip-and-scroll": 0
type: "stacking-context"
"scroll-policy": scrollable
"transform-style": flat
Expand Down Expand Up @@ -48,7 +47,6 @@ root:
color: 255 0 0 1.0000
-
bounds: [28, 160, 144, 122]
"clip-and-scroll": 0
type: border
width: [18, 0, 18, 0]
"border-type": normal
Expand All @@ -74,7 +72,6 @@ root:
color: 255 0 0 1.0000
- type: border
bounds: [28, 302, 154, 122]
"clip-and-scroll": 0
width: [18, 0, 18, 10]
"border-type": normal
color:
Expand Down Expand Up @@ -107,7 +104,6 @@ root:
color: 255 0 0 1.0000
- type: border
bounds: [202, 18, 144.03334, 122]
"clip-and-scroll": 0
width: [18, 0.016666668, 18, 0.016666668]
"border-type": normal
color:
Expand All @@ -132,7 +128,6 @@ root:
color: 255 0 0 1.0000
- type: border
bounds: [202, 160, 144, 122]
"clip-and-scroll": 0
width: [18, 0, 18, 0]
"border-type": normal
color:
Expand All @@ -157,7 +152,6 @@ root:
color: 255 0 0 1.0000
-
bounds: [202, 302, 154, 122]
"clip-and-scroll": 0
type: border
width: [18, 0, 18, 10]
"border-type": normal
Expand Down Expand Up @@ -187,7 +181,6 @@ root:
color: 255 0 0 1.0000
-
bounds: [376, 18, 144, 122]
"clip-and-scroll": 0
type: border
width: [18, 0, 18, 0]
"border-type": normal
Expand All @@ -214,7 +207,6 @@ root:
-
bounds: [376, 160, 144, 122]
clip: [-17895698, -17895698, 35791396, 35791396]
"clip-and-scroll": 0
type: border
width: [18, 0, 18, 0]
"border-type": normal
Expand Down Expand Up @@ -244,7 +236,6 @@ root:
color: 255 0 0 1.0000
-
bounds: [376, 302, 144, 122]
"clip-and-scroll": 0
type: border
width: [18, 0, 18, 0]
"border-type": normal
Expand Down
1 change: 0 additions & 1 deletion wrench/reftests/border/dotted-corner-small-radius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ root:
items:
- bounds: [5, 5, 490, 490]
"clip-rect": [5, 5, 490, 490]
"clip-and-scroll": 0
"backface-visible": true
type: border
width: 25
Expand Down
4 changes: 2 additions & 2 deletions wrench/reftests/clip/clip-3d-transform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ root:
"clip-rect": [0, 0, 800, 400]
"backface-visible": true
type: clip
id: 1
id: 2
"content-size": [800, 400]
-
bounds: [0, 0, 400, 200]
"clip-rect": [0, 0, 400, 200]
"backface-visible": true
type: rect
"clip-and-scroll": 1
clip-and-scroll: 2
color: green
5 changes: 1 addition & 4 deletions wrench/reftests/clip/clip-45-degree-rotation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,23 @@ root:
-
bounds: [0, 0, 0, 0]
"clip-rect": [0, 0, 0, 0]
"clip-and-scroll": 0
type: "stacking-context"
transform: rotate(45) translate(200, 0)
items:
-
bounds: [0, 0, 300, 300]
"clip-rect": [0, 0, 300, 300]
"clip-and-scroll": 0
type: rect
color: red
-
bounds: [0, 0, 300, 300]
"clip-rect": [0, 0, 300, 300]
"clip-and-scroll": 0
type: clip
id: 5
-
bounds: [0, 0, 0, 0]
"clip-rect": [0, 0, 0, 0]
"clip-and-scroll": 5
clip-and-scroll: 5
type: "stacking-context"
transform: rotate(-45) translate(-300, 0)
items:
Expand Down
3 changes: 1 addition & 2 deletions wrench/reftests/clip/custom-clip-chain-node-ancestors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ root:
-
bounds: [25, 25, 50, 50]
"clip-rect": [25, 25, 50, 50]
"clip-and-scroll": 0
type: clip
id: 2
-
Expand All @@ -28,6 +27,6 @@ root:
-
bounds: [0, 0, 200, 200]
clip-rect: [0, 0, 200, 200]
clip-and-scroll: [0, 10]
clip-and-scroll: [root-scroll-node, 10]
type: rect
color: 0 255 0 1
2 changes: 1 addition & 1 deletion wrench/reftests/clip/custom-clip-chains-ref.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
root:
items:
- type: clip
id: 1
id: 2
bounds: [0, 0, 200, 200]
complex:
- rect: [0, 0, 200, 200]
Expand Down
Loading