Commit graph

348 commits

Author SHA1 Message Date
Alan Jeffrey
d01c312278 Re-enabled /etc/ci/check_no_unwrap. 2016-04-11 17:28:19 -05:00
Alan Jeffrey
167b6caa36 Removed uses of unwrap in compositor. 2016-04-05 17:11:55 -05:00
Paul Rouget
df6e7394d4 forcetouch events support
This enables Apple forcetouch DOM events. It requires the preference dom.forcetouch.enabled.

The DOM events are described here:
- https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html

The Cocoa mechanism is documented here:
- 20000016-SW274
2016-04-05 18:42:28 +08:00
Patrick Walton
c95dbf7776 compositing: Send only one mouse move event if WebRender is in use.
In WebRender mode, we were sending two mouse move events: one with the
proper coordinates and one with the wrong coordinates, because of
incorrect fall-through. The script task would usually (but not always,
depending on timing) ignore the first event in favor of the second
event, resulting in incorrect mouse move event coordinates in most
cases.

Closes servo/webrender#238.
Closes #10298.
2016-03-31 11:26:08 -07: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
Connor Brewster
20a8946c6b Fixed jump tag issue 2016-03-21 20:44:56 -06:00
Patrick Walton
c2581d5cef compositing: In borderless mode, don't show the window until the page
has loaded.

This avoids a flash of unstyled content, which looks especially bad in
browser.html since unstyled content is white and browser.html has a
transparent background.

Closes #9996.
2016-03-15 22:07:21 -07:00
Patrick Walton
8eb2cda438 Implement support for overscrolling on the Mac.
Requires tomaka/glutin#734, servo/webrender_traits#14, and
servo/webrender#217.
2016-03-14 11:38:10 -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
Glenn Watson
78b284cefe With WebRender, only send resize events when window size is valid.
Fixes WR 116.
2016-03-01 09:29:16 +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
Paul Rouget
7ddb160f9c do not send mouseevent twice 2016-02-20 05:03:10 +01: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
bors-servo
bc44ae679f Auto merge of #9401 - glennw:raf-timing, r=jdm
Fixes additional calls to rAF.

Often, a rAF callback will request another rAF from the callback itself.

Previously, the constellation would quickly receive two messages saying
that there were no animations, and then there are animations again in the
situation above. This would make the compositor tick the new animation straight
away, causing strange fluctuations and timings in rAF callbacks.

Instead, only send the NoAnimationCallbacks message if the animation
callback queue is still empty after invoking the callbacks.

This fixes rAF timing, which now runs at the correct (vsync) framerate.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9401)
<!-- Reviewable:end -->
2016-01-28 11:18:24 +05:30
Glenn Watson
6a85102a5a Ensure that when outputting screenshots, animations are ticked as required.
Fixes timeout in transition_calc.html.
2016-01-28 11:49:47 +10:00
Patrick Walton
e5a1af5b7a compositing: Fix a couple of bugs that prevented iframes from painting
after navigation.

The first bug was that iframes were not reflowed in their parent DOM
when the child page navigated. This is fixed by simply having the
constellation notify the appropriate script thread when navigation
occurs.

The second bug was that the compositor was unable to adjust the pipeline
for existing iframe layers, only new ones. This patch adds logic to do
that.

Closes #8081.
2016-01-26 16:37:23 -05:00
Matthew Kuo
58174448de changed compositor private types to public 2016-01-17 04:11:58 -08:00
Darin Minamoto
374bd5be27 Moving MouseButton from msg to script_traits 2016-01-13 19:23:45 -08:00
Joshua Holmer
83e66d6959 Move AnimationState to script_traits
Resolves #9223
2016-01-13 18:14:12 -05:00
Maciej Skrzypkowski
e52c53a7f2 Move FrameTreeId type to gfx_traits #9221 2016-01-13 13:36: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
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
Simon Sapin
46bb3e5778 Make a debugging println!() conditional on is_running_problem_test
… like other print messages introduced in 19a1e57c90
2015-12-30 17:21:15 +00:00
Brandon Fairchild
637afecec9 Move LayerKind and ScrollPolicy enums to gfx_traits
This also moves LayerId and LayerProperties to gfx_traits.

Fixes #8836.
2015-12-20 20:43:31 -05:00
Matt Brubeck
40776b9492 Add queuing of pinch zoom events 2015-12-16 10:03:53 -08:00
Matt Brubeck
eb2a37d41c Refactor touch handling and add pinch zoom gesture 2015-12-16 10:03:49 -08:00
Tetsuharu OHZEKI
7267163f49 Fix warnings: use clone_from_slice instead of copy_memory 2015-12-11 10:20:24 -05:00
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
Matt Brubeck
8c4fed42b0 Minor refactoring of mouse event types
* Move some types into the `msg` crate so they can be shared more.
* Use MouseEventType instead of duplicating it in other enums.
2015-12-03 08:19:40 -08:00
bors-servo
3614ed74d9 Auto merge of #8679 - jdm:rmprintln, r=larsbergstrom
Fix #8502 by not printing the message which is known to be repeated m…

…illions of times.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8679)
<!-- Reviewable:end -->
2015-11-27 03:26:35 +05:30
Josh Matthews
a211c65f66 Fix #8502 by not printing the message which is known to be repeated millions of times. 2015-11-25 11:14:13 -05:00
Matt Brubeck
a61989e82b Fix clip rect for iframes in hit testing code
Fixes #8080
2015-11-25 05:28:47 +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
Keith Yeung
19294db6e5 Split ConstellationMsg into ScriptMsg and CompositorMsg 2015-11-16 23:10:53 -08:00
Toothbrush
3cfd65f5e1 Changed to create immutable Vec 2015-11-16 17:33:39 +00:00
Toothbrush
081b1e93a1 Fixes #8546
Fixes issue #8546
2015-11-16 17:09:34 +00:00
bors-servo
97791dd317 Auto merge of #8383 - mbrubeck:touch-refactor, r=glennw
Simplify multi-touch state machine code

This is a minor refactoring of the touch tracking in compositor, to simplify the code and prepare for more gesture handling (like pinch to zoom). r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8383)
<!-- Reviewable:end -->
2015-11-09 04:51:21 +05:30
Raphael Nestler
3985e33b43 Use while let{} instead of loop{match{}} 2015-11-07 16:08:43 +01:00
bors-servo
3510cec3e5 Auto merge of #8385 - frewsxcv:compositing-iterators, r=Manishearth
Use more iterators in compositing component

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8385)
<!-- Reviewable:end -->
2015-11-07 10:33:32 +05:30
Corey Farwell
649e50f15c Use more iterators in compositing component 2015-11-06 18:35:33 -05:00
Matt Brubeck
37bfe20986 Move first_touch_point into the TouchState machine 2015-11-06 14:33:24 -08:00
Matt Brubeck
2171683244 Move last_touch_point into the TouchState machine 2015-11-06 14:33:23 -08:00
bors-servo
4067960ba5 Auto merge of #8326 - jdm:iframehover, r=glennw
Send mouse move events to the the previous layer when directing event…

…s to a new one for the first time. Resolves #7865.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8326)
<!-- Reviewable:end -->
2015-11-06 06:24:59 +05:30
bors-servo
c78da15abb Auto merge of #8314 - jdm:timeoutinvestigations, r=metajack
Investigations for #7787

I'm just going to keep throwing stuff at try, because running directly on the builders isn't yielding results.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8314)
<!-- Reviewable:end -->
2015-11-05 04:08:30 +05:30
Josh Matthews
19a1e57c90 Add debugging information when running tests that timeout on build machines. 2015-11-04 12:26:41 -05:00
Josh Matthews
9529196d2f Send mouse move events to the the previous layer when directing events to a new one for the first time. Resolves #7865. 2015-11-04 03:40:13 -05:00
Martin Robinson
261246ea25 Properly resize iframe root layers
When a layer containing an iframe changes, we also need to resize the
root layer of the subpage. This ensures that content from the child
layer tree is masked to the new size.

Fixes #8301.
2015-11-03 15:28:07 -08:00
Matt Brubeck
ef93650db9 Handle multi-touch events from glutin 2015-11-03 08:56:34 -08:00
Matt Brubeck
817eed22d1 Add a "-Z convert-mouse-to-touch" debug argument.
This is enabled by default on Android, because Glutin currently sends mouse
events instead of touch events on Android.  It's also useful for testing on
non-touch platforms.
2015-10-22 10:37:04 -07:00