Closed
Bug 1453747
Opened 7 years ago
Closed 6 years ago
Correct dest rect used in ComputeImageContainerDrawingParameters
Categories
(Core :: Graphics: WebRender, defect, P3)
Core
Graphics: WebRender
Tracking
()
RESOLVED
FIXED
mozilla66
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: aosmond, Assigned: aosmond)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file, 2 obsolete files)
The dest rect we pass to WebRender is rounded, but the dest rect we use in the ComputeImageContainerDrawingParameters is not. This can cause subtle differences between the decode size and what we render at.
Assignee | ||
Comment 1•7 years ago
|
||
We should avoid making situations like bug 1420648 worse with any changes made here.
Assignee: nobody → aosmond
Status: NEW → ASSIGNED
Priority: -- → P3
See Also: → 1420648
Whiteboard: [gfx-noted]
Assignee | ||
Updated•7 years ago
|
Priority: P3 → P1
Assignee | ||
Comment 2•7 years ago
|
||
There seems to have been a regression where Twitter smilies look bad with WebRender again (at least for me). These changes make them look good again.
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1b4e90deb827ef68725ccae48c08fb76eb12bbb
Assignee | ||
Comment 3•7 years ago
|
||
Mostly reduced/eliminated fuzz for a few affected reftests.
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=57dc506cef36345a30eee317a471d7b006f9a73c
Attachment #8967476 -
Attachment is obsolete: true
Assignee | ||
Updated•7 years ago
|
Attachment #8967716 -
Flags: review?(mstange)
Comment 4•7 years ago
|
||
Oh, it sounds like I misunderstood what the patch does.
Snapping needs to happen in LayerPixel space, not in LayoutDevicePixel space. These spaces are different as soon as there is a CSS scale transform, or during pinch-zooming on Android.
So the code that obtains a scale from somewhere needs to stay, and somehow we need to pass this scale to the other places where we want to snap.
Assignee | ||
Comment 5•7 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #4)
> Oh, it sounds like I misunderstood what the patch does.
>
> Snapping needs to happen in LayerPixel space, not in LayoutDevicePixel
> space. These spaces are different as soon as there is a CSS scale transform,
> or during pinch-zooming on Android.
> So the code that obtains a scale from somewhere needs to stay, and somehow
> we need to pass this scale to the other places where we want to snap.
But the dest rect passed to WebRender via PushImage is already rounded without applying the scaling, which must happen afterwards? Aside from the nsImageRenderer / background image case, I would have thought it would match more closely to what WR does today than not.
Comment 6•7 years ago
|
||
(In reply to Andrew Osmond [:aosmond] from comment #5)
> But the dest rect passed to WebRender via PushImage is already rounded
> without applying the scaling
Oh, indeed! That's the wrong thing to do. In fact, ToRoundedLayoutRect is a function that shouldn't exist. It should be replaced with a method on StackingContextHelper, e.g. StackingContextHelper::ToSnappedLayoutRect, which can take the stacking context's scale into account.
Comment 7•7 years ago
|
||
Ha. It used on to be on StackingContextHelper until https://hg.mozilla.org/mozilla-central/rev/9ebf785a75d1
Comment 8•7 years ago
|
||
Oh, heh.
Updated•7 years ago
|
Blocks: stage-wr-nightly
Comment 9•7 years ago
|
||
Comment on attachment 8967716 [details] [diff] [review]
0001-Bug-1453747-Use-rounded-dest-rect-in-simplified-imag.patch, v2
Canceling review for now.
Attachment #8967716 -
Flags: review?(mstange)
Comment 11•6 years ago
|
||
Apparently this discussion happened but it was a while ago. From what Andrew remembers the conclusion was that the rounding should happen inside WR, but it wasn't clear exactly where, and it's outside the scope of code Andrew is working on. So I'm unassigning this from him.
The user-visible impact is that some small images (e.g. Twitter smilies) will appear blurry because they get rendered at e.g. 15px instead of 16px. On large images it should not be noticeable. I think that we can probably live with that on Nightly, so I'm downgrading this to block riding the trains instead of Nightly.
Assignee: aosmond → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(aosmond)
Updated•6 years ago
|
Priority: P1 → P2
Comment 12•6 years ago
|
||
The guiding principles with respect to snapping (and many more things) are:
1. We should be consistent in how we snap throughout all the code that uses WebRender.
2. WebRender snapping should be consistent with non-WebRender snapping.
These principles are not opposed to each other, but principle 1 is more important than principle 2. The current patch in this bug achieves principle 1 but gets us a bit farther away from principle 2.
I'm willing to r+ the patch in this state, once it is updated to apply on current mozilla-central.
Updated•6 years ago
|
Priority: P2 → P3
Updated•6 years ago
|
Assignee: nobody → aosmond
Assignee | ||
Comment 13•6 years ago
|
||
We are using the unrounded dest rect to calculate the image decode size
in ComputeImageContainerDrawingParameters, while passing the rounded
dest rect to WebRender. This mismatch causes images to be decoded to one
size and display at another, cause some visual distortions. Using the
correct rect seems to allow us to remove the extra snapping logic added
to work around this.
At this time, how we snap is different between WebRender and
non-WebRender in general. This patch will likely morph again once we
bring the two models closer together.
Assignee | ||
Updated•6 years ago
|
Attachment #8967716 -
Attachment is obsolete: true
Assignee | ||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
Pushed by aosmond@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/70f87448b9e4
Use rounded dest rect in simplified image decode size calculations for WebRender. r=mstange
Comment 16•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox66:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in
before you can comment on or make changes to this bug.
Description
•