gecko-dev/dom
Jamie Nicol 0c43a18e35 Bug 1913568 - Handle SurfaceTexture transforms in webrender, for reals this time. r=gfx-reviewers,media-playback-reviewers,padenot,nical
On Android, SurfaceTextures provide a transform that should be applied
to texture coordinates when sampling from the texture. Usually this is
simply a y-flip, but sometimes it includes a scale and slight
translation, eg when the video frame is contained within a larger
texture. Previously we ignored this transform but performed a y-flip,
meaning we rendered correctly most of the time, but not all of the
time.

Our first attempt to fix this was in bug 1731980. When rendering as a
compositor surface with RenderCompositorOGLSWGL, we supplied the
transform to CompositorOGL's shaders, which correctly fixed the bug
for this rendering path.

However, the attempted fix for hardware webrender in fact made things
worse. As UV coordinates are supplied to webrender unnormalized, then
the shaders normalize them by dividing by the actual texture size,
this effectively handled the scale component of the transform. (Though
not quite scaling by the correct amount, and ignoring the translation
component, sometimes resulting in a pixel-wide green seam being
visible at the video's edges.) When we additionally applied the
transformation to the coordinates, it resulted in the scale being
applied twice, and the video being rendered too far zoomed
in.

To make matters worse, when we received subsequent bug reports of
incorrect rendering on various devices we mistakenly assumed that the
devices must be buggy, rather than our code being incorrect. We
therefore reverted to ignoring the transform on these devices, thereby
breaking the software webrender path again.

Additionally, on devices without GL_OES_EGL_image_external_essl3
support, we must sample from the SurfaceTexture using an ESSL1
shader. This means we do not have access to the correct texture size,
meaning we cannot correctly normalize the UV coordinates. This results
in the video being rendered too far zoomed out. And in the
non-compositor-surface software webrender path, we were accidentally
downscaling the texture when reading back into a CPU buffer, resulting
in the video being rendered at the correct zoom, but being very
blurry.

This patch aims to handle the transform correctly, in all rendering
paths, hopefully once and for all.

For hardware webrender, we now supply the texture coordinates to
webrender already normalized, using the functionality added in the
previous patch. This avoids the shaders scaling the coordinates again,
or using an incorrect texture size to do so.

For RenderCompositorOGLSWGL, we continue to apply the transform using
CompositorOGL's shaders.

In the non-compositor-surface software webrender path, we make
GLReadPixelsHelper apply the transform when reading from the
SurfaceTexture in to the CPU buffer. Again using functionality added
earlier in this patch series. This avoids downscaling the image. We
can then provide the default untransformed and unnormalized UVs to
webrender. As a result we can now remove the virtual function
RenderTextureHost::GetUvCoords(), added in bug 1731980, as it no
longer serves any purpose: we no longer want to share the
implementation between RenderAndroidSurfaceTextureHost::Lock and
RenderTextureHostSWGL::LockSWGL.

Finally, we remove all transform overrides on the devices we
mistakenly assumed were buggy.

Differential Revision: https://phabricator.services.mozilla.com/D220582
2024-09-09 14:06:26 +00:00
..
abort Bug 1903676 - Fix bad rebase. r=me on a CLOSED TREE 2024-09-05 20:35:38 -04:00
animation Bug 1915206 - Simplify SVG transforms a bit more. r=longsonr 2024-08-27 21:14:28 +00:00
audiochannel Bug 1865896 - Apply DefineEnum to AudioChannelService::AudibleChangedReasons r=media-playback-reviewers,padenot 2024-07-31 16:32:18 +00:00
base Bug 1773976 - Add a new nsContentPolicyType TYPE_INTERNAL_EXTERNAL_RESOURCE. r=emilio 2024-09-09 12:16:12 +00:00
battery
bindings Bug 1916234 - Remove global constructor from dom/html/nsGenericHTMLElement.cpp r=emilio 2024-09-05 06:12:03 +00:00
broadcastchannel Bug 1908725 - Part 4: Switch some basic uses of OtherPid over to OtherChildID, r=smaug 2024-08-07 20:39:40 +00:00
cache Bug 1773976 - Add a new nsContentPolicyType TYPE_INTERNAL_EXTERNAL_RESOURCE. r=emilio 2024-09-09 12:16:12 +00:00
canvas Bug 1916907 - Support linear gradients in DrawTargetWebgl. r=aosmond 2024-09-05 17:24:16 +00:00
chrome-webidl Bug 1909270 - Clear thirdParty flag on redirect r=zombie 2024-08-26 14:39:07 +00:00
clients
commandhandler
console Bug 1910698 - Remove nsIScriptError.sourceLine. r=smaug,devtools-reviewers,webdriver-reviewers,necko-reviewers,nchevobbe,kershaw,jdescottes,credential-management-reviewers,dimi 2024-08-01 17:12:48 +00:00
credentialmanagement Bug 1914853 - Fix crash with invalid parameter combination and add coverage to WPT - r=anti-tracking-reviewers,timhuang 2024-08-27 18:27:50 +00:00
crypto Bug 1793429 - Make the deriveBits's length argument Nullable r=keeler,webidl,smaug 2024-08-07 09:17:48 +00:00
debugger Bug 1906719 - Implement a native backend for tracing JS execution r=arai 2024-08-05 15:44:21 +00:00
docs Bug 1874689 - Enable forkserver by default in Nightly. r=jld 2024-08-05 08:11:46 +00:00
encoding
events Bug 1917258 - Make kNonPlainTextExternalFormats constexpr r=handyman 2024-09-07 17:17:51 +00:00
fetch Bug 1773976 - Add a new nsContentPolicyType TYPE_INTERNAL_EXTERNAL_RESOURCE. r=emilio 2024-09-09 12:16:12 +00:00
file Bug 1910698 - Remove nsIScriptError.sourceLine. r=smaug,devtools-reviewers,webdriver-reviewers,necko-reviewers,nchevobbe,kershaw,jdescottes,credential-management-reviewers,dimi 2024-08-01 17:12:48 +00:00
filesystem
flex
fs Bug 1915112 - Improve documentation for CheckedUnsafePtr usage in dom/fs; r=dom-storage-reviewers,jari 2024-08-28 20:24:52 +00:00
gamepad Bug 1900930 - Add WouldReportJSException() calls. r=dom-core,farre,necko-reviewers,kershaw 2024-08-21 08:43:09 +00:00
geolocation Bug 1900225: Part 6 - Wait for Windows permission dialog to be dismissed before requesting geolocation r=emilio,win-reviewers,gstoll 2024-08-27 22:47:33 +00:00
grid
html Bug 1914141 - Added an ending-in-number check for non-ipv4 domains for Services.io.isValidHostname. r=necko-reviewers,valentin 2024-09-05 21:07:34 +00:00
imptests
indexedDB Bug 1915228 - Remove expired telemetry scalars idb.failure.unknown_objectstore_empty_database and idb.failure.unknown_objectstore_non_empty_database, r=dom-storage-reviewers,janv. 2024-08-28 19:44:29 +00:00
interfaces Bug 1907928: part 3) Implement reporting violations for sink type mismatches for `Element.insertAdjacentHTML`. r=tschuster,smaug,peterv 2024-09-02 13:58:25 +00:00
ipc Backed out changeset 53c46eb7b7ac (bug 1911801) for causing bc jobs to fail as exception on linux asan and tsan. CLOSED TREE 2024-09-06 22:08:43 +03:00
jsurl
l10n
locales Bug 1907928: part 3) Implement reporting violations for sink type mismatches for `Element.insertAdjacentHTML`. r=tschuster,smaug,peterv 2024-09-02 13:58:25 +00:00
localstorage Bug 1866217 - Add support for persistence type sets to PersistenceScope; r=dom-storage-reviewers,jari 2024-08-14 20:17:31 +00:00
locks Bug 1908002 - Allow LockManager to be constructed in the parent process with the system principal and loaded in modules. r=saschanaz,smaug 2024-07-30 14:51:26 +00:00
manifest
mathml
media Bug 1913568 - Handle SurfaceTexture transforms in webrender, for reals this time. r=gfx-reviewers,media-playback-reviewers,padenot,nical 2024-09-09 14:06:26 +00:00
messagechannel
midi Bug 1754005 - Temporary allow for site permissions. r=permissions-reviewers,nchevobbe,timhuang 2024-08-26 10:05:34 +00:00
navigation Bug 1895254 - Prototype the Navigation API WebIDL. r=farre,dom-core,peterv 2024-07-24 04:56:35 +00:00
network Bug 1913624 - Remove expired telemetry histogram NETWORK_CONNECTION_COUNT, r=TravisLong. 2024-08-23 16:27:17 +00:00
notification Bug 1908664 - Add nsIPrincipal::GetIsInPrivateBrowsing r=media-playback-reviewers,anti-tracking-reviewers,dom-storage-reviewers,padenot,asuth,pbz 2024-07-26 17:47:51 +00:00
origin-trials Bug 1909729 - Disable PPA submission and trial on Android by default. r=bgrins 2024-07-25 12:25:59 +00:00
payments
performance Bug 1911448 - Remove DOMContentFlushed. r=smaug,perftest-reviewers,sparky 2024-08-05 12:20:43 +00:00
permission Bug 1609427 - Don't report Always Ask as "granted" if the privacy.resistFingerprinting pref is set. r=pbz 2024-08-06 13:53:22 +00:00
plugins/test
power
privateattribution Bug 1914141 - Added an ending-in-number check for non-ipv4 domains for Services.io.isValidHostname. r=necko-reviewers,valentin 2024-09-05 21:07:34 +00:00
promise Bug 1900930 - Make nsProfiler use TypedArrayCreator. r=dom-core,profiler-reviewers,farre,canaltinova 2024-08-21 08:43:09 +00:00
prototype Bug 1910698 - Add a struct to represent JS caller location and more general warning source location. r=smaug,necko-reviewers,anti-tracking-reviewers,dom-storage-reviewers,pbz,kershaw,janv 2024-08-01 17:12:48 +00:00
push Bug 1910698 - Add a struct to represent JS caller location and more general warning source location. r=smaug,necko-reviewers,anti-tracking-reviewers,dom-storage-reviewers,pbz,kershaw,janv 2024-08-01 17:12:48 +00:00
quota Bug 1915228 - Remove expired telemetry scalars navigator.storage.estimate_count and navigator.storage.persist_count, r=chutten. 2024-08-28 19:44:31 +00:00
reporting Bug 1910698 - Add a struct to represent JS caller location and more general warning source location. r=smaug,necko-reviewers,anti-tracking-reviewers,dom-storage-reviewers,pbz,kershaw,janv 2024-08-01 17:12:48 +00:00
res
script Bug 1877792 - Part 17: Extend CompileFetchedModule to handle JSON modules r=spidermonkey-reviewers,dom-core,jonco,mccr8 2024-09-03 08:10:54 +00:00
security Bug 1773976 - Treat SVG <use> and CSS filter as img-src in CSP. r=freddyb 2024-09-09 12:16:12 +00:00
serializers Bug 1900426 - Implement DnD for shadow-crossing selection r=jjaschke,smaug,dom-core 2024-09-03 15:42:58 +00:00
serviceworkers Bug 1915228 - Remove expired telemetry scalars serviceworker.registrations and serviceworker.running_max, r=chutten,jesup. 2024-08-28 19:44:31 +00:00
simpledb Bug 1900930 - Make ENSURE_SUCCESS call WouldReportJSException. r=dom-core,win-reviewers,emilio,gstoll,edgar 2024-08-21 08:43:09 +00:00
smil Bug 1914513 - Add a pref to disable mutation events, r=masayuki 2024-09-02 13:29:57 +00:00
storage Bug 1913624 - Remove expired telemetry histograms LOCALDOMSTORAGE_*_BLOCKING_MS, r=chutten. 2024-08-20 10:26:52 +00:00
streams
svg Bug 1917192 - Make SVG text position react to CSS zoom r=emilio 2024-09-06 11:53:14 +00:00
system Bug 1900225: Part 2 - Inform user of system UX issues initiated by geolocation request r=gstoll,emilio,bolsson,pbz 2024-08-27 22:47:32 +00:00
tests Bug 1914513 - Add a pref to disable mutation events, r=masayuki 2024-09-02 13:29:57 +00:00
url
view-transitions Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug 2024-09-04 20:24:55 +00:00
vr Bug 1909018 - Migrate gfx/vr off PlainOldDataSerializer. r=mccr8,nika 2024-07-24 21:44:28 +00:00
webauthn Bug 1909441 - webauthn on macOS: use user.displayName rather than user.name, as intended r=jschanck 2024-08-02 20:55:51 +00:00
webbrowserpersist
webgpu Bug 1917513 - Add a way to expose if webgpu::Adapter and webgpu::Device support ExternalTexture usage in SwapChain r=webgpu-reviewers,nical 2024-09-09 12:56:07 +00:00
webidl Backed out 4 changesets (bug 1917059, bug 1873039) for causing conflicts when trying to backout Bug 1917102. 2024-09-09 11:18:31 +03:00
webscheduling
webshare
websocket Bug 1914620 - Enable remaining ESLint rules for dom/websocket. r=necko-reviewers,frontend-codestyle-reviewers,jesup 2024-08-28 11:23:08 +00:00
webtransport
workers Bug 1917215 - small typo in tests r=padenot 2024-09-09 06:56:31 +00:00
worklet Bug 1877792 - Part 17: Extend CompileFetchedModule to handle JSON modules r=spidermonkey-reviewers,dom-core,jonco,mccr8 2024-09-03 08:10:54 +00:00
xhr Bug 1909467: replace some includes of "nsIContentSecurityPolicy" with forward declarations or other includes and move some function definitions to the corresponding .cpp files. r=tschuster,necko-reviewers,kershaw 2024-08-15 12:37:35 +00:00
xml
xslt Bug 1912129: Reduce time precision for EXSLT date time function. r=timhuang 2024-08-08 19:35:00 +00:00
xul Bug 1913962 - Remove rather noisy warning. r=mccr8 2024-08-20 22:38:36 +00:00
jar.mn
metrics.yaml Bug 1914964 - Remove unused or high volume Early Hints probes r=acreskey 2024-08-28 19:43:52 +00:00
moz.build Bug 1914319 - View Transition API stubs. r=boris,webidl,saschanaz 2024-08-22 17:48:16 +00:00
pings.yaml