Commit graph

112 commits

Author SHA1 Message Date
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Simon Sapin
80704aeabd Implement sideways text. 2014-08-29 17:50:56 +01:00
Martin Robinson
ebfe8df2a0 Update to latest rust-layers
We now need to pass through the content age of the LayerBuffer when
creating it.
2014-08-15 15:42:03 -07:00
Ms2ger
e942cd901e Merge pull request #3000 from Ms2ger/rendertask
Use spawn_named_with_send_on_failure for the RenderTask; r=Manishearth
2014-08-06 09:43:42 +02:00
Cameron Zwarich
7a4b33258a Rename ReRenderMsg to RenderMsg
ReRenderMsg is also used for rendering the first time, so the name is
confusing.
2014-08-05 11:19:24 -07:00
Cameron Zwarich
d5cb0b2cc1 Rename RenderMsg to RenderInitMsg
RenderMsg doesn't actually render anything, so the name is confusing.
2014-08-05 11:19:24 -07:00
Ms2ger
d6798e4a39 Use spawn_named_with_send_on_failure for the RenderTask (fixes #2744). 2014-08-04 13:32:09 +02:00
Patrick Walton
32b442b026 Merge pull request #2965 from zwarich/render-state-less
Move RenderState manipulation out of a loop so that we thrash it less
2014-07-30 18:37:26 -07:00
Cameron Zwarich
74e9807e7d Move RenderState manipulation out of a loop so that we thrash it less
It doesn't really make sense to say that we're idle when we're
potentially still rendering.
2014-07-30 15:38:34 -07:00
Matt Brubeck
2ede648d5a Call NativeSurface::upload through a mut reference.
Required for servo/rust-layers#95.
2014-07-30 12:38:37 -07:00
Bryan Bell
8fd5739afc Track rerender msgs
If the compositor outputs to a file:
* Track rerender msgs sent from the compositor to the render tasks.
* Before outputting, wait until all rerender msgs are processed by the
  render tasks.

Fixes issue https://github.com/servo/servo/issues/2871.
2014-07-26 16:38:34 -07:00
Cameron Zwarich
a7eafbc48e Revert "Merge pull request #2819 from bjwbell/iframe-layers"
This reverts commit 0200b61f71, reversing
changes made to ca96821902.
2014-07-19 17:17:00 -07:00
Bryan Bell
0c9f469f64 Restructure compositor layers to work with iframes
When a frame is selected via set_ids, a tree of root compositor
layers is also created, matching the tree of pipelines in the frame.
This decouples the chronological ordering dependency for parent frames
and child iframes sending CreateOrUpdateRootLayer &
CreateOrUpdateDescendentLayer messages.

Change the Compositor ready and render states to per pipeline.
This ensures the compositor doesn't composite for an epoch until
every *pipeline* in the epoch is finished rendering.

For iframes it fixes a bug where the compositor didnt wait on the
child pipeline ready state before compositing the window.

Gotchas:
* layout task or script task failure on exit ("task '' failed at sending
  on a closed channel"), this happens if the child iframe shares the
  same script task as the parent and can be avoided by adding the
  sandbox attribute to the iframe.

Other changes:
* Inline set_clipping_rect in compositor.rs
* Commented out ref test simple_iframe.html fails on os x
2014-07-19 10:46:11 -07:00
Martin Robinson
4d6613c72e Changes reflecting the latest version of rust-layers
The Tile trait has been removed and TileGrid now keeps Tile structs with
Textures embedded instead of simply buffers. rust-layers now creates
its own textures instead of relying on Servo to do it.
2014-07-16 15:04:46 -07:00
Cameron Zwarich
fbd2b588ed Remove FIXMEs related to batching buffer requests 2014-07-10 01:31:48 -07:00
Cameron Zwarich
340d9caba5 Make RenderListener::paint take multiple replies 2014-07-10 01:31:48 -07:00
Cameron Zwarich
a832acc4c8 Batch replies in RenderTask::render 2014-07-10 01:31:48 -07:00
Cameron Zwarich
ec8f71d4b5 Check whether the render task has permission to paint before painting
This matches the behavior of RenderMsg. It doesn't make sense to go to
the trouble of rendering if the render task doesn't have permission to
paint in the first place.
2014-07-10 01:31:48 -07:00
Cameron Zwarich
8d56fa37be Make ReRenderMsg take multiple ReRenderRequests 2014-07-10 01:31:48 -07:00
Cameron Zwarich
5611e34379 Separate the contents of ReRenderMsg into its own type
Make a ReRenderRequest type to represent the contents of a ReRenderMsg.
Currently, ReRenderMsg just takes a single one, but it in the future it
will take multiple requests.
2014-07-10 01:31:47 -07:00
Glenn Watson
12978eeb50 Next stage of refactoring font system. This commit introduces
the font cache task, and adapts client code to use it. It also
cleans up some existing code paths.

- Fonts are only read once from disk while in use (they
  are discarded if the reference count reaches zero, however).
  This saves memory and prevents unnecessary reading from disk.
- It will be easier to add web font support, as all fonts
  are created and managed in a single place and the entire
  pipeline ensures that only one in-memory copy of font data
  is required.

An overview of how the pieces fit together:

FontTemplate - A structure containing everything that
is required to create (and select) font handles. This
structure is shared among all matching font handles
(via Arc).

FontTemplateData - A platform specific structure that
contains the actual font data inside a template (this is
a byte array on Linux/Android, CTFont on Mac).

FontHandle - An opaque, platform specific handle to
a font instance. Each FontHandle contains an Arc<>
reference to the FontTemplate it was created from.

FontCache - This is a separate task, that is responsible
for loading and caching FontTemplate structures. There
is one FontCache per constellation. It is only ever accessed
via the FontContext described below.

FontContext - This is the public interface to the FontCache
and is used by the layout and render code to create font
handles. These must *not* be shared between threads. There
is typically one FontContext per thread/task.
2014-07-07 14:25:21 +10:00
Martin Robinson
0c2538d06d Refactor compositor layer tree design
Instead of having two parallel trees of CompositorLayers and
ContainerLayers, transform CompositorLayer to CompositorData and move
tiling logic to rust-layers.
2014-07-02 11:38:28 -07:00
Glenn Watson
4eb78753a6 Run render task on OS thread to avoid Skia memory corruption.
When Skia is running on a green task, it can sometimes be
rescheduled onto a different OS thread. This creates problems with
the memory pool implementation in Skia, which uses TLS for
storing the per thread memory pool information. Free'ing a
pool allocation from a different OS thread than it was
allocated on can cause heap corruption.

FIXME: When we update rustc, switch the task failure
message to using the new NativeTaskBuilder interface so that
it can use the same send_on_failure function as green tasks.
2014-07-02 09:15:16 +10:00
Nicholas Nethercote
56dd5b943e Rename |Profiler| as |TimeProfiler|.
And likewise for |ProfilerChan|, |profiler_chan|, and so on.  This
contrasts nicely with the newly added |MemoryProfiler|.
2014-06-26 16:41:40 -07:00
Glenn Watson
14653adda2 Revert parallel render patch due to issue #2718. 2014-06-26 14:25:28 +10:00
Tetsuharu OHZEKI
c78216f688 Fix warning in gfx: "variable does not need to be mutable" 2014-06-22 20:40:51 +09:00
Patrick Walton
e5276f06e3 gfx: Don't crash if there is no graphics metadata. 2014-06-20 17:14:08 -07:00
Patrick Walton
faaf1f9c5a Revert "Revert "Merge pull request #2609 from brson/parallel-render""
This reverts commit 3f8f065b76.
2014-06-20 17:14:03 -07:00
Lars Bergstrom
3f8f065b76 Revert "Merge pull request #2609 from brson/parallel-render"
This reverts commit 850bd2891d, reversing
changes made to 5b0feac32a.
2014-06-20 17:43:14 -05:00
Brian Anderson
b13d93b83b Fix typos 2014-06-18 17:35:20 -07:00
Brian Anderson
b6c9b65355 Allow render threads to be specified with -t 2014-06-18 17:35:20 -07:00
Brian Anderson
95a57dfced Render in parallel 2014-06-18 17:35:20 -07:00
Patrick Walton
081e054b4a gfx: Add display list optimization to eliminate clipped items before
submitting them to Skia.

40x improvement in painting time on Wikipedia.
2014-06-05 13:31:12 -07:00
Cameron Zwarich
350c2b92d2 Make RenderChan a newtype struct.
Also, derive Clone rather than implementing it manually.
2014-05-26 22:21:32 -07:00
Ms2ger
eaedeb07cb Update Rust. 2014-05-22 16:36:40 -06:00
Matt Murphy
8b94a44c0b Changes based on review 2014-05-04 23:16:18 +02:00
Matt Murphy
af920f442b Convert Vec::new() to vec!() 2014-05-04 23:16:18 +02:00
Matt Murphy
d734a8937d ~[] to Vec in main/compositing and associated files 2014-05-04 23:16:16 +02:00
Lars Bergstrom
948daf2422 This batch of changes upgrades Servo to work with the Rust upgrade as of
April 10, 2014. The main changes are to privacy, to work around the
issues with incorrect bounds on the libstd `Arc<Mutex<T>>`, and the
various API changes strewn throughout the libraries.
2014-04-27 15:46:12 -05:00
Josh Matthews
d04efe6037 Fix some private type in public signature warnings. 2014-04-16 17:20:15 -04:00
Ms2ger
4e34fcd264 Remove trailing whitespace. 2014-04-07 11:41:58 +02:00
Ms2ger
31eee791dd Upgrade rust. 2014-04-04 20:10:32 +02:00
Patrick Walton
c49f23ffb2 layout: Address review feedback. 2014-04-03 14:51:18 -07:00
Patrick Walton
cd9d824c21 servo: Implement stacking contexts and allow multiple layers per
pipeline. This handles fixed positioning mostly correctly.
2014-04-03 14:50:56 -07:00
Lars Bergstrom
a6100563a6 Rust upgrade for new master rebase 2014-03-18 22:00:48 -05:00
Lars Bergstrom
fe22598c56 Check properly for None in the headless compositor case 2014-03-18 09:31:23 -05:00
Josh Matthews
64c0de9fe7 Warning police. 2014-03-18 09:31:22 -05:00
Lars Bergstrom
bbac8aa5c3 Rust upgrades 2014-03-18 09:30:35 -05:00
Tetsuharu OHZEKI
63cab5c72c Move from gfx::opts to servo_util::opts. 2014-02-25 07:07:54 +09:00
Keegan McAllister
36b8f63984 Restore failure handling
We probably leak some threads and resources, e.g. when the script task crashes
and doesn't get a chance to send layout data back to layout to be deallocated.

Not tested with iframes yet.
2014-02-12 18:07:32 -08:00