Commit graph

223 commits

Author SHA1 Message Date
Ms2ger
43ed033eff Use isize/usize in range. 2015-03-28 15:36:36 +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
f416a6a66e Update some feature gates. 2015-03-22 17:09:57 +01:00
Ms2ger
ba87666cdb Update some code that's feature-gated under core. 2015-03-21 18:44:39 +01:00
Ms2ger
32d1e31c90 Replace most usage of std::old_io::File. 2015-03-20 23:47:29 +01:00
bors-servo
fef439726a auto merge of #5270 : glennw/servo/hit-test-stacking-context, r=pcwalton 2015-03-19 15:18:53 -06:00
Glenn Watson
ad0ffac81b Fix hit testing with stacking contexts (apparent since transforms landed). 2015-03-19 11:58:36 +10:00
bors-servo
2346c9b940 auto merge of #5266 : mbrubeck/servo/linked_list, r=metajack
Fixes deprecation warnings.  Also removes a workaround for a fixed bug in Rust.
2015-03-18 16:28:09 -06:00
Matt Brubeck
1ead92b474 Rename dlist to linked_list. 2015-03-18 14:44:34 -07:00
bors-servo
124a78fb2e auto merge of #5262 : servo/servo/fix-warnings, r=metajack 2015-03-18 15:21:49 -06:00
Simon Sapin
5ffd71cd5e Fix some warnings in gfx. 2015-03-18 22:08:00 +01:00
Adenilson Cavalcanti
814283321d Adding geometry information on DisplayList items while dumping. 2015-03-18 12:52:14 -07:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
Patrick Walton
d10627a2b3 layout: Implement 2D CSS transforms per CSS-TRANSFORMS § 5, 6, 7, and 8. 2015-03-17 11:30:55 -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
Connor Jennings
f298089f02 Retain buffer for CGDataProviderCreateWithData. Fixes #5084.
CGDataProviderCreateWithData just wraps the underlying buffer. The
underlying buffer needs to be kept around until the data provider is
freed. Adding the buffer to the FontTemplateData struct ensures it
sticks around.
2015-03-15 14:02:27 -04:00
Mikko Perttunen
92a4bba785 Handle font load errors in FontContext
Thread font load errors from platform font loading code to
FontContext::get_layout_font_group_for_style, and cache the failure
result, instead of panicing the thread when a font fails to load.

Before this patch, a failed font load would panic a LayoutTask,
causing a cascade of panics, eventually aborting the whole engine
during a panic within panic.
2015-03-06 18:18:22 +02:00
Patrick Walton
09c53f461d layout: Implement image-rendering per CSS-IMAGES-3 § 5.3 and
`background-size` per CSS-BACKGROUNDS § 3.9.

Nearest neighbor interpolation is used for `crisp-edges`, like Firefox.
A note has been added that we could do better if we wanted to.

Multiple backgrounds are not yet supported.
2015-03-03 17:54:12 +01:00
Glenn Watson
0817f9ad44 Fix hover state on elements with transparent background colours.
Move culling of transparent display items to paint task rather than display list builder, so that hit testing detects mouse over on transparent background elements.
2015-03-03 09:15:11 +10:00
Patrick Walton
09358b908d layout: Implement text-shadow per CSS-TEXT-DECORATION-3 § 4. 2015-03-02 13:28:51 -08:00
Adenilson Cavalcanti
2c45eab00e Clean compilation warnings. 2015-02-25 21:43:02 -08:00
Adenilson Cavalcanti
b9e9d7471d Implements a DisplayList dumper.
This patch will iterate through the DisplayList after the reflow
is done and print its elements (as also any sub-lists associated
to a child node stacking context).

It adds a new CLI parameter to trigger the function to dump the display list
to console (i.e. servo --debug dump-display-list url).

Using both display list and flow tree information is helpful to debug
rendering issues.
2015-02-25 19:10:05 -08:00
Ms2ger
e072e5946e Move gfx to libc from crates.io. 2015-02-21 10:53:00 +01:00
bors-servo
d26345f868 auto merge of #4994 : pcwalton/servo/layout-tinting, r=pcwalton
r? @metajack
2015-02-20 23:06:48 -07:00
Patrick Walton
40a3b41758 layout: Add an option to visualize parallel layout 2015-02-20 19:11:35 -08:00
Andreas Gal
ad5671bc14 Use cleaner StrokeOptions interface introduced by https://github.com/servo/rust-azure/pull/145. 2015-02-20 14:56:23 -08:00
Jack Moffitt
7acc0619e6 Correct usage of number of painting threads.
Previously this used the number of layout threads to allocate the
threadpool. This also makes the member name consistent with the rest of
the structure.
2015-02-19 16:17:55 -07:00
Jack Moffitt
923676d443 Added overlay for demoing parallel painting. 2015-02-19 16:17:55 -07:00
Ms2ger
aaed4a54c7 Use rustc-serialize rather than the built-in deprecated serialize. 2015-02-17 13:24:15 +01:00
Adenilson Cavalcanti
ffa62c9688 Companion single Color patch.
This will also update the rust-azure dependency
to point to the hash where we have a single Color type.

Just executed ref-tests and no regressions found.
2015-02-13 14:49:28 -08:00
Ms2ger
d931617449 Make some feature gates conditional to avoid unused feature warnings. 2015-02-13 14:57:52 +01:00
Ms2ger
e25322ce5b Fix warnings in gfx. 2015-02-13 11:00:20 +01:00
Matt Brubeck
76a2653f8f Replace append_from and prepend_from with DList::append 2015-02-12 15:38:46 -08:00
Simon Sapin
d5dd1d658e Upgrade to rustc ba2f13ef0 2015-02-04 2015-02-11 14:48:34 -08:00
Ms2ger
a09a912178 Import net as net rather than servo_net. 2015-02-10 12:55:24 +01:00
Ms2ger
b2fcc2397e Import msg as msg rather than servo_msg. 2015-02-10 11:40:36 +01:00
Josh Matthews
446f0f447e Allow unused variables, imports, and mutable. 2015-02-09 17:41:57 -05:00
bors-servo
e14c569ed0 auto merge of #4832 : Adenilson/servo/transparentBlack01, r=jdm
This patch set will implement a new helper function for transparent black, while changing the behavior of helper black() function returning opaque black by default.

It will also use the new Color equality operator to streamline the code in some points.
2015-02-04 04:21:49 -07:00
Adenilson Cavalcanti
7a36634963 Using the equality operator in PaintContext. Pay attention this
is a change on behavior as we previously didn't test for alpha
channel.
2015-02-03 18:51:50 -08:00
Adenilson Cavalcanti
ffa23088ff Using the new transparent_black() in the proper places. 2015-02-03 18:08:30 -08:00
Adenilson Cavalcanti
e1db06475c There are cases where we need opaque black (e.g. border color) and
other cases where we need transparent black (e.g. clearing, root layers).
2015-02-03 17:40:50 -08:00
bors-servo
1e72608f5c auto merge of #4823 : Ms2ger/servo/warnings, r=jdm 2015-02-03 17:57:51 -07:00
Martin Robinson
8855a25780 Revert "Using Color equality operators to streamline code" 2015-02-03 15:07:30 -08:00
Martin Robinson
728f723753 Merge pull request #4825 from Adenilson/usingColorOperators01
Using Color equality operators to streamline code
2015-02-03 11:12:44 -08:00
Adenilson Cavalcanti
cc404aba1a Using Color equality operators to streamline code in
PaintContext and LayoutTask.
2015-02-03 11:03:09 -08:00
Ms2ger
e2408355a7 Fix build warnings. 2015-02-03 18:22:27 +01:00
Alexandru Cojocaru
685fee02a0 add unwrap to send/recv calls 2015-02-03 16:05:13 +01:00
bors-servo
6eac20d84d auto merge of #4809 : mrobinson/servo/rust-layers-update, r=glennw 2015-02-02 16:57:51 -07:00
Martin Robinson
77e11909b4 Update to latest rust-layers 2015-02-02 15:41:53 -08:00