Commit graph

136 commits

Author SHA1 Message Date
Michael Howell
7940b22158 compositing/script: Do not dispatch the resize event when initially loading.
No bug report corresponds to this, but I noticed it while trying to
reduce #10593
2016-04-22 13:36:43 -07:00
Ms2ger
a8b5ac5e32 Use num-traits in compositing. 2016-04-20 15:30:17 +02:00
bors-servo
aac2da75f4 Auto merge of #8641 - notriddle:no_headless, r=glennw
No more headless compositor. Just the normal one.

Fixes #8573

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8641)
<!-- Reviewable:end -->
2016-03-29 12:42:01 +05:30
Alan Jeffrey
32c72f0925 Added ability to randomly kill pipelines to the constellation. 2016-03-26 09:11:28 -05:00
Michael Howell
c9cb4839e4 No more headless compositor. Just the normal one.
This changes headless operation to strictly be a runtime option, rather
than a compile-time one. Note that the old headless version still relied
on a display server to support WebGL, while it now requires one all the
time.

Fixes #8573
2016-03-24 11:18:54 -07:00
Glenn Watson
92061132f3 Fix animation smoothness when using requestAnimationFrame.
Previously, the flow for ticking animations was:

Compositor -> Constellation -> Layout -> Script

However, this means that the compositor <-> layout messages can thrash, meaning layout thread is very rarely idle.

This means that the script thread (which joins on the layout thread during reflow) was unable to execute and run rAF callbacks.

With this change, the flow is now:

Compositor -> Constellation -> Script (when rAF is active).
Compositor -> Constellation -> Layout (when transitions / animations are active and no rAF is present).

This makes rAF based animation *much* smoother.
2016-03-04 07:26:00 +10:00
Patrick Walton
9b4cc41695 compositing: Stop compositing unnecessarily after each animation frame.
Instead, schedule a delayed composite after each frame of an animation.

The previous code would cause jank, because the following sequence
frequently occurred:

1. The page uses `requestAnimationFrame()` to request a frame.

2. The compositor receives the message, schedules a composite,
dispatches the rAF message to the script thread, composites, and goes to
sleep waiting for vblank (frame 1).

3. The script makes a change and sends it through the pipeline.
Eventually it gets painted and is sent to the compositor, but the
compositor is sleeping.

4. The compositor wakes up, sees the new painted content, page flips,
and goes to sleep (frame 2). Repeat from step 1.

The problem is that we have two composition frames, not just one. This
halves Web apps' framerate!

This commit fixes the problem by scheduling the composite in step 2 to
12 ms in the future. We already have this delayed-composition
functionality in the form of the scrolling timer, which I repurposed and
renamed to the "delayed composition timer" for this task. This change
gives the page 12 ms to prepare the frame, which seems to usually be
enough, especially with WebRender.

Note that simply removing the scheduled composite after rAF is not the
correct solution. If this is done, then pages that call rAF and don't
modify the page won't receive future rAFs, since the compositor will be
sleeping and won't be notified of vblank.

Fixes a bunch of jank in browser.html. The remaining jank seems to be a
problem with browser.html itself.
2016-02-24 14:06:46 -08:00
Glenn Watson
c0531c312f Add WebRender integration to Servo.
WebRender is an experimental GPU accelerated rendering backend for Servo.

The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).

WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
2016-02-18 10:35:29 +10:00
Tim van der Meij
a9472ede64 Remove old features 'clone_from_slice' and 'convert' 2016-02-03 00:55:13 +01:00
Lars Bergstrom
721693c43e Remove usage of Gaol in the Windows configuration, since sandboxing is not supported there yet. 2016-01-22 19:28:38 -06:00
Ms2ger
86d3c576f2 Remove some unused extern crates. 2016-01-13 09:37:28 +01:00
John DeSilva
f32995543d Move Epoch to gfx_traits
Resolves #9222. Moved Epoch from components/msg/compositor_msg to
components/gfx_traits/lib. Updated use statements to reflect the move.
2016-01-10 17:36:52 -05:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Matt Brubeck
eb2a37d41c Refactor touch handling and add pinch zoom gesture 2015-12-16 10:03:49 -08:00
Tetsuharu OHZEKI
196f15b696 Fix warnings: Remove unused 'slice_bytes' flag 2015-12-11 10:21:23 -05:00
Tetsuharu OHZEKI
7267163f49 Fix warnings: use clone_from_slice instead of copy_memory 2015-12-11 10:20:24 -05:00
Tetsuharu OHZEKI
bccb46c70a Fix warning: needless 'iter_cmp' flags 2015-12-11 10:03:45 -05:00
bors-servo
4e73a30b00 Auto merge of #8898 - vwvww:compositor_msg_refactor, r=Ms2ger
Moved CompositorMsg enum into compositing crate.

moved CompositorMsg enum into compositing crate.
moved from components/msg/constellation_msg.rs
            to components/compositing/lib.rs
fixes #8832

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8898)
<!-- Reviewable:end -->
2015-12-11 12:02:52 +05:30
Beomjin Kim
729812f383 Moved CompositorMsg enum into compositing crate.
moved from components/msg/constellation_msg.rs
      to components/compositing/lib.rs

dependencies on compositing crate added in ports/cef/Cargo.lock
2015-12-11 13:42:14 +09:00
Tetsuharu OHZEKI
e8c12c1c6d Fix warnings: Use Vec.extend_from_slice instead of Vec.push_all 2015-12-10 16:49:29 -05:00
Guillaume Gomez
db3457e498 Improve checking algorithms 2015-12-06 03:34:59 +01:00
Guillaume Gomez
6e7de62b38 Add check up on extern crate order and sort extern crates alphabetically 2015-11-28 03:11:08 +01:00
Patrick Walton
1c130819ca compositing: Split Servo up into multiple sandboxed processes.
Multiprocess mode is enabled with the `-M` switch, and sandboxing is
enabled with the `-S` switch.
2015-11-19 16:38:04 -05:00
benshu
553a0dbefd Timers are scheduled by a dedicated per-constellation thread. 2015-10-21 16:40:49 +02:00
Matt Brubeck
e2e142aae8 Replace libpng with image everywhere. 2015-10-10 07:43:11 -07:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Maciej Skrzypkowski
88815d21ba Add plugins for compositing and net crates #7699
Changed to_string calls to to_owned calls
where was a need.
2015-09-22 13:51:21 +02:00
Hugo Thiessard
6565e7b02f Issue #7390 correct the order of mod declaration 2015-09-18 22:02:04 +02:00
João Oliveira
4a305d1e62 Add style_traits crate to improve crate separation,
closes #7353
2015-09-04 12:59:37 +01:00
erneyja
17663315dd make test-tidy check that = have space after them 2015-09-01 07:18:19 -04:00
Ms2ger
1abc7a6dab Deny unsafe code in compositing. 2015-08-13 10:52:29 +02:00
bors-servo
44c4bb00c1 Auto merge of #7053 - connorimes:move-net-error-list, r=mbrubeck
Move net_error_list from net to net_traits. Fixes #7050.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7053)
<!-- Reviewable:end -->
2015-08-07 01:55:20 -06:00
Connor Imes
b526214a3d Move net_error_list from net to net_traits. Fixes #7050. 2015-08-06 16:37:08 -05:00
David Rajchenbach-Teller
d2a3a68170 Resolves #5478 - use std::process::exit instead of lib::exit in constellation.rs 2015-08-06 12:10:26 +02:00
Patrick Walton
bb99b2f3c8 script: Make most of 2D canvas and WebGL run over IPC.
To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.
2015-07-25 00:50:12 -07:00
Martin Robinson
1aedead955 Have BufferMap store NativeSurfaces and rename to SurfaceMap
We currently store LayerBuffers, because previously NativeSurfaces did
not record their own size. Now we can store NativeSurfaces directly,
which saves a bit of space in the surface cache and allows us to create
LayerBuffers only in the PaintTask.

This also means that instead of sending cached LayerBuffers, the
compositor can just send cached NativeSurfaces to the PaintTask.
2015-07-24 11:12:39 -07:00
Martin Robinson
900337e3d1 Add memory profiling for the compositor task
Currently only the BufferMap is recorded, but a later change will also
measure the memory usage of the compositor tree.
2015-07-16 16:08:34 -07:00
Patrick Walton
e841065351 compositing: Move messages that go over the ScriptListener to go over
an IPC channel instead.

Because this used a boxed trait object to invoke messages across a
process boundary, and boxed trait objects are not supported across IPC,
we spawn a helper thread inside the compositor to perform the marshaling
for us.
2015-07-14 12:12:19 -07:00
Martin Robinson
e115c3d3c4 Move LayerBuffer cache to the compositor
Now that NativeDisplay can be shared between the compositor and the
paint task, we can move the LayerBuffer cache to the compositor. This
allows surfaces to be potentially reused between different paint tasks
and will eventually allow OpenGL contexts to be preserved between
instances of GL rasterization.
2015-07-08 08:05:11 -07:00
Ms2ger
73a7e92bfd Update to rustc 2d0cbf3e3e25e092bd9e4c94d08e446b680869f0. 2015-06-25 20:02:36 +02:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
Eduard Burtescu
00e8e5f77d Use the correct log crate and setup env_logger in main. 2015-06-06 23:20:40 +03:00
James Graham
49f1b13ad9 Add support for switching frames with the webdriver API.
This moves webdriver_traits into msg to avoid a circular dependency.
2015-06-01 23:18:55 +01:00
bors-servo
ad53e95080 Auto merge of #6083 - ecoal95:layerize-canvas, r=pcwalton
I've done a bit of job to get this done. Right now readback is still used, but we have a `LayerId` -> `CanvasRenderer` map on the paint task, that we can use to get rid of that.

I'd want review, to see if this is a good approach (I know it's not the initial `CanvasId` -> renderer approach, but it's pretty similar, since a canvas involves a `PaintLayer`).

I had to do a bit of refactoring to avoid cyclic dependencies between canvas and gfx. I'd want you to review them too.

It's mergeable and doesn't break any tests :P

Some of my main concerns:
* Does the canvas render really need to be behind an `Arc<Mutex<T>>`?
* I can't clone a `NativeSurface` right now (that's why the `SendNativeSurface()` msg is unimplemented in the WebGL task). It should be easy to add that to rust-layers, supposing the caller is responsible to mark it as non-leaking, any reason to not do it?

cc @jdm @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6083)
<!-- Reviewable:end -->
2015-05-20 15:42:06 -05:00
Patrick Walton
0098d9e9e8 compositing: Support multiple events per frame.
Improves scrolling performance on Mac.
2015-05-20 10:53:48 -07:00
ecoal95
3350522306 Layerize canvas
Note that this keeps using readback right now, `NativeSurface` painting
will be implemented soon.

Also see https://github.com/servo/servo/issues/6142
2015-05-20 19:10:50 +02:00
Glenn Watson
2b3737d34e Various fixes for cleaning up iframes, compositor layers, pipelines and threads.
This allows most of the jquery test suite to run without exhausting thread resources.
2015-05-14 11:42:54 +10:00
James Gilbertson
138596e861 Constrain the viewport & zoom when reflowing 2015-05-06 00:34:33 -06:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00