Commit graph

107 commits

Author SHA1 Message Date
Ms2ger
6f05750956 Use u32 for outstanding_paint_msgs. 2015-03-28 15:36:35 +01:00
Ms2ger
b5bc73f5cb Stop using old_path in compositing. 2015-03-26 08:59:16 +01:00
Nicholas Nethercote
ce36e574f4 Rename lots of profiling-related things.
------------------------------------------------------------------------
BEFORE                              AFTER
------------------------------------------------------------------------
util::memory                        util::mem
- heap_size_of                      - heap_size_of (unchanged)
- SizeOf                            - HeapSizeOf
  - size_of_excluding_self            - heap_size_of_children

prof::mem                           prof::mem
- MemoryProfilerChan                - ProfilerChan
- MemoryReport                      - Report
- MemoryReportsChan                 - ReportsChan
- MemoryReporter                    - Reporter
- MemoryProfilerMsg                 - ProfilerMsg
  - {R,UnR}egisterMemoryReporter      - {R,UnR}egisterReporter
- MemoryProfiler                    - Prof
- ReportsForest                     - ReportsForest (unchanged)
- ReportsTree                       - ReportsTree   (unchanged)
- SystemMemoryReporter              - SystemReporter

prof::time                          prof::time
- TimeProfilerChan                  - ProfilerChan
- TimerMetadata                     - TimerMetadata (unchanged)
- Formatable                        - Formattable [spelling!]
- TimeProfilerMsg                   - ProfilerMsg
- TimeProfilerCategory              - ProfilerCategory
- TimeProfilerBuckets               - ProfilerBuckets
- TimeProfiler                      - Profiler
- TimerMetadataFrameType            - TimerMetadataFrameType (unchanged)
- TimerMetadataReflowType           - TimerMetadataReflowType (unchanged)
- ProfilerMetadata                  - ProfilerMetadata (unchanged)

In a few places both prof::time and prof::mem are used, and so
module-qualification is needed to avoid overlap, e.g. time::Profiler and
mem::Profiler. Likewise with std::mem and prof::mem. This is not a big
deal.
2015-03-25 16:00:23 -07:00
Nicholas Nethercote
52447ccd9b Move profiler code from util into a new crate profile.
- Most of util::memory has been moved into profile::mem, though the
  `SizeOf` trait and related things remain in util::memory. The
  `SystemMemoryReporter` code is now in a submodule
  profile::mem::system_reporter.

- util::time has been moved entirely into profile::time.
2015-03-24 02:09:31 -07:00
Ms2ger
ba87666cdb Update some code that's feature-gated under core. 2015-03-21 18:44:39 +01:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
bors-servo
755581ff54 auto merge of #5249 : glennw/servo/iframe-navigate, r=jdm
This allows iframes to navigate their own history.
2015-03-17 16:21:48 -06:00
Glenn Watson
3fb3e66ada Add support for selecting which frame is requesting a navigation.
This allows iframes to navigate their own history.
2015-03-18 07:50:46 +10:00
bors-servo
2281bca892 auto merge of #5245 : nnethercote/servo/only-one-quit-event, r=glennw
This fixes #5234, in that the huge memory spike disappears. It still takes ~15 seconds for the window to actually disappear after that first `Quit` event is received by the IOCompositor. Maybe that's a pre-existing problem.

There may be better ways to do this, like handling it on the sending side (i.e. within glutin) instead of the receiving side. I just did it this way because it seemed like the easiest thing.
2015-03-16 22:21:49 -06:00
Nicholas Nethercote
2b10f6e7ea Make IOCompositor only respond to the first Quit event.
This avoids huge mpsc_queue build-ups from the flood of Quit events
coming from glutin.

Fixes #5234.
2015-03-16 19:32:57 -07:00
Nicholas Nethercote
ece2711185 Add memory reporting infrastructure and use it to measure the display list.
This changeset implements the beginnings of fine-grained measurement of
Servo's data structures.

- It adds a new `SizeOf` trait, which is used to measure the memory used
  by heap data structures, and implements it for some std types: Box,
  String, Option, Arc, Vec, and DList.

- It adds a new `MemoryReporter` trait which is used to report memory
  measurements from other threads to the memory profiler. Reporters are
  registered and unregistered with the memory profiler, and the memory
  profiler makes measurement requests of reporters when necessary.

- It plumbs a MemoryProfilerChan through to the layout task so it can
  register a memory reporter.

- It implements the `SizeOf` trait for `DisplayList` and associated
  types, and adds a memory reporter that uses it.

The display list hits 14.77 MiB when viewing
tests/html/perf-rainbow.html, and 2.51 MiB when viewing the Guardians of
the Galaxy Wikipedia page from servo-static-suite. Example output:

  0.29: display-list::http://www.reddit.com/
  0.00: display-list::http://static.adzerk.net/reddit/ads.html?sr=-reddit.com,loggedout&bust2#http://www.reddit.com
  0.00: display-list::http://www.reddit.com/static/createadframe.html

There are a number of FIXME comments indicating sub-optimal things. This
is a big enough change for now that doing them as follow-ups seems best.
2015-03-16 18:12:26 -07:00
Glenn Watson
939a89568e First part of refactoring constellation to support iframe navigation.
The history is now recorded per frame, but needs to be exposed in a followup PR.

Also fixes a race condition that occurs loading iframes under heavy CPU load.

This ensures that iframes never do a reflow / layout until they have a valid
window size set from their parent frame.
2015-03-17 09:35:41 +10:00
Glenn Watson
591b10aa58 Fix for race condition causing reftests to hang under load.
If the root layer has a zero size rectangle, it will never be
painted, so assume the pipeline is idle in that case.

Re-enable two reftests that were disabled due to this issue.
2015-03-17 08:48:45 +10:00
Glenn Watson
3befc8ce0b Make change page url message consistent with other compositor messages.
This doesn't have any effect on functionality, it just simplifies a few upcoming changes with how FrameIds work.
2015-03-11 08:54:36 +10:00
Josh Matthews
6351fc75fd Only store the url inside a pipeline instead of the rest of the LoadData. 2015-03-03 16:25:40 -05:00
bors-servo
6927bf6ff0 auto merge of #5113 : glennw/servo/fix-title, r=mbrubeck
Sometimes, the root pipeline title is sent before the compositor has created the root pipeline, so also request the main page title once the initial frame tree has been sent.
2015-03-02 17:24:56 -07:00
Glenn Watson
f68386f0fa Fix making an iframe visible when it was initially set to display:none.
When an iframe is created with display:none it sets the root layer to be
zero width and height. When updating the rect of the iframe from layout
send the entire rect rather than just the new origin, which handles the case
where the iframe has been made visible and now has a non-zero rect.
2015-03-03 07:46:26 +10:00
Glenn Watson
2517bb561a Only allow root pipelines to set the window title.
Sometimes, the root pipeline title is sent before the compositor
has created the root pipeline, so also request the main page
title once the initial frame tree has been sent.
2015-03-03 06:10:47 +10:00
Ms2ger
dda12e196b Fix warnings in compositing. 2015-02-13 10:36:48 +01:00
Simon Sapin
d5dd1d658e Upgrade to rustc ba2f13ef0 2015-02-04 2015-02-11 14:48:34 -08:00
Martin Robinson
cf5b6199e7 Send back unused buffers to the right pipeline
Update to latest rust-layers and send back all buffers to their
original pipeline.
2015-02-10 17:11:28 -08:00
Ms2ger
b2fcc2397e Import msg as msg rather than servo_msg. 2015-02-10 11:40:36 +01:00
bors-servo
58a3cdcbef auto merge of #4822 : KiChjang/servo/constellation-frame-handling, r=jdm
Attempt at fixing #4795. Code has been written to check for the existence for the current frame, but it seems to pass the condition every time.
2015-02-04 10:06:56 -07:00
Keith Yeung
37cb876f4e Changed Msg::KeyEvent to take in KeyState and moved the checks in CompositorTask::send_key_event to Compositor::handle_browser_message 2015-02-04 10:30:23 +08:00
Adenilson Cavalcanti
ffa23088ff Using the new transparent_black() in the proper places. 2015-02-03 18:08:30 -08:00
Adenilson Cavalcanti
10418a0ea1 Using color helpers in Compositor and PaintContext
(plus added TODO related to equality operators).
2015-02-02 14:49:26 -08:00
Ms2ger
505159a464 Import the util crate as util rather than servo_util.
This used to conflict with the util crate from the standard library, which
has long since been removed.

The import in layout has not been changed because of a conflict with the
util mod there.
2015-01-29 12:16:41 +01:00
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Glenn Watson
797658fb3a Fix change of src attributes on iframe (prevents SetLayerOrigin crash). 2015-01-20 15:38:58 +10:00
Martin Robinson
19f57008da Notify compositor when a FrameTree changes pipelines
When the constellation change a FrameTree pipeline, it should send a
notification to the compositor, so that it can negotiate buffers from
the correct render task. This commit also migrates away from the
generalized FrameTreeUpdateMsg to ones specific to the situation at
hand. That turned out to be an unnecessary abstraction.
2015-01-09 16:20:04 -08:00
Martin Robinson
b60f354405 Store pipelines in the Compositor
Instead of cloning pipelines and storing them once per layer, store
them globally in the compositor and access them via id. This trades
lots of unnecessary duplication for a HashMap lookup.
2015-01-09 14:33:59 -08:00
Martin Robinson
c5994c65ef Be less stringent with invalid compositor messages
It is possible for messages for defunct pipelines to arrive in the
compositor. If the compositor believes that the pipelines are in the
process of shutting down, simply ignore the messages. We still panic in
the case that the pipeline is totally unknown.

Fixes #3733.
2015-01-09 14:33:58 -08:00
Martin Robinson
d93b80608f Combine all pipeline status trackers into a single struct
This will make it easier to organize and clean up this information
during pipeline shutdown.
2015-01-08 12:11:21 -08:00
bors-servo
1458709247 auto merge of #4558 : mrobinson/servo/compositor-message-renames, r=zwarich
These names no longer reflect what the messages do, so rename them to
SetFrameTree, AssignPaintedBuffers, and CreateOrUpdateBaseLayer.
2015-01-08 12:36:53 -07:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
Martin Robinson
9ac759ed80 Fix root layer naming in the compositor
The term "root layer" is used in the compositor to refer to both the
pipeline root layer and the page background layer. This can be quite
confusing. Instead, call the page background layer the "base layer,"
which is always the first child of the pipeline root layer.
2015-01-06 15:40:42 -08:00
Martin Robinson
ad751e4926 Rename Compositor messages SetIds and Paint
These names no longer reflect what the messages do, so rename them to
SetFrameTree and AssignPaintedBuffers.
2015-01-06 07:23:26 -08:00
Ms2ger
be683a0888 Rename MouseWindowEvent variants. 2015-01-05 12:08:16 +01:00
Ms2ger
6e027cda2d Rename the ConstellationControlMsg variants. 2015-01-04 19:01:13 +01:00
Ms2ger
138081ba25 Rename the PaintState variants. 2015-01-04 11:59:49 +01:00
Ms2ger
4d47817bae Rename TimeProfilerCategory variants. 2015-01-04 11:59:23 +01:00
Ms2ger
de0caf8761 Rename constellation_msg::Msg variants. 2015-01-04 11:59:21 +01:00
Ms2ger
d5cc791d31 Rename paint_task::Msg variants. 2015-01-04 11:06:07 +01:00
bors-servo
e8fac3681b auto merge of #4535 : servo/servo/pre-rustup_20141221, r=jdm
This prepares for the rust upgrade currently being conducted.
2015-01-03 14:39:46 -07:00
Martin Robinson
c0b397322f Stall PaintTask exit until it can release all buffers
It is possible for a PaintTask to start exiting soon after sending new
buffers to the compositor. In that case, the compositor should return
the now unnecessary buffers to the PaintTask so that it can properly
free them.

To accomplish this, the compositor now keeps a hash map of paint task
channels per pipeline id. When a PaintTask exists, the constellation
informs the compositor that it can forget about it. Additionally, the
PaintTask should not wait for any buffers when the engine is doing a
complete shutdown. In that case, the compositor is already halted and
has simply let all buffers leak. We pipe through the shutdown type when
destroying the pipeline to make this decision.

Fixes #2641.
2015-01-02 15:20:32 -08:00
Ms2ger
b51e83819d Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
2015-01-02 19:04:18 +01:00
Matt Brubeck
8dd1a363cb Update layer bounds on resize
This fixes a bug where fixed-position layers are not repositioned when the
window is resized.
2014-12-18 07:02:14 -08:00
Simon Sapin
084a63df45 Remove usage of the deprecated std::num::Zero trait. 2014-12-18 11:16:47 +00:00
Patrick Walton
7371e0b8e3 compositing: Implement cursor per CSS3-UI § 8.1.1 in the CEF/Mac port.
I'm not sure how we want to handle Linux cursors, and GLFW has no
ability to set cursors (short of disabling it and managing it yourself).
2014-12-17 22:58:52 -08:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00