Commit graph

156 commits

Author SHA1 Message Date
Glenn Watson
b015e93dc5 Update WR (font instance API).
WR now has a concept of font templates and font instances. This
makes the WR font interfaces closer to Cairo and Gecko, and also
makes some future performance optimizations possible.

A font template is the font family, and data backing the font.
A font instance is a reference to a font template and per-instance
options, such as font size, anti-aliasing settings etc.

To update Servo in a minimally invasive way, I added a new font
cache call, that creates a font instance. This means that when
a font is created, and doesn't exist in the cache there are now
two calls to the font cache thread. We could refactor the font
cache to make this work in one call, which we should do in the
future. However, refactoring the font cache is a large chunk of
work by itself. The extra call is only when a font doesn't already
exist in the font context cache, so it should have minimal
performance impact.
2017-08-31 16:10:30 +10:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Simon Sapin
a205c82264 Upgrade to rustc 1.21.0-nightly (599be0d18 2017-07-26) 2017-07-27 02:21:01 +02:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Behnam Esfahbod
14c524df4f [gfx] [layout] [style] Upgrade unicode-bidi to 0.3 2017-05-22 20:06:19 -05:00
Manish Goregaokar
2230332f46 Update app_units to 0.4.1 2017-05-19 20:33:02 -07:00
Simon Sapin
02e1901bc1 Upgrade to rustc 1.19.0-nightly (ced823e26 2017-05-07) 2017-05-08 12:46:03 +02:00
Mátyás Mustoha
93f4ae9057 Use SIMD in gfx when possible 2017-02-04 12:46:22 +01:00
Vee Satayamas
c69567406e Fix #12193 Servo displays upper level Thai character in wrong place. 2017-02-01 14:28:15 -05:00
Florian Merz
b40db5b55d Position insertion point in input field with mouse 2017-01-11 09:04:03 +01:00
Julien Levesy
b78979d692 replace match by if let statements if possible 2016-12-31 12:34:05 +01:00
Glenn Watson
acfdfd2fa9 Remove old rendering backend.
This removes paint threads, rust-layers dependency, and changes
optional webrender types to be required.

The use_webrender option has been removed, however I've left
the "-w" command line option in place so that wpt
runner can continue to pass that. Once it's removed from there
we can also remove the -w option.

Once this stage is complete, it should be fine to change the
display list building code to generate webrender display
lists directly and avoid the conversion step.
2016-10-18 10:21:27 +10:00
Felipe
e0a48fe596 Use word-break to decide how glyph runs should be created 2016-09-27 11:25:21 +02:00
Felipe
d5669ead29 Implement word-break: keep_all 2016-09-27 11:25:21 +02:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Patrick Trottier
dd7daf2861 Fix GFX Warnings
Corrections to GFX Warnings Fix
2016-08-14 11:19:29 -04:00
Ravi Shankar
a04028eede Prefer length and percentage for word spacing 2016-08-09 17:53:40 +05:30
Anthony Ramine
8ecb5962f3 Move util::str to style 2016-07-05 10:43:54 +02:00
Ms2ger
e5cab36671 Move ByteIndex to gfx_traits. 2016-06-20 19:02:35 +02:00
Ms2ger
db5ddb561c Reduce the scope of the allowed unsafe code in gfx::text. 2016-06-05 12:31:55 +02:00
Ms2ger
75ea39c709 Remove an obsolete comment in gfx::text. 2016-06-05 12:31:54 +02:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Matt Brubeck
43e12f7eba Don't create HarfBuzz shaper if it isn't used
Move the fast shaping code out of the HarfBuzz shaper, and initialize the
shaper lazily to avoid creating any HarfBuzz objects.
2016-05-23 11:46:16 -07:00
Matt Brubeck
7bf6a41553 Remove unused FontShapingOptions field from Shaper 2016-05-23 11:26:39 -07:00
Matt Brubeck
5991afafa4 Add a fast path for shaping ASCII text 2016-05-20 16:47:01 -07:00
Matt Brubeck
7f6b1da85c Allow creation of unboxed FontTables 2016-05-19 09:44:56 -07:00
Matt Brubeck
0010b448b8 Move hb_tag! macro and KERN into font module 2016-05-19 09:44:56 -07:00
Matt Brubeck
1eab6fbb2e Simplify FontTableMethods::with_buffer 2016-05-19 09:44:56 -07:00
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