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.
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
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.
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.
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.
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.
Instead of having two parallel trees of CompositorLayers and
ContainerLayers, transform CompositorLayer to CompositorData and move
tiling logic to rust-layers.
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.
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.
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.