Commit graph

321 commits

Author SHA1 Message Date
bors-servo
fdeebf86a1 Auto merge of #6309 - nnethercote:instrument-freetype, r=glennw
This will allow reporting of memory usage by FreeType instances, which
are measured in the MiBs for LayoutWorker threads.

This change also makes FreeType allocations happen with jemalloc instead
of the system malloc, which is a good thing.

Finally, the change documents some dubiousness involving
FontContextHandle.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6309)
<!-- Reviewable:end -->
2015-06-10 16:53:55 -06:00
Nicholas Nethercote
1553fada53 Instrument FreeType allocations.
This will allow reporting of memory usage by FreeType instances, which
are measured in the MiBs for LayoutWorker threads.

This change also makes FreeType allocations happen with jemalloc instead
of the system malloc, which is a good thing.

Finally, the change documents some dubiousness involving
FontContextHandle.
2015-06-10 15:48:19 -07:00
Glenn Watson
899ab226de Updates for changes in rust-geom and rust-layers 2015-06-11 07:19:58 +10:00
Patrick Walton
e42011cd53 Revert "Updates for changes in rust-geom and rust-layers" 2015-06-10 14:14:51 -07:00
Patrick Walton
053296e131 Merge pull request #6329 from glennw/remove-generic
Updates for changes in rust-geom and rust-layers
2015-06-10 14:14:24 -07:00
Glenn Watson
8fb29c91e6 Updates for changes in rust-geom and rust-layers 2015-06-11 07:05:56 +10:00
bors-servo
35000a9b85 Auto merge of #6317 - frewsxcv:rm-util-crate-reexports, r=Ms2ger
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.

These indirect dependencies through the util component are unnecessary.

This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6317)
<!-- Reviewable:end -->
2015-06-10 08:23:11 -06:00
Corey Farwell
4f47b41fa7 Remove fnv & smallvec crate reexports from util
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.

These indirect dependencies through the util component are unnecessary.

This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.
2015-06-10 07:14:55 -07:00
bors-servo
9df13b9069 Auto merge of #6324 - mmatyas:arm_build, r=Ms2ger
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6324)
<!-- Reviewable:end -->
2015-06-10 06:46:13 -06:00
Mátyás Mustoha
53427f43ab Add ARM build support. 2015-06-10 14:24:57 +02:00
Corey Farwell
a9b0607bf1 Utilize if let instead of match in a few places 2015-06-09 21:15:38 -07:00
Manish Goregaokar
ea9842723d Audit and reduce unstable usage in gfx
Reasons behind existing unstable features:

alloc:

 - weak pointers (may not belong)
 - boxed::into_raw and from_raw (naming)

collections:

 - `Vec.push_all()` (May be replaced)
   - Replace with loop

core:

 - `min_by` (#15311)
 - `PI_2` (naming)

rustc_private:

 - FnVHasher
   - Can be replaced by rust-fnv

std_misc:

 - Hash state stuff (no option here unless we want to stop using it)

str_char:

 - CharRange usage
   - Can be replaced by regular iterators (char_indices)
2015-06-09 23:24:18 +05:30
Jack Moffitt
b5ebbaefe3 Clean up dependencies. 2015-06-07 12:14:38 -06:00
Eduard Burtescu
00e8e5f77d Use the correct log crate and setup env_logger in main. 2015-06-06 23:20:40 +03:00
Corey Farwell
a14c745a6a Bump rust-url version: 0.2.16 → 0.2.35 2015-06-04 16:45:15 -04:00
Manish Goregaokar
d347aeda38 fix rebase conflicts 2015-06-03 09:56:43 +05:30
Manish Goregaokar
13b4bcfbb7 Remove all Arc-less ignores, force reasons, ignore_heap_size_of 2015-06-03 07:14:21 +05:30
Manish Goregaokar
5447d2af3d remove more heapsize ignores 2015-06-03 07:14:20 +05:30
Manish Goregaokar
a5975e8f33 use knownheapsize for geom stuff 2015-06-03 07:14:18 +05:30
Manish Goregaokar
c1daf889af use HeapSizeOf plugin in gfx 2015-06-03 07:13:40 +05:30
bors-servo
05212b702d Auto merge of #6214 - glennw:parse-transforms, r=pcwalton
* Add parser support for 3d transforms.
 * Change ComputedMatrix to a representation that suits interpolation.
 * Switch stacking contexts to use 4x4 matrices.

The transforms themselves are still converted to 2d and handled by azure for now, but this is a small standalone part that can be landed now to make it easier to review.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6214)
<!-- Reviewable:end -->
2015-06-02 19:56:17 -05:00
Corey Farwell
435e551753 Remove get_ prefix on getters
Part of #6224

I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
2015-06-02 08:54:44 -04:00
bors-servo
10127d6b5a Auto merge of #6199 - nnethercote:instrument-paint-task-buffer-map, r=pcwalton
Example output from the memory profiler:

```
|       1.04 MiB -- url(http://en.wikipedia.org/wiki/Main_Page)
|          0.26 MiB -- display-list
|          0.78 MiB -- paint-task       # new output line
|             0.78 MiB -- buffer-map    # new output line
```

The buffer maps aren't huge, but they're worth measuring, and it's good
to get the memory profiler plumbing into PaintTask.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6199)
<!-- Reviewable:end -->
2015-05-28 22:45:34 -05:00
Glenn Watson
f47ba6fd33 First step towards 3d transforms.
* Add parser support for 3d transforms.
 * Change ComputedMatrix to a representation that suits interpolation.
 * Switch stacking contexts to use 4x4 matrices.

The transforms themselves are still converted to 2d and handled by azure for now, but this is a small standalone part that can be landed now to make it easier to review.
2015-05-29 09:47:38 +10:00
bors-servo
c97c0a9f94 Auto merge of #6065 - mmatyas:canvas_antialias, r=jdm
This patch turns on antialiasing for the canvas, and updates the painting code to use the updated Azure DrawOptions defined in servo/rust-azure#158.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6065)
<!-- Reviewable:end -->
2015-05-28 14:59:36 -05:00
Mátyás Mustoha
f4c0bd3b80 Turn off default antialiasing for most DrawOptions. 2015-05-28 18:42:16 +02:00
Mátyás Mustoha
adef44183d Enable antialiasing for the canvas. 2015-05-28 11:10:57 +02:00
Nicholas Nethercote
e8fc406520 Reduce unsafe-ness in FontContextHandle::new().
Because `box + boxed::into_raw() + boxed::from_raw` is nicer than
`libc::malloc() + mem::transmute() + ptr::write() + libc::free()`.
2015-05-27 21:50:09 -07:00
Nicholas Nethercote
16ba32521b Don't leak the struct_FT_MemoryRec_.
We libc::malloc() a struct_FT_MemoryRec_ and pass it to FreeType. We
need to libc::free() it as well when FreeType is done with it.
2015-05-27 21:22:11 -07:00
Nicholas Nethercote
a21f6c407c Measure paint task buffer maps in the memory profiler.
Example output from the memory profiler:

```
|       1.04 MiB -- url(http://en.wikipedia.org/wiki/Main_Page)
|          0.26 MiB -- display-list
|          0.78 MiB -- paint-task       # new output line
|             0.78 MiB -- buffer-map    # new output line
```

The buffer maps aren't huge, but they're worth measuring, and it's good
to get the memory profiler plumbing into PaintTask.
2015-05-27 18:27:18 -07:00
Jinwoo Song
557bb11bde Use FT_Done_Library instead of FT_Done_Freetype
It is recommended to use FT_Done_Library with FT_New_Library
from freetype document.

Fixes #6191.
2015-05-28 10:17:06 +09:00
Simon Sapin
56af011355 Use harfbuzz bindings from crates.io
https://github.com/servo/rust-harfbuzz/issues/39
https://www.mail-archive.com/dev-servo@lists.mozilla.org/msg01289.html
2015-05-26 14:47:34 +02:00
Corey Farwell
8e3f4bba85 Reduce max line length from 150 to 120 characters
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
Patrick Walton
fec43b49bb layout: Implement per-glyph font fallback.
This improves numerous pages, for example Wikipedia and Ars Technica.

Closes #177.
2015-05-22 17:16:24 -07:00
bors-servo
1060cfde68 Auto merge of #6152 - glennw:runnable-panic, r=jdm
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6152)
<!-- Reviewable:end -->
2015-05-20 20:01:32 -05:00
Glenn Watson
b84c6fa5db Fix document load event firing after pipeline is closed. 2015-05-21 08:39:09 +10:00
bors-servo
ad53e95080 Auto merge of #6083 - ecoal95:layerize-canvas, r=pcwalton
I've done a bit of job to get this done. Right now readback is still used, but we have a `LayerId` -> `CanvasRenderer` map on the paint task, that we can use to get rid of that.

I'd want review, to see if this is a good approach (I know it's not the initial `CanvasId` -> renderer approach, but it's pretty similar, since a canvas involves a `PaintLayer`).

I had to do a bit of refactoring to avoid cyclic dependencies between canvas and gfx. I'd want you to review them too.

It's mergeable and doesn't break any tests :P

Some of my main concerns:
* Does the canvas render really need to be behind an `Arc<Mutex<T>>`?
* I can't clone a `NativeSurface` right now (that's why the `SendNativeSurface()` msg is unimplemented in the WebGL task). It should be easy to add that to rust-layers, supposing the caller is responsible to mark it as non-leaking, any reason to not do it?

cc @jdm @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6083)
<!-- Reviewable:end -->
2015-05-20 15:42:06 -05:00
ecoal95
3350522306 Layerize canvas
Note that this keeps using readback right now, `NativeSurface` painting
will be implemented soon.

Also see https://github.com/servo/servo/issues/6142
2015-05-20 19:10:50 +02:00
bors-servo
165bfd6d5f Auto merge of #6143 - michaelwu:truetype-only, r=pcwalton
I have a number of pcf fonts installed. One of them is Adobe Helvetica, and it turns out many websites try to use Helvetica. This crashes servo.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6143)
<!-- Reviewable:end -->
2015-05-20 02:36:43 -05:00
bors-servo
c51e9f0455 Auto merge of #6131 - glennw:jquery-exit-fix, r=jdm
This fixes a hang found while testing the jQuery test suite.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6131)
<!-- Reviewable:end -->
2015-05-19 21:44:45 -05:00
Michael Wu
51503a2816 Avoid selecting bitmap fonts from fontconfig 2015-05-19 21:10:04 -04:00
Patrick Walton
6a197719b3 compositing: Implement display ports and avoid creating display lists
for items outside it.

This improves Servo's performance on large pages.
2015-05-19 16:53:51 -07:00
Glenn Watson
35a570ab66 Fix several hangs / panics during pipeline cleanup of in progress loads.
This fixes a hang found while testing the jQuery test suite.
2015-05-19 16:14:25 +10:00
Patrick Walton
a0980091cf gfx: Implement paint flashing, which will be useful for debugging
invalidation.
2015-05-14 15:45:41 -07:00
Glenn Watson
2b3737d34e Various fixes for cleaning up iframes, compositor layers, pipelines and threads.
This allows most of the jquery test suite to run without exhausting thread resources.
2015-05-14 11:42:54 +10:00
bors-servo
5e61ebaa05 Auto merge of #6031 - glennw:reftest-race-conditions, r=larsberg,jdm
The basic idea is it's safe to output an image for reftest by testing:
 - That the compositor doesn't have any animations active.
 - That the compositor is not waiting on any outstanding paint messages to arrive.
 - That the script tasks are "idle" and therefore won't cause reflow.
    - This currently means page loaded, onload fired, reftest-wait not active, first reflow triggered.
    - It could easily be expanded to handle pending timers etc.
 - That the "epoch" that the layout tasks have last laid out after script went idle, is reflected by the compositor in all visible layers for that pipeline.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6031)
<!-- Reviewable:end -->
2015-05-13 18:37:54 -05:00
Glenn Watson
eec3fad93d Fixes a number of race conditions and reliability issues with reftests and compositor.
The basic idea is it's safe to output an image for reftest by testing:
 - That the compositor doesn't have any animations active.
 - That the compositor is not waiting on any outstanding paint messages to arrive.
 - That the script tasks are "idle" and therefore won't cause reflow.
    - This currently means page loaded, onload fired, reftest-wait not active, first reflow triggered.
    - It could easily be expanded to handle pending timers etc.
 - That the "epoch" that the layout tasks have last laid out after script went idle, is reflected by the compositor in all visible layers for that pipeline.
2015-05-14 09:35:53 +10:00
Patrick Walton
a299a2c71c layout: Minor whitespace and formatting cleanups. 2015-05-13 12:00:55 -07:00
Patrick Walton
711993eb46 gfx: Print out stacking context info when dumping display lists. 2015-05-13 12:00:54 -07:00
bors-servo
606ab1df44 Auto merge of #6013 - glennw:compositor-race, r=pcwalton
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6013)
<!-- Reviewable:end -->
2015-05-12 20:44:19 -05:00