Commit graph

126 commits

Author SHA1 Message Date
Matt Brubeck
07f213cb87 Fix unused item warning on 32-bit platforms 2016-05-16 11:45:27 -07:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Ulf Nilsson
0f983cd11f Make text-align: justify incremental layout safe 2016-05-10 15:46:22 +02:00
Matt Brubeck
0f221521ab Filter out whitespace glyphs from display list
Fixes #10244.
2016-05-05 09:30:28 -07:00
Patrick Walton
8823f87276 layout: Don't pretend inline fragment sizes are zero when placing them
between floats.
2016-05-04 13:19:52 -07:00
Matt Brubeck
894f6395e6 Use xi-unicode for line breaking 2016-04-30 20:37:22 -07:00
Matt Brubeck
659305fe0a Use byte indices instead of char indices for text runs
Replace character indices with UTF-8 byte offsets throughout the code dealing
with text shaping and breaking.  This eliminates a lot of complexity when
converting from one to the other, and interoperates better with the rest of
the Rust ecosystem.
2016-04-28 14:32:14 -07:00
Matt Brubeck
dba878dfb2 Remove unneeded add_nonglyph_for_char_index
This is a no-op, since a "non-glyph" is simply `GlyphEntry(0)`. This is the
same as `GlyphEntry::initial()`, which all the entries are already initialized
to.
2016-04-28 08:07:13 -07:00
Matt Brubeck
97a58e9689 Don't assume the first glyph is part of the first char
Shaper::save_glyph_results incorrectly starts its loop by setting glyph_span
to a length of 1.  This means that the `if glyph_span.len() == 0` test in the
inner loop will never succeed.

Instead the glyph span should start out empty, and a glyph should be added only
as the corresponding char is found.  For comparison, see the Gecko code this
was ported from:

https://hg.mozilla.org/mozilla-central/file/ab0044bf/gfx/thebes/gfxHarfBuzzShaper.cpp#l1682
2016-04-28 07:59:42 -07:00
Matt Brubeck
4d05bf23b8 Get rid of unnecessary clamping in text shaping 2016-04-27 10:58:16 -07:00
Matt Brubeck
83feda3ac2 Stop using deprecated str::char_* methods
Fixes deprecation warnings in the gfx crate.
2016-04-27 10:57:11 -07:00
Matt Brubeck
7e67bb788c Replace range::Range with std::ops::Range in text shaping code 2016-04-27 10:17:21 -07:00
Zbynek Winkler
924d804583 Move '&&' to the end of the previous line.
Following https://github.com/servo/servo/issues/10692 this is just a
formating change to satisfy a new tidy requirement of not having '&&' at
the beginning of a line.
2016-04-22 14:28:18 +02:00
Guillaume Gomez
02095cf550 Remove util::vec::Comparator 2016-03-01 14:28:16 +01:00
Jonathan Schuster
205336bf2e Move util::range into its own crate 2016-02-25 21:06:10 -05:00
Glenn Watson
c0531c312f Add WebRender integration to Servo.
WebRender is an experimental GPU accelerated rendering backend for Servo.

The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).

WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
2016-02-18 10:35:29 +10:00
bors-servo
6490d1e1c5 Auto merge of #9013 - antrik:debug-fontgroup, r=Ms2ger
Derive Debug for FontGroup and Homu is a bully

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9013)
<!-- Reviewable:end -->
2015-12-18 14:23:15 +05:30
Patrick Walton
520c561d3d gfx: Cache the last result of
`TextRun::index_of_first_glyph_run_containing` in TLS.

This achieves a 40% or so hit rate on Wikipedia.
2015-12-16 09:44:43 -08:00
Patrick Walton
85c73deb78 gfx: Cache the total advance of each glyph store.
The total advance is asked for over and over.
2015-12-15 11:24:36 -08:00
Olaf Buddenhagen
c5ede5851e Derive Debug on FontGroup and its components 2015-12-12 10:04:33 +01:00
Tetsuharu OHZEKI
e8c12c1c6d Fix warnings: Use Vec.extend_from_slice instead of Vec.push_all 2015-12-10 16:49:29 -05:00
Eli Friedman
3a451ff845 Add support for pre-wrap and pre-line values for white-space.
This is mostly straightforward.  I had to modify a couple of places
which were accidentally discarding whitespace.

Fixes #1513.
2015-10-20 10:44:51 -07:00
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
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
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
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
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
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
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
Manish Goregaokar
8e2c37a542 Fix match_refs and let_returns in layout, address review changes 2015-09-04 18:30:46 +05:30
Manish Goregaokar
e94df1ed5c Remove needless returns 2015-09-04 09:13:48 +05:30
Matt Brubeck
afafb0b71c Implement get_table_for_tag on FreeType
Also fixes use-after-free of FontTable buffers.
2015-09-03 13:35:44 -07:00
bors-servo
60c72f601c Auto merge of #7475 - wilmoz:checkBracesSpaces, r=jdm
Make test-tidy check that braces have spaces before or after them

https://github.com/servo/servo/issues/7413
Posible future/past bug fixed in components/script/timers.rs

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7475)
<!-- Reviewable:end -->
2015-08-31 13:18:23 -06:00
wilmoz
64ac4f175f Make test-tidy check that braces have spaces before or after them 2015-08-31 12:30:55 -05:00
Matt Brubeck
5f126ff301 Remove unnecessary adapt_character_flags call 2015-08-28 11:14:52 -07:00
Matt Brubeck
4d32e8b20e Rearrange remaining bits of GlyphEntry 2015-08-28 11:14:50 -07:00