Page MenuHomePhabricator

Bug 1579235 - Part 7 - Fix UV rect calculation for external textures.
ClosedPublic

Authored by gw on Feb 28 2020, 12:20 AM.

Details

Summary

This patch fixes an oversight in part 5 of this patch series that
could result in an incorrect UV rect being used for an external
texture that uses a custom UV rect.

When the texture is an external texture, the UV rect is not known when
the external surface descriptor is created, because external textures
are not resolved until the lock() callback is invoked at the start of
the frame render. To handle this, query the texture resolver for the
UV rect if it's an external texture, otherwise use the default UV rect.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gw created this revision.Feb 28 2020, 12:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2020, 12:20 AM
phab-bot requested review of this revision.Feb 28 2020, 12:20 AM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.
nical added inline comments.Feb 28 2020, 10:24 AM
gfx/wr/webrender_api/src/units.rs
173

The way i read this kind of implies the two spaces are equivalent, which is never the case.
I would much prefer a wordy function like cast_to_texel_rect(&DeviceIntRect) -> TexelRect that makes it a bit clearer that we have been lying to the type system, Or a DeviceOrTexelRect enum.

Bert accepted this revision.Feb 28 2020, 7:28 PM
This revision is now accepted and ready to land.Feb 28 2020, 7:28 PM
gw updated this revision to Diff 236575.Mar 1 2020, 3:55 AM