aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_thread.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* gfx: Allow images to be shipped to the WebRender thread without shippingPatrick Walton2016-03-221-1/+10
| | | | | | | | | over the data as well. WebRender doesn't need the data, as it acquires it separately. About a 50%-100% improvement in display list building time on browser.html.
* layout: Flatten display list transfer into a separately-transferred bytePatrick Walton2016-03-221-6/+9
| | | | | | | array, and consolidate the multitude of display list messages into one. Improves display list building performance by 50%-100% for small display lists.
* Auto merge of #10105 - mbrubeck:dirty-viewport-percentages, r=SimonSapinbors-servo2016-03-221-2/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't re-add stylesheets to recompute vw/vh lengths This is a follow-up to #9876. It avoids clearing and rebuilding SelectorMaps when vh and vw units need to be recomputed. Instead it just dirties all nodes, to force elements to be re-cascaded. Filed #10104 for later follow-up work to dirty only affected nodes. r? @SimonSapin <!-- 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/10105) <!-- Reviewable:end -->
| * Don't re-add stylesheets to recompute vw/vh lengthsMatt Brubeck2016-03-211-2/+8
| | | | | | | | | | | | | | | | This is a follow-up to #9876. It avoids clearing and rebuilding SelectorMaps when vh and vw units need to be recomputed. Instead it just dirties all nodes, to force elements to be re-cascaded. Filed #10104 for later follow-up work to dirty only affected nodes.
* | Auto merge of #10088 - ↵bors-servo2016-03-221-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pkondzior:7038-report-memory-usage-in-layout-thread-data-stylist, r=ecoal95 Report memory usage from LayoutThreadData Stylist [#7038] @jdm PTAL I'm not sure what is the approach of updating cargo components here, I've made a pull request https://github.com/servo/heapsize/pull/54 but it has to be landed first before merge and version bump. <!-- 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/10088) <!-- Reviewable:end -->
| * | Report memory usage from LayoutThreadData Stylist [#7038]Pawel Kondzior2016-03-191-0/+7
| | |
* | | layout: Don't start the reflow pass unless some node needs to bePatrick Walton2016-03-211-20/+23
| | | | | | | | | | | | | | | | | | | | | | | | reflowed. Reduces CPU usage when mousing over simple pages. Part of #9999.
* | | layout: Don't rebuild display lists at all unless restyling tells usPatrick Walton2016-03-211-32/+40
| |/ |/| | | | | | | | | | | | | | | | | some object needs to be repainted. Reduces CPU usage when mousing over simple documents. (More complex documents tend to trigger unnecessary reflow bugs and so still have high CPU.) Part of #9999.
* | layout: Move overflow calculation to be a separate, sequential,Patrick Walton2016-03-181-5/+14
|/ | | | | | | | | | | | bottom-up pass. Right now, the only reason that overflow calculation works is that we rely on script inducing extra reflows that are sent for display. This was preventing #10021 from landing. This change regresses layout performance by about 1% in my tests. Fixes #7797 properly.
* Remove lifetimes from LayoutNode and friends.Bobby Holley2016-03-141-2/+2
|
* Auto merge of #9964 - mbrubeck:incremental-damage, r=pcwaltonbors-servo2016-03-121-3/+5
|\ | | | | | | | | | | | | | | | | | | | | Compute damage even when incremental layout is disabled This fixes traversals that use the damage flags to decide which nodes to process, such as `resolve_generated_content`, which was broken in non-incremental mode. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9964) <!-- Reviewable:end -->
| * Compute damage even when incremental layout is disabledMatt Brubeck2016-03-111-3/+5
| | | | | | | | | | | | This fixes traversals that use the damage flags to decide which nodes to process, such as `resolve_generated_content`, which was broken in non-incremental mode.
* | Add scrollWidth/Height to element interfaceDaniel Robertson2016-03-111-1/+12
|/ | | | | Add the scrollWidth and scrollHeight extensions to the element interface.
* Auto merge of #9861 - pcwalton:superflat, r=glennwbors-servo2016-03-041-8/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Flatten the WebRender API to allow us to use shared memory to transfer display lists. Improves performance significantly. Requires servo/webrender_traits#15 and servo/webrender#222. r? @glennw <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9861) <!-- Reviewable:end -->
| * Flatten the WebRender API to allow us to use shared memory to transferPatrick Walton2016-03-031-8/+10
| | | | | | | | | | | | | | | | display lists. Improves performance significantly. Requires servo/webrender_traits#15 and servo/webrender#222.
* | Auto merge of #9858 - glennw:anim-smoothness, r=pcwaltonbors-servo2016-03-041-4/+0
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9858) <!-- Reviewable:end -->
| * | Fix animation smoothness when using requestAnimationFrame.Glenn Watson2016-03-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Auto merge of #9832 - metajack:suppress-reflows, r=mbrubeckbors-servo2016-03-041-1/+20
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppress reflows before RefreshTick or FirstLoad This fixes a bug where partially loaded content is displayed to the user before it should be, usually before stylesheets have loaded. This commit supresses reflows until either FirstLoad or RefreshTick, whichever comes first. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9832) <!-- Reviewable:end -->
| * | Suppress reflows before RefreshTick or FirstLoadJack Moffitt2016-03-031-1/+20
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug where partially loaded content is displayed to the user before it should be, usually before stylesheets have loaded. This commit supresses reflows until either FirstLoad or RefreshTick, whichever comes first. Unfortunately, hit_test and mouse_over did not do reflows if they were necessary, and so by suppressing the initial spurious reflows, these methods started to panic without a display list to query. This patch also transforms these into queries similar to the other existing queries.
* / layout: Switch display list building from bottom-up to top-down.Patrick Walton2016-03-031-7/+6
|/ | | | This eliminates a lot of allocations and O(n^2) behavior.
* Flatten display list structureMartin Robinson2016-03-011-39/+47
| | | | | | | | | | | | | | | | | | | | | | | Instead of producing a tree of stacking contexts, display list generation now produces a flat list of display items and a tree of stacking contexts. This will eventually allow display list construction to produce and modify WebRender vertex buffers directly, removing the overhead of display list conversion. This change also moves layerization of the display list to the paint thread, since it isn't currently useful for WebRender. To accomplish this, display list generation now takes three passes of the flow tree: 1. Calculation of absolute positions. 2. Collection of a tree of stacking contexts. 3. Creation of a list of display items. After collection of display items, they are sorted based upon the index of their parent stacking contexts and their position in CSS 2.1 Appendeix E stacking order. This is a big change, but it actually simplifies display list generation.
* Auto merge of #9663 - pcwalton:browser-html-jank-fix, r=glennwbors-servo2016-02-251-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. r? @glennw <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9663) <!-- Reviewable:end -->
| * compositing: Stop compositing unnecessarily after each animation frame.Patrick Walton2016-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Auto merge of #9706 - mrobinson:remove-parallel-display-list-building, ↵bors-servo2016-02-251-13/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | r=pcwalton Remove parallel display list construction Parallel display list construction hasn't been shown to give any performance gains. It is also incompatible with the current flat display list implementation. Once flat display lists have landed, we can explore possible benefits of parallel construction once again. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9706) <!-- Reviewable:end -->
| * Remove parallel display list constructionMartin Robinson2016-02-191-13/+1
| | | | | | | | | | | | | | Parallel display list construction hasn't been shown to give any performance gains. It is also incompatible with the current flat display list implementation. Once flat display lists have landed, we can explore possible benefits of parallel construction once again.
* | Completed implementation of devtools' `getLayout`.benshu2016-02-241-2/+14
|/
* Auto merge of #9589 - glennw:webrender, r=pcwaltonbors-servo2016-02-191-8/+48
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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! <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9589) <!-- Reviewable:end -->
| * Add WebRender integration to Servo.Glenn Watson2016-02-181-8/+48
| | | | | | | | | | | | | | | | 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!
* | Move util::logical_geometry to styleAnthony Ramine2016-02-181-1/+1
|/
* Refactor style to be completely backend-independentEmilio Cobos Álvarez2016-02-131-4/+6
| | | | | | | | | | | This commit refactors the style crate to be completely independent of the actual implementation and pseudo-elements supported. This also adds a gecko backend which introduces parsing for the anonymous box pseudo-elements[1], although there's still no way of querying them. https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
* Report CSS errors to script task for further processing.Josh Matthews2016-02-111-2/+5
|
* Auto merge of #9522 - pcwalton:two-overflows, r=mbrubeckbors-servo2016-02-051-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | layout: Separate out overflow-for-scrolling from overflow-for-paint. Closes #9484. r? @mbrubeck <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9522) <!-- Reviewable:end -->
| * layout: Separate out overflow-for-scrolling from overflow-for-paint.Patrick Walton2016-02-031-1/+1
| | | | | | | | Closes #9484.
* | Auto merge of #9523 - ruud-v-a:hasher, r=Wafflespeanutbors-servo2016-02-051-4/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrade to new Hasher API This fixes #9494. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9523) <!-- Reviewable:end -->
| * | Upgrade to new Hasher APIRuud van Asseldonk2016-02-031-4/+4
| |/
* / Say farewell to in-tree HeapSizeOfAnthony Ramine2016-02-041-1/+1
|/
* Avoid a transmute that relied on undefined struct layout.Simon Sapin2016-01-271-2/+2
|
* Hoist ParseErrorReporter into style and remove the dependency on msg.Bobby Holley2016-01-111-1/+1
| | | | | The pipeline id stuff is currently unused. If someone needs it, they can add an additional trait bound on their css error reporter to get the pipeline id.
* Auto merge of #9245 - Ms2ger:reexports, r=noxbors-servo2016-01-111-3/+3
|\ | | | | | | | | | | | | | | Stop reexporting style types from layout_interface. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9245) <!-- Reviewable:end -->
| * Stop reexporting ReflowGoal from layout_interface.Ms2ger2016-01-111-2/+2
| |
| * Stop reexporting Animation from layout_interface.Ms2ger2016-01-111-1/+1
| |
* | Move Epoch to gfx_traitsJohn DeSilva2016-01-101-2/+1
|/ | | | | Resolves #9222. Moved Epoch from components/msg/compositor_msg to components/gfx_traits/lib. Updated use statements to reflect the move.
* task -> threadrohan.prinja2016-01-101-0/+1368