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 upFixed scaling artefacts in paint worklets caused by zoom and hidpi #17499
Conversation
highfive
commented
Jun 23, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jun 23, 2017
|
r? @glennw |
|
|
OK, I added a definition to pub fn device_pixel_ratio(&self) -> ScaleFactor<f32, CSSPixel, DevicePixel> {
let mut dppx = self.pres_context().mOverrideDPPX;
if dppx <= 0.0 { dppx = 1.0; }
ScaleFactor::new(dppx)
} |
|
No, that's not right. That's an override value if someone really needs to override the normal value and have the prescontext pretend like the override is what's going on. The normal value is nsPresContext::AppUnitsPerCSSPixel()/presContext->AppUnitsPerDevPixel() or so. |
|
@bzbarsky: thanks! |
335eb86
to
73c21e8
|
Slightly annoyingly, those functions aren't exported by our Gecko bindings. I think this is equivalent: pub fn device_pixel_ratio(&self) -> ScaleFactor<f32, CSSPixel, DevicePixel> {
let au_per_dpx = self.pres_context().mCurAppUnitsPerDevPixel as f32;
let au_per_px = AU_PER_PX as f32;
ScaleFactor::new(au_per_px / au_per_dpx)
} |
|
Yes, that seems reasonable. But again, mOverrideDPPX overrides if it's |
73c21e8
to
ee387a5
|
Good point. Thanks! |
|
|
ec193d7
to
b7e22dd
|
@glennw This PR's dependencies have been merged, so it's ready for review! |
|
|
|
|
@asajeffrey r=me on the changes - it'd be good if we could add a reftest either here or as a follow up though (I'm not sure if the reftest harness allows setting dpi ratio though). |
8eb8de3
to
c9c569a
|
Squashed. @bors-servo: r=glennw |
|
|
Fixed scaling artefacts in paint worklets caused by zoom and hidpi <!-- Please describe your changes on the following line: --> This PR renders paint worklet canvases at the device pixel resolution, rather than the CSS pixel resolution. It's a dependent PR, building on #17239, #17326 and #17364. --- <!-- 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 #17454 - [X] These changes do not require tests because we don't run reftests with zoom enabled <!-- 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/17499) <!-- Reviewable:end -->
|
|
c9c569a
to
caa3585
|
Got build-cef to compile. @bors-servo r=glennw |
|
|
Fixed scaling artefacts in paint worklets caused by zoom and hidpi <!-- Please describe your changes on the following line: --> This PR renders paint worklet canvases at the device pixel resolution, rather than the CSS pixel resolution. It's a dependent PR, building on #17239, #17326 and #17364. --- <!-- 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 #17454 - [X] These changes do not require tests because we don't run reftests with zoom enabled <!-- 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/17499) <!-- Reviewable:end -->
|
|
asajeffrey commentedJun 23, 2017
•
edited by larsbergstrom
This PR renders paint worklet canvases at the device pixel resolution, rather than the CSS pixel resolution.
It's a dependent PR, building on #17239, #17326 and #17364.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is