Bug 1707154 - Use surface device pixel scale for image mask rects r=gfx-reviewers,bradwerth

Differential Revision: https://phabricator.services.mozilla.com/D114917
This commit is contained in:
Glenn Watson 2021-05-12 21:00:32 +00:00
Родитель 54a52e060a
Коммит 2ca046cde2
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -3603,7 +3603,7 @@ impl ClipBatcher {
// ensure nothing is drawn outside the target. If for some reason we can't map the
// rect back to local space, we also fall back to just using a scissor rectangle.
let world_rect =
sub_rect.translate(actual_rect.origin.to_vector()) / global_device_pixel_scale;
sub_rect.translate(actual_rect.origin.to_vector()) / surface_device_pixel_scale;
let (clip_transform_id, local_rect, scissor) = match map_local_to_world.unmap(&world_rect) {
Some(local_rect)
if clip_transform_id.transform_kind() == TransformedRectKind::AxisAligned &&
@ -3653,7 +3653,7 @@ impl ClipBatcher {
let tile_world_rect = map_local_to_world
.map(&tile.tile_rect)
.expect("bug: should always map as axis-aligned");
let tile_device_rect = tile_world_rect * global_device_pixel_scale;
let tile_device_rect = tile_world_rect * surface_device_pixel_scale;
tile_device_rect
.translate(-actual_rect.origin.to_vector())
.round_out()
@ -3683,7 +3683,7 @@ impl ClipBatcher {
if is_first_clip &&
(!clip_is_axis_aligned ||
!(map_local_to_world.map(&rect).expect("bug: should always map as axis-aligned")
* global_device_pixel_scale).contains_rect(&actual_rect)) {
* surface_device_pixel_scale).contains_rect(&actual_rect)) {
clear_to_one = true;
}
true