Commit graph

526 commits

Author SHA1 Message Date
Ms2ger
ec03c367ab Remove LayoutControlChan. 2016-05-28 11:43:19 +02:00
bors-servo
220bdfec2e Auto merge of #11337 - Ms2ger:compositor-exit-wait, r=pcwalton
Don't block the script listener thread on window.close().

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 --faster` 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 no tangible effect

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

This does not appear to have any effect. I believe this has been the case
since e841065351, when the helper thread was
introduced.

It was added in a7ef1cd35e, where it blocked the
script thread rather than this helper thread.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11337)
<!-- Reviewable:end -->
2016-05-25 01:03:38 -05:00
Ms2ger
f9a8c322af Use CompositorMsg from script_traits. 2016-05-24 12:29:22 +02:00
Ms2ger
8a24e2cf75 Privatize some things in compositing. 2016-05-23 15:43:51 +02:00
Ms2ger
041c907d1b Don't block the script listener thread on window.close().
This does not appear to have any effect. I believe this has been the case
since e841065351, when the helper thread was
introduced.

It was added in a7ef1cd35e, where it blocked the
script thread rather than this helper thread.
2016-05-23 11:23:54 +02:00
Ms2ger
383cdd450f Move CompositionPipeline out of the pipeline module. 2016-05-21 16:33:26 +02:00
Jack Moffitt
568d454ca6 Make Servo DPI aware on Windows
This implements system level DPI awareness for Windows. It has three
parts:

1. Add a application manifest which is copied alongside servo.exe during
build that declares our DPI awareness level. This is needed otherwise
DPI queries will return 96dpi and our application will be upscaled on
high DPI displays.

2. Rename hidpi_factor to avoid confusion with Glutin's hidpi_factor
which does something else.

3. Correctly convert windows sizes on window creation for
Windows. Unlike OS X, Windows uses device pixels for window creation.
2016-05-20 23:40:39 -06:00
Ms2ger
c057ace251 Move constellation into its own crate. 2016-05-18 11:09:28 +02:00
Matt Brubeck
d560ae79b4 Fix some warnings 2016-05-11 21:03:12 -07:00
Rohit Zambre
ca3084d241 added infrastructure to handle interval and CSV time profiling alongside html-timeline-profiling 2016-05-11 11:27:07 -07:00
bors-servo
500b0a6d36 Auto merge of #11090 - saneyuki:fix11082, r=jdm
Move ConvertPipelineIdFromWebRender to compositing

Fix #11082

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11090)
<!-- Reviewable:end -->
2016-05-09 13:50:05 -07:00
Tetsuharu OHZEKI
4f06470748 Move ConvertPipelineIdFromWebRender to compositing 2016-05-10 02:36:54 +09:00
bors-servo
7b8bb0c248 Auto merge of #11096 - mbrubeck:profile-image-saving, r=metajack
Profile time spent saving the screenshot image

I did this to see if it was a significant factor in automated test runs.  (Spoiler: it isn't.)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11096)
<!-- Reviewable:end -->
2016-05-09 10:21:00 -07:00
Matt Brubeck
9b23cf537e Profile time spent saving the screenshot image 2016-05-09 09:43:13 -07:00
Kosov Eugene
8b6a609764 move trait ConvertPipelineIdToWebRender to a better place 2016-05-09 01:20:24 +03:00
Fabrice Desré
8489b30042 Fix a build warning in compositor.rs 2016-05-05 17:59:13 -07:00
bors-servo
c1252a40d9 Auto merge of #10993 - pcwalton:fix-animations, r=glennw
compositing: Perform animation-related compositing operations in WebRender.

I accidentally removed this code in #10936.

Fixes transitions.

r? @glennw

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10993)
<!-- Reviewable:end -->
2016-05-04 16:26:08 -07:00
Patrick Walton
91907f563b compositing: Send mouse events to the right pipeline when using
WebRender.

Fixes mouse events in browser.html.

Requires servo/webrender_traits#47 and servo/webrender#272.
2016-05-04 11:40:15 -07:00
Patrick Walton
62c6d8b06d compositing: Perform animation-related compositing operations in WebRender.
I accidentally removed this code in #10936.
2016-05-03 10:58:38 -07:00
bors-servo
a868bb2a90 Auto merge of #10936 - pcwalton:wr-scroll-event-handling, r=glennw
compositor: When WebRender is in use, only composite on new WebRender frames.

Scheduling composition on scroll and so forth is unnecessary and can
cause us to miss frames if the code happens to start the composition
while the WebRender backend is still in the process of preparing the
frame. This is most easily seen when scrolling in full-screen mode in
release builds on Mac.

Closes #9879.

r? @glennw
cc @paulrouget
cc @tschneidereit

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10936)
<!-- Reviewable:end -->
2016-04-30 17:14:05 -07:00
Patrick Walton
ed90011fa3 compositor: When WebRender is in use, only composite on new WebRender
frames.

Scheduling composition on scroll and so forth is unnecessary and can
cause us to miss frames if the code happens to start the composition
while the WebRender backend is still in the process of preparing the
frame. This is most easily seen when scrolling in full-screen mode in
release builds on Mac.

Closes #9879.
2016-04-29 14:48:57 -07:00
Alan Jeffrey
5db92870ff Remove panic! from the compositor 2016-04-29 11:10:33 -05:00
Fabrice Desré
aac7101593 Don't expect a native_window when using webrender 2016-04-25 18:16:42 -07:00
Rebecca
526525b835 Add referrer policy pass-through and referrer header logic
add pass-through from doc to http-loader for referrer_policy, ref_URL
add logic for setting referer header
add script pass-through for referrer
add unit tests for setting referer header
2016-04-25 16:41:06 -04:00
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
Zhen Zhang
11b12f677b element scroll setters 2016-04-20 08:29:17 +08:00
Zhen Zhang
fefdaf76de Implement ScrollTop and ScrollLeft getters:
Add new compositor message to get scroll_offset;
Add new layout query for computed value of overflow-x/y;
Implement layer_id method for ThreadSafeLayoutNode;
Add new layout query for layer_id;
Implement script interface for getting scrollTop and scrollLeft, as well as relavant helper functions.
2016-04-19 12:27:35 +08:00
Peter
b0ad3ddf5b Updated euclid to version 0.6.5
And updated existing usages of Matrix4 to use Matrix4D<T>
2016-04-17 18:39:49 +01:00
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