aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/font_cache_thread.rs
Commit message (Collapse)AuthorAgeFilesLines
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-14/+15
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+2
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Try to `use` WebRender types moreMartin Robinson2023-07-101-14/+7
| | | | | The newer versions of WebRender move types around between `webrender` and `webrender_api` and this will reduce the churn during the upgrade.
* use SerializedFontTemplate and IpcBytesReceiver to send font template when ↵s-maurice2022-03-081-3/+54
| | | | | | responding to GetFontTemplate Signed-off-by: s-maurice <51819025+s-maurice@users.noreply.github.com>
* feat: shorten thread namesyvt2021-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel imposes a 15-byte limit on thread names[1]. This means information that does not fit in this limit, e.g., the pipeline ID of layout and script threads, is lost in a debugger and profiler (see the first column of the table below). This commit shortens the thread names used in Servo to maximize the amount of information conveyed. It also rectifies some inconsistencies in the names. | Before | After | |-------------------|-------------------| | `BluetoothThread` | `Bluetooth` | | `CanvasThread` | `Canvas` | | `display alert d` | `AlertDialog` | | `FontCacheThread` | `FontCache` | | `GLPlayerThread` | `GLPlayer` | | `HTML Parser` | `Parse:www.examp` | | `LayoutThread Pi` | `Layout(1,1)` | | `Memory profiler` | `MemoryProfiler` | | `Memory profiler` | `MemoryProfTimer` | | `OfflineAudioCon` | `OfflineACResolv` | | `PullTimelineMar` | `PullTimelineDat` | | `ScriptThread Pi` | `Script(1,1)` | | `WebWorker for h` | `WW:www.example.` | | `ServiceWorker f` | `SW:www.example.` | | `ServiceWorkerMa` | `SvcWorkerManage` | | `Time profiler t` | `TimeProfTimer` | | `Time profiler` | `TimeProfiler` | | `WebGL thread` | `WebGL` | | `Choose a device` | `DevicePicker` | | `Pick a file` | `FilePicker` | | `Pick files` | `FilePicker` | [1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars
* Make url for "client" referrer mandatoryMatthias Deiml2020-06-171-2/+5
|
* Update webrender.Josh Matthews2020-06-111-4/+7
|
* Proxy all WR interactions for layout/font/script/canvas threads to the ↵Josh Matthews2020-06-091-28/+14
| | | | | | | compositor thread. There is now a single RenderApi that is used, and all transactions are serialized through the compositor.
* Convert all uses of UpdateResources api to use webrender transactions.Josh Matthews2020-05-111-2/+7
|
* Implementing the builder pattern for RequestInitLucas Fantacuci2019-04-101-8/+2
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-1/+1
|
* Remove redundant `.clone()`sShotaro Yamada2018-12-111-1/+1
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Remove useless `use crate_name;` imports.Simon Sapin2018-11-081-2/+0
| | | | A `crate_name::foo` path always works in 2018
* Reorder importsPyfisch2018-11-061-3/+3
|
* Format remaining filesPyfisch2018-11-061-4/+8
|
* Sort `use` statementsSimon Sapin2018-11-061-4/+4
|
* `cargo fix --edition`Simon Sapin2018-11-061-9/+9
|
* Format the rest of gfx #21373kingdido9992018-09-081-112/+170
|
* Update WR (transaction API change)Glenn Watson2018-06-201-8/+8
|
* FontContext: Cache data fetched from the cache threadJon Leighton2018-05-191-1/+1
| | | | | | | 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.
* Implement font fallbackJon Leighton2018-05-191-91/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix servo build.Emilio Cobos Álvarez2018-04-281-5/+2
|
* Add font cache debugging to isolate cause of IPC failures in CI.Josh Matthews2018-02-221-10/+24
|
* Add test for FontContext/FontGroup functionalityJon Leighton2018-02-221-31/+33
| | | | | | | | | | | | | | | | | | | | | | 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.
* style: Move font-family outside of makoCYBAI2017-11-261-15/+15
|
* Merge request type and destinationKeith Yeung2017-10-231-2/+1
|
* Update WR (font variations, runtime dp ratio changes)Glenn Watson2017-09-211-1/+2
|
* Update WR (font instance API).Glenn Watson2017-08-311-23/+56
| | | | | | | | | | | | | | | | | | | | 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.
* order derivable traits listsClément DAVID2017-08-231-5/+5
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Update WR.Glenn Watson2017-08-091-3/+5
| | | | | | | * CPU text run optimizations. * Linux subpixel positioning / rasterization. * Update debug flags API. * Update to resource transactions API.
* Auto merge of #16508 - brainlessdeveloper:fetch-set-origin, r=asajeffreybors-servo2017-07-171-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properly set origin of fetch requests <!-- Please describe your changes on the following line: --> These changes aim to fix #15247 --- <!-- 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 #15247 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes - [x] These changes do not require tests because cors is already tested with different origins These changes require changes in tests, but I need help with that (see comments below). <!-- 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/16508) <!-- Reviewable:end -->
| * Change RequestInit origin type to ImmutableOriginFausto Núñez Alberro2017-07-161-1/+2
| |
* | Upgrade to the latest version of WebRenderMartin Robinson2017-07-131-5/+5
|/
* Update WR (driver workaround, large clip mask fix, font index support).Glenn Watson2017-04-191-2/+2
|
* Serialize unquoted font-family without quoteNazım Can Altınova2017-03-301-2/+2
|
* Update WR (image tiling, inset box shadow fixes, new key api).Glenn Watson2017-02-271-3/+5
|
* Use FamilyName instead of FontFamily in @font-faceSimon Sapin2017-02-021-4/+4
| | | | | … to exclude generic families, per spec: https://drafts.csswg.org/css-fonts/#font-family-desc
* Auto merge of #14588 - servo:log-font-face, r=jdmbors-servo2016-12-141-1/+13
|\ | | | | | | | | | | | | | | Add logging to font-face loading. <!-- 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/14588) <!-- Reviewable:end -->
| * Add logging to font-face loading.Ms2ger2016-12-141-0/+5
| |
| * Implement Display for LowercaseString.Ms2ger2016-12-141-1/+8
| |
* | Removed util.Alan Jeffrey2016-12-141-3/+3
|/
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-4/+8
|
* Update to string-cache 0.3Simon Sapin2016-11-031-1/+1
|
* Use fetch_async in the font cache.Ms2ger2016-11-021-20/+18
|
* Ignore the Content-Type header completely for @font-face.Ms2ger2016-11-021-36/+1
| | | | | | This matches the previous default (network.mime.sniff off) behaviour in all but one case: we will now accept a font without a `Content-Type` header, which would previously have been ignored.
* Remove old rendering backend.Glenn Watson2016-10-181-5/+7
| | | | | | | | | | | | | | 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.
* Privatize PendingAsyncLoad.Ms2ger2016-10-041-8/+8
|
* Auto merge of #12076 - jdm:font-load, r=pcwaltonbors-servo2016-09-191-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+3
| |