Closed Bug 1361662 Opened 4 years ago Closed 4 years ago

Fix rounding tests after enabling background color layer

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: ethlin, Assigned: ethlin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

After enabling background color layer, the test '1ayout/reftests/pixel-rounding/rounded-background-color-top-4.html' will fail[1]. It looks like we'll have some difference on the edge of the elements. I guess it's because originally we paint everything in a painted layer and the coordinate is in float[2]. After we have a color layer for it, the layer's coordinate is in integer[3]. Not sure if we should fuzz these tests or fix them.


[1] https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://queue.taskcluster.net/v1/task/DkZtEIYsRSmLYrTDb-fd_Q/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1
[2] https://dxr.mozilla.org/mozilla-central/source/layout/painting/nsDisplayList.cpp?q=path%3AnsDisplayList.cpp&redirect_type=single#4071
[3] https://dxr.mozilla.org/mozilla-central/source/layout/painting/nsDisplayList.cpp?q=path%3AnsDisplayList.cpp&redirect_type=single#4036
Matt, would you mind providing some suggestions on this?
Flags: needinfo?(matt.woodrow)
Do we need the ColorLayer bounds to be an IntRect?
Flags: needinfo?(matt.woodrow)
Whiteboard: [gfx-noted]
Blocks: 1361721
I think I found the problem. Gecko does rounding for the coordinate of layers except mask layer. In this case, we have a color layer and there is a mask layer on it. The position mismatch between the color layer and mask layer causes this problem.
I use the same way "ToNearestPixels" to round the bound of mask layer. Then the round reftests passed[1] with background color layer on. I also checked m-c try result[2] and it looks like the change doesn't effect the original tests.

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=d25b69de022a955fc179d0adbe40f8355ae0ef42&selectedJob=98236784

[2] https://treeherder.mozilla.org/#/jobs?repo=try&revision=11a9f57acce04d1942937d56746c390534635d43&selectedJob=98239148
Attachment #8866651 - Flags: review?(matt.woodrow)
Attachment #8866651 - Flags: review?(matt.woodrow) → review+
Assignee: nobody → ethlin
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8336687998c5
Round mask layer boundary to match other layers. r=mattwoodrow
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8336687998c5
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.