Bug 1632389 - Remove image mask support from scroll layer API. r=nical

This is not used, so we can remove it as the first part of modifying
the public clip API in order to allow some internal optimizations.

If callers ever want to make use of this in future, it can be
achieved by placing an image mask clip node in the clip chain for
the primitives in the scroll layer.

Differential Revision: https://phabricator.services.mozilla.com/D72099
This commit is contained in:
Glenn Watson 2020-04-23 11:39:42 +00:00
parent 7fb9908559
commit a252244f3c
10 changed files with 1 additions and 74 deletions

View File

@ -2524,7 +2524,6 @@ pub extern "C" fn wr_dp_define_scroll_layer(
content_rect,
clip_rect,
vec![],
None,
ScrollSensitivity::Script,
// TODO(gw): We should also update the Gecko-side APIs to provide
// this as a vector rather than a point.

View File

@ -239,7 +239,6 @@ fn build_display_list(
LayoutRect::new(LayoutPoint::zero(), layout_size),
LayoutRect::new(LayoutPoint::zero(), layout_size),
Vec::new(),
None,
ScrollSensitivity::Script,
LayoutVector2D::zero(),
);

View File

@ -55,7 +55,6 @@ impl Example for App {
(0, 0).by(1000, 1000),
scrollbox,
vec![],
None,
ScrollSensitivity::ScriptAndInputEvents,
LayoutVector2D::zero(),
);
@ -89,7 +88,6 @@ impl Example for App {
(0, 100).to(300, 1000),
(0, 100).to(200, 300),
vec![],
None,
ScrollSensitivity::ScriptAndInputEvents,
LayoutVector2D::zero(),
);

View File

@ -810,7 +810,7 @@ impl<'a> SceneBuilder<'a> {
let clip_region = ClipRegion::create_for_clip_node(
info.clip_rect,
item.complex_clip().iter(),
info.image_mask,
None,
&current_offset,
);
// Just use clip rectangle as the frame rect for this scroll frame.

View File

@ -281,7 +281,6 @@ pub struct ScrollFrameDisplayItem {
pub clip_rect: LayoutRect,
pub parent_space_and_clip: SpaceAndClipInfo,
pub external_id: Option<ExternalScrollId>,
pub image_mask: Option<ImageMask>,
pub scroll_sensitivity: ScrollSensitivity,
/// The amount this scrollframe has already been scrolled by, in the caller.
/// This means that all the display items that are inside the scrollframe

View File

@ -1704,7 +1704,6 @@ impl DisplayListBuilder {
content_rect: LayoutRect,
clip_rect: LayoutRect,
complex_clips: I,
image_mask: Option<di::ImageMask>,
scroll_sensitivity: di::ScrollSensitivity,
external_scroll_offset: LayoutVector2D,
) -> di::SpaceAndClipInfo
@ -1721,7 +1720,6 @@ impl DisplayListBuilder {
clip_id,
scroll_frame_id,
external_id,
image_mask,
scroll_sensitivity,
external_scroll_offset,
});

View File

@ -4,7 +4,6 @@
== nested-scroll-offset.yaml nested-scroll-offset-ref.yaml
== out-of-bounds-scroll.yaml out-of-bounds-scroll-ref.yaml
== root-scroll.yaml root-scroll-ref.yaml
== scroll-layer-with-mask.yaml scroll-layer-with-mask-ref.yaml
== scroll-layer.yaml scroll-layer-ref.yaml
== simple.yaml simple-ref.yaml
== clip-and-scroll-property.yaml clip-and-scroll-property-ref.yaml

View File

@ -1,11 +0,0 @@
root:
items:
- type: rect
bounds: [20, 20, 80, 80]
color: green
- type: rect
bounds: [120, 20, 80, 80]
color: green
- type: rect
bounds: [220, 20, 80, 80]
color: green

View File

@ -1,52 +0,0 @@
root:
items:
-
type: stacking-context
# We give this stacking context a little offset here to
# ensure that offsets within reference frames are handled
# properly when drawing the mask.
bounds: [10, 10, 100, 100]
items:
- type: scroll-frame
bounds: [0, 0, 100, 100]
image-mask:
image: "mask.png"
rect: [0, 0, 100, 100]
repeat: false
items:
- type: rect
bounds: [0, 0, 100, 100]
color: green
# The same test, but this time ensure that scroll offsets don't affect the masking.
-
type: stacking-context
bounds: [100, 0, 100, 100]
items:
- type: scroll-frame
bounds: [10, 10, 100, 300]
scroll-offset: [0, 100]
image-mask:
image: "mask.png"
rect: [10, 10, 100, 100]
repeat: false
items:
- type: rect
bounds: [0, 0, 100, 200]
color: green
# Same as the previous case, but this time we verify that a scroll layer that is
# not at the origin works as well.
-
type: scroll-frame
bounds: [210, 10, 100, 100]
content-size: [100, 300]
scroll-offset: [0, 100]
image-mask:
image: "mask.png"
rect: [210, 10, 100, 100]
repeat: false
items:
- type: rect
bounds: [210, 10, 100, 200]
color: green

View File

@ -1805,7 +1805,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 image_mask = self.to_image_mask(&yaml["image-mask"], wrench);
let external_id = yaml["scroll-offset"].as_point().map(|size| {
let id = ExternalScrollId((self.scroll_offsets.len() + 1) as u64, dl.pipeline_id);
@ -1819,7 +1818,6 @@ impl YamlFrameReader {
content_rect,
clip_rect,
complex_clips,
image_mask,
ScrollSensitivity::ScriptAndInputEvents,
external_scroll_offset,
);