Commit graph

585 commits

Author SHA1 Message Date
bors-servo
ac448cacba Auto merge of #7799 - mbrubeck:glyph-cleanup, r=pcwalton
Misc. code cleanup in gfx::text::glyph.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7799)
<!-- Reviewable:end -->
2015-09-30 17:44:02 -06:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Matt Brubeck
5bacfe9db9 Remove unused CharIndex field from GlyphIterator::Item 2015-09-30 09:52:10 -07:00
Matt Brubeck
d3d1d15615 Remove unused is_missing flag 2015-09-30 09:45:24 -07:00
Matt Brubeck
fa85d5f312 Remove unneeded adapt_character_flags_of_entry 2015-09-30 09:41:53 -07:00
Matt Brubeck
4174c918ad Make set_char_is_space mutate self in place 2015-09-30 09:38:12 -07:00
Matt Brubeck
e663005ce2 Simplify add_glyph_for_char_index 2015-09-30 09:36:01 -07:00
bors-servo
b1d9f438b7 Auto merge of #7751 - mrobinson:refactor-hit-testing, r=pcwalton
Make DisplayList hit testing a method on DisplayList

This will allow us to hit test into DisplayLists that are not directly
contained in StackingContexts, but instead are children of PaintLayers.
It also makes things slightly simpler.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7751)
<!-- Reviewable:end -->
2015-09-30 03:04:16 -06:00
bors-servo
a0cb657fe8 Auto merge of #7423 - pcwalton:iframe-stacking-context-position, r=glennw
layout: Make the compositor rather than layout determine the position of each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that only the size of an iframe is
determined during layout, and the position is determined by the
compositor. Layout layerizes iframes and marks the iframe layers with
the appropriate subpage ID so that the compositor can place them
correctly.

Closes #7377.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7423)
<!-- Reviewable:end -->
2015-09-29 19:26:49 -06:00
Matt Brubeck
569b434023 Fix shaping of tab characters with Harfbuzz 1.0
Harfbuzz now renders tabs with a "missing character" glyph by default, so we
need to filter them out ourselves after computing an advance.
2015-09-29 14:34:51 -07:00
Matt Brubeck
371e6897e1 Break text runs by unicode script 2015-09-29 14:34:49 -07:00
Matt Brubeck
062493fac6 Upgrade to the new harfbuzz-sys crate 2015-09-29 14:34:48 -07:00
Patrick Walton
c72d0c2ed0 layout: Make the compositor rather than layout determine the position of
each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that both the sizes and positions of
iframes are determined by the compositor. Layout layerizes all iframes
and marks the iframe layers with the appropriate pipeline and subpage
IDs so that the compositor can place them correctly. This approach is
similar in spirit to Gecko's `RefLayer` infrastructure. The logic that
determines when it is time to take the screenshot for reftests has been
significantly revamped to deal with this change in delegation of
responsibility.

Additionally, this code removes the infrastructure that sends layout
data back to the layout task to be destroyed, since it is now all
thread-safe and can be destroyed on the script task.

The failing tests now fail because of a pre-existing bug related to
intrinsic heights and borders on inline replaced elements. They happened
to pass before because we never rendered the iframes at all, which meant
they never had a chance to draw the red border the tests expect to not
render!

Closes #7377.
2015-09-29 09:47:28 -07:00
Martin Robinson
a2cf8e583d Make DisplayList hit testing a method on DisplayList
This will allow us to hit test into DisplayLists that are not directly
contained in StackingContexts, but instead are children of PaintLayers.
It also makes things slightly simpler.
2015-09-28 18:34:07 -07:00
bors-servo
7933b48430 Auto merge of #7596 - pcwalton:async-web-font-loading, r=mbrubeck
layout: Load Web fonts asynchronously.

Improves page load times significantly.

Closes #7343.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7596)
<!-- Reviewable:end -->
2015-09-28 12:11:50 -06:00
Glenn Watson
5684a75187 A few clean ups for Au type 2015-09-28 16:05:16 +10:00
Patrick Walton
1892b27daf layout: Do a couple of minor style cleanups. 2015-09-27 15:38:22 -07:00
Patrick Walton
9bb6acd690 layout: Load Web fonts asynchronously.
Improves page load times significantly.

Closes #7343.
2015-09-27 15:38:20 -07:00
bors-servo
4d1be2f56c Auto merge of #7703 - bjwbell:bugfix-0px-and-non-0px-border-widths, r=pcwalton
gfx: Fix border-radius panic when a corner has 0px and >0px borders

When one border is 0px and the other is >0px then the border corner
drawing code panics when computing the values to use in drawing the
border corner arcs.

This fixes that bug and makes the `draw_corner` function more robust
by explicitly passing an enum, `BorderCorner`, naming which corner is
being drawn e.g. `BorderCorner::TL`.

Add a ref test,
`border_radius_zero_sizes_a.html/border_radius_zero_sizes_ref.html`.

Fixes https://github.com/servo/servo/issues/7700.

r? @pcwalton or @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7703)
<!-- Reviewable:end -->
2015-09-24 18:18:07 -06:00
bors-servo
09b970af4a Auto merge of #7710 - mrobinson:small-dl-refactor, r=pcwalton
A few small bits of refactoring to prepare for more advanced DisplayList layerization

This will be useful when PaintLayers that contain DisplayLists instead
of StackingContexts need to draw themselves. This is a simple
preparatory refactoring and doesn't change any behavior.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7710)
<!-- Reviewable:end -->
2015-09-23 17:22:31 -06:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Manish Goregaokar
3c969b346a Upgrade rust to f93ab64d4a1a7ee91759a1594ab2a426b6cc657e/rustc-1.5.0-dev. 2015-09-23 14:44:59 +02:00
Martin Robinson
31a5eea823 Remove an unused function 2015-09-22 11:29:53 -07:00
Martin Robinson
71b83d6e99 Pass PaintTile to painting threads
This will be useful because in the future, PaintTiles might hold simple
DisplayLists instead of StackingContexts.
2015-09-22 11:29:15 -07:00
Martin Robinson
117c278936 Move DisplayList drawing logic to struct implementation
This will be useful when PaintLayers that contain DisplayLists instead
of StackingContexts need to draw themselves. This is a simple
preparatory refactoring and doesn't change any behavior.
2015-09-22 09:33:07 -07:00
Bryan Bell
17c20f06fc Unabbreviate BorderCorner enum values 2015-09-22 08:06:21 -07:00
Bryan Bell
15af32cc27 Unify two branches of match statement in intersec_ellipse_line 2015-09-21 21:15:23 -07:00
Bryan Bell
345a069201 Code review nits 2015-09-21 17:59:07 -07:00
Bryan Bell
071acf476b gfx: Fix border-radius panic when a corner has 0px and >0px borders
When one border is 0px and the other is >0px then the border corner
drawing code panics when computing the values to use in drawing the
border corner arcs.

This fixes that bug and makes the `draw_corner` function more robust
by explicitly passing an enum, `BorderCorner`, naming which corner is
being drawn e.g. `BorderCorner::TL`.

Add a ref test,
`border_radius_zero_sizes_a.html/border_radius_zero_sizes_ref.html`.

Fixes https://github.com/servo/servo/issues/7700.
2015-09-21 17:26:47 -07:00
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
bors-servo
c91c0188f2 Auto merge of #7679 - bjwbell:reftest-twitter-fail-whale, r=pcwalton
Add css twitter fail whale html test & update ellipse_to_bezier comment

cgaebel had a TODO for a css twitter fail whale reftest, which depended on elliptical border-radius support.
I didn't see any feasible way other than a reference image for border_twitter_fail_whale_b.html.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7679)
<!-- Reviewable:end -->
2015-09-18 22:54:44 -06:00
Bryan Bell
f4a04614ff Add css twitter fail whale test & update ellipse_to_bezier comment 2015-09-18 20:55:10 -07:00
Hugo Thiessard
6565e7b02f Issue #7390 correct the order of mod declaration 2015-09-18 22:02:04 +02:00
Matt Brubeck
9333f028e8 Snap to screen pixels instead of px
Fixes #7665.
2015-09-18 03:06:06 -07:00
Martin Robinson
1e6f797268 Ensure unique LayerIds for pseudo-elements
Currently pseudo-elements, like the fragments created for ::before and
::after, with layers will have the same LayerId as the body of their
owning fragments. Instead all LayerIds should be unique.

Fixes #2010.
2015-09-17 06:42:29 -07:00
Patrick Walton
757e2cf4e5 layout: Reformat some long lines and fix some whitespace issues. 2015-09-17 13:31:17 +02:00
Patrick Walton
af8fcdf073 gfx: Fix a minor typo. 2015-09-17 13:31:16 +02:00
Patrick Walton
53f47e74db gfx: Remove some useless calls to drop during HarfBuzz shaping. 2015-09-17 13:31:14 +02:00
Patrick Walton
dc26511ff3 gfx: Properly create continuation glyph entries for ligatures. 2015-09-17 13:31:09 +02:00
Patrick Walton
c62d8292c7 gfx: Add a Debug impl for GlyphStore instances.
Gecko has a `Dump()` routine in a similar spirit.
2015-09-17 13:31:08 +02:00
Martin Robinson
30963d76be Improve printing of DisplayLists
Use box tree characters to make DisplayLists easier to scan when
printing them out.
2015-09-16 12:31:38 -07:00
bors-servo
6a12f00d6d Auto merge of #7605 - nox:skew, r=mbrubeck
Implement "transform: skew()"

Thanks to @Jinwoo-Song for the original commit, which I just rebased and cleaned up. Fixes #6237.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7605)
<!-- Reviewable:end -->
2015-09-16 06:31:48 -06:00
bors-servo
b05f4aa3aa Auto merge of #7559 - ddrmanxbxfr:RFC-0344-Work, r=nox
Remove 'get_*' on getters as per RFC 0344 on canevas, compositing, devtools, gfx, layout, net, profile, servo and webdriver_server

Hi guys,

I just gave a big pass of RFC-0344 as per issue #6224 .

Pretty much renamed all the get_* fn that were used to fetch values. 

I hope I didn't rename too much. 

As said in the issue discussion, I didn't touch at the scripts folder so we keep the unsafe ones pretty explicit.

I've ran the whole pass of test, everything seems to be still working right :).

Please give feedback on this PR.

Thanks for looking into it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7559)
<!-- Reviewable:end -->
2015-09-12 18:29:56 -06:00
Mathieu Rheaume
7320433cca Remove 'get_*' on getters as per RFC 0344 on various components 2015-09-12 20:14:01 -04:00
Anthony Ramine
f11fcebd9c Bump euclid to 0.2 2015-09-12 01:06:26 +02:00
bors-servo
c838259383 Auto merge of #7527 - bjwbell:simd_advance_for_char_range, r=metajack
Use SIMD in fast path for advance_for_char_range

In advance_for_char_range add a fast SIMD code path for the the common
case where there are no detailed glyphs.


r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7527)
<!-- Reviewable:end -->
2015-09-09 16:55:16 -06:00
Bryan Bell
0c99b7e6a9 Add fast SIMD code path in advance_for_char_range
In advance_for_char_range add a SIMD code path for the the common
case of no detailed glyphs.

- gfx/Cargo.toml
  Add simd dependency https://github.com/huonw/simd

- servo/Cargo.lock
  Add simd dependency https://github.com/huonw/simd @
  d9ad79d86eab50a8f36d45fe17aa9e3a533389ee.

- SIMD isn't used on non-x86_65/aarch64 architectures.
2015-09-09 15:20:20 -07:00
bors-servo
f29ddb4b5d Auto merge of #7577 - bjwbell:borders_pixel_rounding_bug, r=mbrubeck
gfx: Fix bug with 1px width borders disappearing

In to_nearest_azure_rect when rounding to pixel coordinates, maintain
the invariant of rect non-overlap (if before rounding two rects don't overlap).

The previous code rounded the rect top left corner to the nearest pixel with
the size rounded to the nearest pixel multiple which can violate the
non-overlap condition, e.g.
10px×9.60px at (0px,6.6px) & 10px×9.60px at (0px,16.2px)
would round to
10px×10.0px at (0px,7.0px) & 10px×10.0px at (0px,16.0px), which overlap.

Instead round each corner to the nearest pixel.

For rects that dont need to satify the non-overlap condition and with
width or height between 0.5px and 1px, rounding each rect corner to the
nearest pixel can yield an empty rect e.g.
10px×0.6px at 0px,28.56px -> 10px×0px at 0px,29px.

For this scenario a new function to_nearest_non_empty_azure_rect
rounds the rect top left corner to the nearest pixel and the rect size
to the nearest pixel multiple. It's possible for non-overlapping rects
after this rounding to overlap.

This should fix https://github.com/servo/servo/issues/7184 "rounding ...borders not to be visible", without breaking https://github.com/servo/servo/issues/7152 "Underlines less than 1px high sometimes invisible".

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7577)
<!-- Reviewable:end -->
2015-09-09 13:30:41 -06:00
bors-servo
c0381c7325 Auto merge of #7563 - mrobinson:layerize-stacking-contexts, r=pcwalton
Layerize StackingContexts that are on top of layers

StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7563)
<!-- Reviewable:end -->
2015-09-09 10:52:56 -06:00
Martin Robinson
184238c348 Layerize StackingContexts that are on top of layers
StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.
2015-09-09 09:13:14 -07:00