Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFinal compile fixes for pathfinder #2723
Conversation
…r" compile errors on Windows Fixes #2645. PathfinderFontContext can contain a raw *mut IDWriteFactory (on Windows). However, since we know that it is wrapped in a Mutex here, it is safe to assume that the struct is thread-safe. PathfinderComPtr::new is an unsafe function, so we have to wrap it in an unsafe block.
|
r? @pcwalton |
|
Can we have that path tested on CI? |
|
Yes although, as I said, it will crash at runtime. Compilation tests should work, though. |
|
@kvark Would it be enough to do only appveyor + taskcluster? Linux + macOS would already be tested on taskcluster, so no need for travis to re-check for that... |
Verify that the patfinder feature compiles on Windows, Mac and Linux
|
@fschutt I think we should keep Travis is sync with TaskCluster in what it's building for as long as Travis is useful, to avoid confusion at least. |
| use std::ops::Deref; | ||
| use tiling::RenderTargetKind; | ||
| use webrender_api::{DeviceIntPoint, DevicePixel}; | ||
| } else if #[cfg(not(feature = "pathfinder"))] { |
This comment has been minimized.
This comment has been minimized.
| use tiling::SpecialRenderPasses; | ||
| #[cfg(feature = "pathfinder")] | ||
| use webrender_api::{DeviceIntPoint, DevicePixel}; | ||
| cfg_if! { |
This comment has been minimized.
This comment has been minimized.
kvark
May 3, 2018
Member
The amount of diversion between the pathfinder and whatnot features of this module is pretty high. We should consider splitting those into separate modules, potentially leaving something shared in another module. This would be cleaner than multiple #[cfg(feature = "pathfinder")] spread over the code.
This comment has been minimized.
This comment has been minimized.
fschutt
May 3, 2018
Author
Contributor
Yeah ok, but this is going to take a while to split up the files and resolve all the errors. I'll do two seperate files for the pathfinder and the no_pathfinder configuration.
This comment has been minimized.
This comment has been minimized.
fschutt
May 3, 2018
Author
Contributor
btw, is there any difference between use api:: and use webrender_api:: or are they the same?
This comment has been minimized.
This comment has been minimized.
kvark
May 3, 2018
Member
No, this is because of this line in "lib.rs": pub use webrender_api as api;
I'd much prefer us just doing pub extern crate webrender_api as api; in the first place, without any ambiguity.
This comment has been minimized.
This comment has been minimized.
fschutt
May 3, 2018
Author
Contributor
But, are you ok with the rest of the changes? If I push the refactored glyph_rasterizer module, this will create a huge commit, so I'd prefer a review before I split up the module. Semanticall it'll all be the same, just the PR will be larger.
This comment has been minimized.
This comment has been minimized.
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| //! Module only available when pathfinder is activated |
This comment has been minimized.
This comment has been minimized.
This commit doesn't change any semantics, but it exposes the files `glyph_rasterizer_ext_no_pathfinder` (containing only the items previously marked with cfg(not(feature = "pathfinder")) and the `glyph_rasterizer_pathfinder`, which has all previous cfg(feature = "pathfinder") items. The public / private visibilities of the structs are the same as before.
|
Reviewed 2 of 4 files at r1, 3 of 3 files at r2, 2 of 3 files at r3, 1 of 6 files at r4, 3 of 6 files at r5. appveyor.yml, line 23 at r5 (raw file):
somewhat less relevant, I wonder if we can use webrender/src/glyph_rasterizer/no_pathfinder.rs, line 24 at r5 (raw file):
why do we need pathfinder-related methods in this module at all? Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions. appveyor.yml, line 23 at r5 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I think we can change from "cargo build" to "cargo check" whenever we are not doing anything with the final binary. I.e. we just see if it compiles, then throw the binary away. I am not aware of checks where you have to compile the crate in order to verify that it compiles. I'll change it for all of the CI. webrender/src/glyph_rasterizer/no_pathfinder.rs, line 24 at r5 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
The Comments from Reviewable |
|
@kvark Just notifying you that the issues are fixed now. I changed |
|
Looks like we are almost there! Reviewed 5 of 6 files at r6. webrender/src/glyph_rasterizer/mod.rs, line 355 at r6 (raw file):
let's put the Comments from Reviewable |
This now uses compile-time flags instead of an empty `()` field for the pathfinder_context.
|
Review status: 10 of 11 files reviewed at latest revision, 4 unresolved discussions. webrender/src/glyph_rasterizer.rs, line 47 at r3 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/glyph_rasterizer/mod.rs, line 355 at r6 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. Comments from Reviewable |
|
Reviewed 1 of 1 files at r7. Comments from Reviewable |
|
As this is just moving things around, I don't expect any reftest failures, but we'll stay on guard. |
|
|
…=kvark Final compile fixes for pathfinder Closes #2645. Note: On Windows, pathfinder won't yet run properly, partly due to https://github.com/pcwalton/pathfinder/pull/82 and partly due to some `RenderTask`-related bugs (currently it crashes with "unexpected render task: glyph task") in ` webrender::render_task::RenderTask::uv_rect_kind`. However, pathfinder now at least compiles on Windows, Linux and Mac. Also added various `#[derive(Debug)]` necessary for debugging the pathfinder crashes. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2723) <!-- Reviewable:end -->
|
|
fschutt commentedMay 3, 2018
•
edited by larsbergstrom
Closes #2645.
Note: On Windows, pathfinder won't yet run properly, partly due to https://github.com/pcwalton/pathfinder/pull/82 and partly due to some
RenderTask-related bugs (currently it crashes with "unexpected render task: glyph task") inwebrender::render_task::RenderTask::uv_rect_kind.However, pathfinder now at least compiles on Windows, Linux and Mac. Also added various
#[derive(Debug)]necessary for debugging the pathfinder crashes.This change is