aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/platform/macos
Commit message (Collapse)AuthorAgeFilesLines
...
* Auto merge of #20021 - jonleighton:lazy-font-group, r=mbrubeck,glennwbors-servo2018-02-221-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lazy load fonts in a FontGroup The first commit message explains this so I'll just copy it here: --- This is a step towards fixing #17267. To fix that, we need to be able to try various different fallback fonts in turn, which would become unweildy with the prior eager-loading strategy. Prior to this change, FontGroup loaded up all Font instances, including the fallback font, before any of them were checked for the presence of the glyphs we're trying to render. So for the following CSS: font-family: Helvetica, Arial; The FontGroup would contain a Font instance for Helvetica, and a Font instance for Arial, and a Font instance for the fallback font. It may be that Helvetica contains glyphs for every character in the document, and therefore Arial and the fallback font are not needed at all. This change makes the strategy lazy, so that we'll only create a Font for Arial if we cannot find a glyph within Helvetica. I've also substantially refactored the existing code in the process and added some documentation along the way. --- I've added some tests in the second commit, but it required quite a bit of gymnastics to make it possible to write such a test. I'm not sure if the added complexity to the production code is worth it? On the other hand, having this infrastructure in place may be useful for testing future changes in this area, and also possibly brings us a step closer to extracting a library as discussed in #4901. (What I mean by that is: it reduces coupling between `FontCacheThread` and `FontContext` -- the latter would have a place in such a library, the former wouldn't.) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20021) <!-- Reviewable:end -->
| * Lazy load fonts in a FontGroupJon Leighton2018-02-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a step towards fixing #17267. To fix that, we need to be able to try various different fallback fonts in turn, which would become unweildy with the prior eager-loading strategy. Prior to this change, FontGroup loaded up all Font instances, including the fallback font, before any of them were checked for the presence of the glyphs we're trying to render. So for the following CSS: font-family: Helvetica, Arial; The FontGroup would contain a Font instance for Helvetica, and a Font instance for Arial, and a Font instance for the fallback font. It may be that Helvetica contains glyphs for every character in the document, and therefore Arial and the fallback font are not needed at all. This change makes the strategy lazy, so that we'll only create a Font for Arial if we cannot find a glyph within Helvetica. I've also substantially refactored the existing code in the process and added some documentation along the way.
* | Make FontTemplateData's Debug formatter more conciseJon Leighton2018-02-221-1/+18
|/ | | | | Otherwise the log gets spammed with all the individual bytes of the underlying font file.
* Use new CFArray iterator featuresLinus Färnstrand2018-01-291-14/+4
|
* Use specific negative assertion for gfx platform macos fontCYBAI2018-01-261-1/+1
|
* cleanup no need cfg target_ostigercosmos2017-12-251-2/+0
|
* gfx: Use ? on Option more often.Emilio Cobos Álvarez2017-12-091-5/+1
|
* style: Make all keywords CamelCase for consistency.Emilio Cobos Álvarez2017-12-061-13/+14
| | | | This prevents confusion and paves the ground for derive(Parse) of them.
* WR multi-document supportDzmitry Malyshau2017-11-221-5/+5
|
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* order derivable traits listsClément DAVID2017-08-231-1/+1
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Upgrade to the latest version of WebRenderMartin Robinson2017-07-131-1/+1
|
* Use integer for specified and computed font-weightXidorn Quan2017-07-061-11/+1
|
* Bump serde to 1.0Bastien Orivel2017-06-161-3/+3
|
* Use NativeFontHandle instead of CGFontalfredoyang2017-04-211-2/+3
|
* Fix panic when font face name is not availableDominik Boehi2017-04-121-2/+2
|
* Make ServoUrl::as_url return a &UrlAnthony Ramine2017-03-231-1/+1
|
* Update serde to 0.9 (fixes #15325)Anthony Ramine2017-02-181-3/+8
|
* Update rustc to 1.16.0-nightly (7821a9b99 2017-01-23).Ms2ger2017-01-241-4/+0
|
* gfx: Simplify OSX font template bytes accessor.Emilio Cobos Álvarez2016-12-251-3/+2
|
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-3/+3
|
* Update to string-cache 0.3Simon Sapin2016-11-031-1/+1
|
* gfx: On the Mac, take the scale into account when determining thePatrick Walton2016-10-111-2/+2
| | | | x-height of a font.
* Auto merge of #12076 - jdm:font-load, r=pcwaltonbors-servo2016-09-191-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make font template data load fallible Remove a TODO around dealing with a failed file operation. Can we write an automated test for this? I don't really know what font template data is, but this failure seems to be fontconfig-specific... --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12037 - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12076) <!-- Reviewable:end -->
| * Make font template data load fallible. Fixes #12037.Josh Matthews2016-07-051-4/+4
| |
* | Reorder `use` statementsUK9922016-09-092-5/+4
| |
* | Bail out gracefully on malformed kern table headers.Matt Brubeck2016-07-061-2/+5
|/ | | | Fixes #12081.
* Report use statements that use {} with only one entryCullen Rhodes2016-05-271-1/+1
|
* Add a fast path for shaping ASCII textMatt Brubeck2016-05-201-9/+126
|
* Make FontHandle fields privateMatt Brubeck2016-05-191-2/+2
|
* Allow creation of unboxed FontTablesMatt Brubeck2016-05-191-2/+2
|
* Simplify FontTableMethods::with_bufferMatt Brubeck2016-05-191-2/+2
|
* gfx: Change the mapping from Mac weights to CSS weights so that 0.0 mapsPatrick Walton2016-05-101-10/+14
| | | | | | | | | | | | | to 400, not 500. CSS `normal` font-weight is specified as 400, while Mac "Regular" font weight is reported as 0.0. On the Mac, we need to center the two ranges on the same value to avoid choosing "Light" fonts where "Regular" would have been more appropriate. Closes #9487. fix for mac
* gfx: Map `sans-serif` to Helvetica on Mac, DejaVu Sans on Linux, andPatrick Walton2016-05-091-0/+4
| | | | | | | | Roboto on Android. This matches what I believe the OS native defaults to be. Partially addresses #9487.
* gfx: Clamp the font size we supply to Core Text to 0.01pt.Patrick Walton2016-04-112-16/+27
| | | | | | | | | | Core Text treats a font size of 0.0 as 12.0, which is obviously not what we want. Improves Twitter. Improves Reddit /r/rust. Closes #10492.
* Bump serde to 0.7Anthony Ramine2016-03-171-2/+2
|
* Add WebRender integration to Servo.Glenn Watson2016-02-181-0/+36
| | | | | | | | 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!
* Say farewell to in-tree HeapSizeOfAnthony Ramine2016-02-041-1/+1
|
* Derive Debug on FontGroup and its componentsOlaf Buddenhagen2015-12-123-2/+4
|
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-1/+1
| | | | | | | | | | | Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock. Removed references to string_cache_plugin. Import atom! and ns! from string_cache. Replaced ns!("") by ns!(). Replaced ns!(XML) and co by ns!(xml) and co. Replaced atom!(foo) by atom!("foo"). Replaced Atom::from_slice by Atom::from. Replaced atom.as_slice() by &*atom.
* Fix issues found by rust-clippyCorey Farwell2015-10-121-2/+2
|
* Split Au type into separate crate, with minimal dependencies.Glenn Watson2015-10-011-1/+1
|
* A few clean ups for Au typeGlenn Watson2015-09-281-8/+22
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-193-12/+8
| | | | This merges import blocks that were reported by tidy as unmerged.
* Remove 'get_*' on getters as per RFC 0344 on various componentsMathieu Rheaume2015-09-122-5/+5
|
* Implement get_table_for_tag on FreeTypeMatt Brubeck2015-09-031-2/+2
| | | | Also fixes use-after-free of FontTable buffers.
* Remove no-op Drop implementation from FontTableMatt Brubeck2015-08-281-5/+0
| | | | This is no longer necessary for opting out of the Copy trait.
* sort all usesJohann Tuffe2015-08-203-6/+6
|
* Fix existing syntactics nits.Josh Matthews2015-08-161-1/+1
|
* Utilize match guard; make methods more similarCorey Farwell2015-08-111-15/+16
| | | | | Make the structure for the `stretchiness` and `boldness` methods more similar