Auto merge of #13848 - mrobinson:remove-layers, r=glennw

Remove concept of Layers from Servo

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this PR should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13848)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-21 01:43:25 -05:00 committed by GitHub
commit bb271ef4af
21 changed files with 57 additions and 745 deletions

View file

@ -12,7 +12,7 @@ use euclid::point::TypedPoint2D;
use euclid::scale_factor::ScaleFactor;
use euclid::size::TypedSize2D;
use gfx_traits::{DevicePixel, LayerPixel, StackingContextId};
use gfx_traits::{Epoch, FrameTreeId, FragmentType, LayerId};
use gfx_traits::{Epoch, FrameTreeId, FragmentType};
use gleam::gl;
use gleam::gl::types::{GLint, GLsizei};
use image::{DynamicImage, ImageFormat, RgbImage};
@ -523,9 +523,9 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.title_for_main_frame();
}
(Msg::ScrollFragmentPoint(pipeline_id, layer_id, point, _),
(Msg::ScrollFragmentPoint(pipeline_id, point, _),
ShutdownState::NotShuttingDown) => {
self.scroll_fragment_to_point(pipeline_id, layer_id, point);
self.scroll_fragment_to_point(pipeline_id, point);
}
(Msg::MoveTo(point),
@ -796,7 +796,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
fn scroll_fragment_to_point(&mut self,
_pipeline_id: PipelineId,
_layer_id: LayerId,
_point: Point2D<f32>) {
println!("TODO: Support scroll_fragment_to_point again");
}

View file

@ -8,7 +8,6 @@ use SendableFrameTree;
use compositor::CompositingReason;
use euclid::point::Point2D;
use euclid::size::Size2D;
use gfx_traits::LayerId;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState, PipelineId};
use profile_traits::mem;
@ -72,7 +71,7 @@ pub enum Msg {
ShutdownComplete,
/// Scroll a page in a window
ScrollFragmentPoint(PipelineId, LayerId, Point2D<f32>, bool),
ScrollFragmentPoint(PipelineId, Point2D<f32>, bool),
/// Alerts the compositor that the current page has changed its title.
ChangePageTitle(PipelineId, Option<String>),
/// Alerts the compositor that the current page has changed its URL.

View file

@ -1,57 +0,0 @@
Scrolling
=========
Scrolling is implemented by the compositor. Compositor layers that opt in to
scroll events via the `wants_scroll_events` flag can scroll their contents.
These will be referred "scrolling roots." Scrolling roots serve as a viewport
into their content, which is stored in descendant layers. In order for
scrolling roots to be able to scroll their content, they need to be smaller
than that content. If the content was smaller than the scrolling root, it would
not be able to move around inside the scrolling root. Imagine a browser window
that is larger than the content that it contains. The size of each layer is
defined by the window size (the root layer) or the block size for iframes and
elements with `overflow:scroll`.
Since the compositor allows layers to exist independently of their parents,
child layers can overflow or fail to intersect their parents completely. To
prevent this, scrolling roots use the `masks_to_bounds` flag, which is a signal
to the compositor that it should not paint the parts of descendant layers that
lie outside the boundaries of the scrolling root.
Below is an ASCII art diagram showing a scrolling root with three content
layers (a, b, and c), scrolled down a few ticks. `masks_to_bounds` has not been
applied in the diagram.
<pre>
+-----------------------+
| |
=========================
| | scrolling
| &lt;-------------+root
| |
| +-------+ |
=========================
| | b | |
++-------+ +--^----+ |
|| | | |
|| | | | content
|| c &lt;---------+---------+layers
|+-------+ / |
| a &lt; |
| |
+-----------------------+
</pre>
Everything above and below the set of `====` bars would be hidden by
`masks_to_bounds`, so the composited scene will just be the viewport defined by
the scrolling root with the content layers a and b visible.
<pre>
=========================
| |
| |
| |
| +-------+ |
=========================
</pre>