aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-093-15/+20
|
* This updates the smallvec crate and enables the union featureAndre Bogus2018-09-191-1/+1
| | | | | | We had a mix of 0.6.2 and 0.6.5 (which is the current release), this unifies to the latest version. It also enables the union feature which removes the discriminant, reducing memory usage.
* Replace mpsc with crossbeam/servo channel, update ipc-channelSimon Sapin2018-09-121-1/+1
| | | | Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
* Switch from new-ordered-float back to ordered-floatMatt Brubeck2018-09-111-1/+1
| | | | | The `new-ordered-float` fork has been merged back into the original `ordered-float` crate.
* Reorder gfx lib createskingdido9992018-09-081-4/+4
|
* Format the rest of gfx #21373kingdido9992018-09-088-407/+508
|
* Format gfx text #21373kingdido9992018-09-076-266/+420
|
* 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-084-8/+14
|
* WR updatePaul Rouget2018-08-061-4/+4
|
* Fix build errors after rebaseFernando Jiménez Moreno2018-07-301-1/+1
|
* Use the packed_simd crate instead of std::simdSimon Sapin2018-07-273-4/+6
| | | | | `std::simd` was removed in https://github.com/rust-lang/rust/pull/52535. https://crates.io/crates/packed_simd is in the rust-lang-nursery org.
* Update euclid to 0.18Bastien Orivel2018-07-181-1/+1
|
* WIP: Dedupe dependenciesBastien Orivel2018-07-161-3/+3
|
* Remove debugging println from a year agoSimon Sapin2018-07-021-1/+0
|
* Update WR (transaction API change)Glenn Watson2018-06-201-8/+8
|
* Update dependencies to use new_debug_unrechableMatt Brubeck2018-06-062-3/+3
| | | | Because reem/rust-debug-unreachable#6 makes `debug_unreachable` enable debug checks even in release builds since Rust 1.0.
* Upgrade to rustc 1.28.0-nightly (524ad9b9e 2018-05-29)Anthony Ramine2018-05-301-3/+1
| | | | Fixes https://github.com/servo/servo/issues/20844
* Use std::simd instead of the simd crateSimon Sapin2018-05-243-12/+10
|
* Auto merge of #20506 - jonleighton:font-fallback, r=emilio,mbrubeckbors-servo2018-05-1917-350/+1025
|\ | | | | | | | | | | | | | | | | | | | | | | | | Font fallback This implements more complete support for font fallback, see #17267. r? @glennw @mbrubeck <!-- 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/20506) <!-- Reviewable:end -->
| * FontContext: Cache data fetched from the cache threadJon Leighton2018-05-194-9/+77
| | | | | | | | | | | | | | Before this change, if we needed to create a Font which we've already created, but at a new size, then we'd fetch the FontTemplateInfo again. If the bytes of the font are held in memory, then this could be expensive as we need to pass those bytes over IPC.
| * 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-1916-297/+889
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| |
* | Revert "Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02)"Josh Matthews2018-05-181-0/+3
|/ | | | This reverts commit 46ad8110172cfc9d8d420e8eb41863f3d394e24d.
* Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02)Simon Sapin2018-05-041-3/+0
|
* Auto merge of #20420 - pyfisch:corner-clipping, r=emiliobors-servo2018-04-294-1014/+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-224-1014/+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-288-125/+133
| |
* | style: Fixups for css-fonts-4 font-weight.Emilio Cobos Álvarez2018-04-284-42/+37
| |
* | Update WebrenderBastien Orivel2018-04-255-16/+17
| | | | | | | | Fixes #20609
* | Bump env_logger to 0.5 and log to 0.4 in every servo crateBastien Orivel2018-03-281-1/+1
|/
* Bump ipc-channel and bincodeBastien Orivel2018-03-211-1/+1
| | | | This required bumping uuid too which unfortunately duplicated rand.
* Update to handle WebRender API changesMartin Robinson2018-03-161-8/+8
| | | | Items now only take a clipping rectangle instead of a LocalClip.
* Bump euclid to 0.17Bastien Orivel2018-02-281-1/+1
|
* Introduce a dedicated data structure for text queriesPyfisch2018-02-242-35/+2
| | | | | | Add an IndexableText structure for text queries. Instead of linear search for a node this now uses a HashMap. Remove the now irrelevant fields from TextDisplayItem.
* Remove image_data field from display itemPyfisch2018-02-241-4/+0
| | | | It was unused.
* Use typed transforms in stacking contextsPyfisch2018-02-241-8/+8
|
* Add font cache debugging to isolate cause of IPC failures in CI.Josh Matthews2018-02-221-10/+24
|
* Auto merge of #20021 - jonleighton:lazy-font-group, r=mbrubeck,glennwbors-servo2018-02-2262-217/+657
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * Add test for FontContext/FontGroup functionalityJon Leighton2018-02-2258-52/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, this required quite a bit of changes to the non-test code. That's because FontContext depends on a FontCacheThread, which in turn depends on a CoreResourceThread and therefore lots of other data structures. It seemed like it would be very difficult to instantiate a FontContext as it was, and even if we could it seems like overkill to have all these data structures present for a relatively focused test. Therefore, I created a FontSource trait which represents the interface which FontContext uses to talk to FontCacheThread. FontCacheThread then implements FontSource. Then, in the test, we can create a dummy implementation of FontSource rather than using FontCacheThread. This actually has the advantage that we can make our dummy implementation behave in certain specific way which are useful for testing, for example it can count the number of times find_font_template() is called, which helps us verify that caching/lazy-loading is working as intended.
| * Lazy load fonts in a FontGroupJon Leighton2018-02-226-180/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge branch 'master' into freetype2dan-robertson2018-02-0842-223/+9966
|\
| * Auto merge of #19928 - jonleighton:issue-17321, r=jdmbors-servo2018-02-0840-70/+9902
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix FontTemplateDescriptor under FreeType 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. <!-- 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/19928) <!-- Reviewable:end -->
| | * Fix FontTemplateDescriptor under FreeTypeJon Leighton2018-02-0740-70/+9896
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | |