aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/platform
Commit message (Collapse)AuthorAgeFilesLines
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-1914-14/+14
|
* Remove useless `use crate_name;` imports.Simon Sapin2018-11-084-5/+0
| | | | A `crate_name::foo` path always works in 2018
* `cargo fix --edition-idioms`Simon Sapin2018-11-081-0/+2
|
* Auto merge of #22126 - pyfisch:autoformat, r=jdmbors-servo2018-11-0710-30/+49
|\ | | | | | | | | | | | | | | Enforce rustfmt on CI <!-- 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/22126) <!-- Reviewable:end -->
| * Reorder importsPyfisch2018-11-069-17/+21
| |
| * Format remaining filesPyfisch2018-11-067-13/+28
| |
* | Auto merge of #22074 - jdm:wrup, r=noxbors-servo2018-11-071-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | Update webrender. Fixes #22114. <!-- 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/22074) <!-- Reviewable:end -->
| * Update webrender to 790b76f1547453615262c3037e1fb04bda22fbc8.Josh Matthews2018-11-061-1/+1
| |
* | Sort `use` statementsSimon Sapin2018-11-066-12/+12
| |
* | `cargo fix --edition`Simon Sapin2018-11-069-26/+26
|/
* Support building for Magic Leap.Alan Jeffrey2018-10-291-2/+11
|
* Fix windows build errors.Josh Matthews2018-10-111-3/+20
|
* Use upstream font weight values for windows.Josh Matthews2018-10-091-15/+1
|
* Update webrender to 923ee495bd9b0fda8a4a94c5a6cf42e2f0548731.Josh Matthews2018-10-092-12/+17
|
* Fix comments indentation issue in gfx platformkingdido9992018-09-051-2/+3
|
* Format gfx platform #21373kingdido9992018-09-0513-373/+497
|
* gfx: Make FontHandleMethods::family_name return an optional value.Josh Matthews2018-08-083-6/+11
|
* Remove debugging println from a year agoSimon Sapin2018-07-021-1/+0
|
* Linux: Don't hold onto bytes of system fontsJon Leighton2018-05-192-51/+66
| | | | | | | | | | | | | FontTemplateData gets passed over IPC during the communication between FontContext and FontCacheThread. Serializing and deserializing these bytes is expensive, so this change ensures that we only do that when the bytes can't be read from disk. A similar strategy is already used on macos and windows. The performance problem was particularly noticeable after implenting font fallback, where the content process would potentially work through a list of fonts, trying to find one which contains a certain glyph. That could result in lots of font bytes going over IPC.
* Implement font fallbackJon Leighton2018-05-197-28/+512
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, if none of the fonts specified in CSS contained a glyph for a codepoint, we tried only one fallback font. If that font didn't contain the glyph, we'd give up. With this change, we try multiple fonts in turn. The font names we try differ across each platform, and based on the codepoint we're trying to match. The current implementation is heavily inspired by the analogous code in Gecko, but I've used to ucd lib to make it more readable, whereas Gecko matches raw unicode ranges. This fixes some of the issues reported in #17267, although colour emoji support is not implemented. == Notes on changes to WPT metadata == === css/css-text/i18n/css3-text-line-break-opclns-* === A bunch of these have started failing on macos when they previously passed. These tests check that the browser automatically inserts line breaks near certain characters that are classified as "opening and closing punctuation". The idea is that if we have e.g. an opening parenthesis, it does not make sense for it to appear at the end of a line box; it should "stick" to the next character and go into the next line box. Before this change, a lot of these codepoints rendered as a missing glyph on Mac and Linux. In some cases, that meant that the test was passing. After this change, a bunch of these codepoints are now rendering glyphs on Mac (but not Linux). In some cases, the test should continue to pass where it previously did when rendering with the missing glyph. However, it seems this has also exposed a layout bug. The "ref" div in these tests contains a <br> element, and it seems that this, combined with these punctuation characters, makes the spacing between glyphs ever so slightly different to the "test" div. (Speculation: might be something to do with shaping?) Therefore I've had to mark a bunch of these tests failing on mac. === css/css-text/i18n/css3-text-line-break-baspglwj-* === Some of these previously passed on Mac due to a missing glyph. Now that we're rendering the correct glyph, they are failing. === css/css-text/word-break/word-break-normal-bo-000.html === The characters now render correctly on Mac, and the test is passing. But we do not find a suitable fallback font on Linux, so it is still failing on that platform. === css/css-text/word-break/word-break-break-all-007.html === This was previously passing on Mac, but only because missing character glyphs were rendered. Now that a fallback font is able to be found, it (correctly) fails. === mozilla/tests/css/font_fallback_* === These are new tests added in this commit. 01 and 02 are marked failing on Linux because the builders don't have the appropriate fonts installed (that will be a follow-up). Fix build errors from rebase FontTemplateDescriptor can no longer just derive(Hash). We need to implement it on each component part, because the components now generally wrap floats, which do not impl Hash because of NaN. However in this case we know that we won't have a NaN, so it is safe to manually impl Hash.
* FreeType: Improve "Invalid codepoint" debug messageJon Leighton2018-05-061-1/+1
|
* Auto merge of #20420 - pyfisch:corner-clipping, r=emiliobors-servo2018-04-291-1/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move DL items from gfx to layout and implement corner clipping Implement corner clipping. Remove PixelFormat from WebrenderImageInfo. Use WebRender text shadow. Remove MallocSizeOf and Deserialize for DL items. Closes #19649, closes #19680, closes #19802 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/20420) <!-- Reviewable:end -->
| * Move DL items from gfx to layoutPyfisch2018-04-221-1/+9
| | | | | | | | | | | | | | | | | | Implement corner clipping. Remove PixelFormat from WebrenderImageInfo. Use WebRender text shadow. Remove MallocSizeOf and Deserialize for DL items. Closes #19649, #19680, #19802
* | Fix servo build.Emilio Cobos Álvarez2018-04-283-63/+73
| |
* | style: Fixups for css-fonts-4 font-weight.Emilio Cobos Álvarez2018-04-283-35/+27
| |
* | Update WebrenderBastien Orivel2018-04-252-8/+10
|/ | | | Fixes #20609
* Auto merge of #20021 - jonleighton:lazy-font-group, r=mbrubeck,glennwbors-servo2018-02-223-0/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-223-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-223-3/+49
|/ | | | | Otherwise the log gets spammed with all the individual bytes of the underlying font file.
* Fix FontTemplateDescriptor under FreeTypeJon Leighton2018-02-071-30/+63
| | | | | | | | | | | | | | Issue #17321. Under Linux, using "font-family: sans-serif" previously caused Servo to select the "UltraLight" face (of DejaVu Sans). There were two reasons for this: 1. Font weight was only retrieved from the OS/2 table for bold faces. This neglected to retrieve the weight information for "lighter than normal" weight faces. This meant that the UltraLight face appeared as normal weight, and was selected. 2. Retrieval of font stretch information from the OS/2 table was not implemented at all.
* Fix missing whitespace between functionsJon Leighton2018-02-031-0/+6
|
* Use new CFArray iterator featuresLinus Färnstrand2018-01-291-14/+4
|
* Use specific negative assertion for gfx platform macos fontCYBAI2018-01-261-1/+1
|
* Use specific negative assertion for gfx platform freetype font_listCYBAI2018-01-261-1/+1
|
* Use specific assertion for gfx platform freetype fontCYBAI2018-01-261-1/+1
|
* Fix typo. san-serif -> sans-serifPyfisch2018-01-041-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-063-47/+52
| | | | This prevents confusion and paves the ground for derive(Parse) of them.
* WR multi-document supportDzmitry Malyshau2017-11-221-5/+5
|
* FreeType: don’t use usable_size() as deallocation sizeSimon Sapin2017-10-301-38/+12
| | | | | | | Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it. Hopefully fixes https://github.com/servo/servo/issues/19058
* Use actual size for old allocation in ft_realloc.Matt Brubeck2017-10-241-2/+2
| | | | | | Prevents crashes from improperly freed memory. Fixes #19008, fixes #18950, fixes #18949.
* Stop relying on linking details of std’s default allocatorSimon Sapin2017-10-191-7/+9
| | | | | | | | | | | | We’ve been bitten before by symbol names changing: https://github.com/servo/heapsize/pull/46 and upstream is planning to stop using jemalloc by default: https://github.com/rust-lang/rust/issues/33082#issuecomment-309781465 So use the (relatively) new `#[global_allocator]` attribute to explicitly select the system allocator on Windows and jemalloc (now in an external crate) on other platforms. This choice matches current defaults.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-183-29/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* clean up cjk for ostigercosmos2017-10-181-13/+0
|
* Abuse Vec as an allocator in gfxSimon Sapin2017-10-131-17/+30
|
* Remove usage of unstable box syntax, except in the script crateSimon Sapin2017-10-121-4/+4
| | | | | … because there’s a lot of it, and script still uses any other unstable features anyway.
* order derivable traits listsClément DAVID2017-08-233-3/+3
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Auto merge of #17706 - glennw:linux-fonts, r=stshine,emiliobors-servo2017-07-131-8/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve font layout in Linux / Freetype platforms. This patch contains two small changes: * Fix the font size calculation that is passed to Freetype. This now matches exactly how Webrender and Gecko calculate font size to pass to layout. * Enable light hinting by default for fonts when using Freetype. We should make this configurable in the future, but this is a better default than no hinting (and matches what most Linux distros default to). These two changes (along with the pending WR update) fix a lot of the font layout issues on Linux. There is still at least one remaining issue with hidpi displays on Linux that will be fixed in a follow up patch. <!-- 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/17706) <!-- Reviewable:end -->
| * Improve font layout in Linux / Freetype platforms.Glenn Watson2017-07-141-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains two small changes: * Fix the font size calculation that is passed to Freetype. This now matches exactly how Webrender and Gecko calculate font size to pass to layout. * Enable light hinting by default for fonts when using Freetype. We should make this configurable in the future, but this is a better default than no hinting (and matches what most Linux distros default to). These two changes (along with the pending WR update) fix a lot of the font layout issues on Linux. There is still at least one remaining issue with hidpi displays on Linux that will be fixed in a follow up patch.