Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Go to file
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
.cargo Backed out 4 changesets (bug 1917102) for causing crashes (bug 1917444). CLOSED TREE 2024-09-09 11:19:37 +03:00
.github/workflows
.vscode
accessible Bug 1696309 - Don't skip aria-owned children early in TreeWalker. r=Jamie 2024-09-08 04:04:17 +00:00
browser Bug 1914604: Update result by default engine if exiting the search mode r=daleharvey 2024-09-09 13:54:10 +00:00
build Bug 1901892 - Update builders to rustc 1.81. r=firefox-build-system-reviewers,ahochheiden 2024-09-06 22:26:49 +00:00
caps Bug 1914286 - Remove NS_RelaxStrictFileOriginPolicy. r=smaug,necko-reviewers,kershaw 2024-08-23 10:13:35 +00:00
chrome
config Bug 1910796 - Integrate libz-rs-sys as a replacement for zlib. r=supply-chain-reviewers,firefox-build-system-reviewers,nika,sergesanspaille 2024-09-02 22:49:59 +00:00
devtools Backed out 2 changesets (bug 1907304) for causing failures in browser_net_offline_mode.js CLOSED TREE 2024-09-09 17:22:40 +03:00
docs Backed out 2 changesets (bug 1888472) for causing failures in LateWriteChecks.cpp CLOSED TREE 2024-09-06 21:02:17 +03:00
docshell Bug 1911977 - Minor clean-ups in nsDocShell::InternalLoad. r=smaug 2024-09-05 17:08:39 +00:00
dom 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
editor Bug 1916081 - Make HTMLEditor::FocusedElementOrDocumentBecomesNotEditable stop using aHTMLEditor at adjusting IME state r=m_kato 2024-09-05 00:52:58 +00:00
extensions Bug 1900930 - Make ENSURE_SUCCESS call WouldReportJSException. r=dom-core,win-reviewers,emilio,gstoll,edgar 2024-08-21 08:43:09 +00:00
gfx 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
gradle/wrapper Bug 1917581 - Update Gradle to version 8.10.1. r=android-reviewers,mcarare 2024-09-09 12:55:49 +00:00
hal
image Bug 1846055. Fix color management of grayscale avif files. r=gfx-reviewers,lsalzman 2024-09-09 09:39:12 +00:00
intl Bug 1917163 - Update rstcheck to 6.2.4, fix resulting errors in documents, r=Standard8 2024-09-06 15:04:10 +00:00
ipc Bug 1914594 - Move docshell.newWindowTarget to be on LoadInfo, r=necko-reviewers,kershaw 2024-09-03 16:00:23 +00:00
js Bug 1917214 - Skip tests for redeclarable eval vars proposal in beta and release build. r=dminor 2024-09-09 13:29:36 +00:00
layout Bug 1915051 - Early-exit UpdateResolutionForViewportSizeChange in fullscreen mode. r=hiro 2024-09-08 21:37:19 +00:00
media Bug 1912557. Enable assembly for arm 32 bit for dav1d. r=media-playback-reviewers,aosmond 2024-09-05 03:56:41 +00:00
memory
mfbt Bug 1916311 - [css-view-transitions] Initial pass at DOM API internals. r=boris,webidl,smaug 2024-09-04 20:24:55 +00:00
mobile Bug 1912988 - part 3 - Round values for vertical clipping instead of always flooring r=android-reviewers,mavduevskiy 2024-09-09 13:50:55 +00:00
modules Bug 1917341: nsJar cleanup of ADDREFs/RELEASEs r=necko-reviewers,valentin 2024-09-09 12:44:10 +00:00
mozglue Bug 1914862 - Add a TELEMETRY profiler cateogry, r=canaltinova,profiler-reviewers,aabh. 2024-09-06 19:03:44 +00:00
netwerk Backed out 2 changesets (bug 1907304) for causing failures in browser_net_offline_mode.js CLOSED TREE 2024-09-09 17:22:40 +03:00
nsprpub
other-licenses
parser Bug 1913382 - count the rate of SVG elements with surprising children r=hsivonen 2024-09-04 11:23:43 +00:00
python Bug 1911098 - Use product name for desktop file template. r=releng-reviewers,jcristau 2024-09-09 07:39:09 +00:00
remote Bug 1917524 - [cdp] Disable network.cookies.useServerTime for CDP r=webdriver-reviewers,whimboo 2024-09-09 13:51:51 +00:00
security No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes ct-logs - r=release-managers,RyanVM 2024-09-05 11:56:25 +00:00
services Backed out 2 changesets (bug 1888472) for causing failures in LateWriteChecks.cpp CLOSED TREE 2024-09-06 21:02:17 +03:00
servo Bug 1914735 - Track color-scheme dependencies for non-inherited rule cache. r=firefox-style-system-reviewers,boris 2024-09-04 20:35:55 +00:00
startupcache
storage Bug 1914723 - Remove no longer necessary proxy release for Storage variants. r=asuth 2024-09-02 16:57:55 +00:00
supply-chain Backed out 4 changesets (bug 1917102) for causing crashes (bug 1917444). CLOSED TREE 2024-09-09 11:19:37 +03:00
taskcluster Bug 1916592 - [puppeteer] Deprioritize tests with deprecated CDP protocol to Tier 2. r=webdriver-reviewers,jgraham 2024-09-09 10:00:50 +00:00
testing Bug 1917556 - [marionette] Fix Mn tests with Python 3.12 r=webdriver-reviewers,whimboo 2024-09-09 12:26:43 +00:00
third_party Backed out 4 changesets (bug 1917102) for causing crashes (bug 1917444). CLOSED TREE 2024-09-09 11:19:37 +03:00
toolkit Bug 1916411: Call InitializeMacApp before showing the profile locked dialog. r=spohl 2024-09-09 13:54:36 +00:00
tools Bug 1275612 - Don't allow any origins to send objects over WebChannel. r=Gijs 2024-09-08 15:28:50 +00:00
uriloader Bug 1911977 - Minor clean-ups in nsDocShell::InternalLoad. r=smaug 2024-09-05 17:08:39 +00:00
view
widget Bug 1915596 [Wayland] Get touchpad hold event directly from Wayland display r=emilio 2024-09-06 09:16:28 +00:00
xpcom Bug 1917163 - Update rstcheck to 6.2.4, fix resulting errors in documents, r=Standard8 2024-09-06 15:04:10 +00:00
xpfe/appshell Bug 1914578 - Remove EventTracer r=perftest-reviewers,geckoview-reviewers,win-reviewers,profiler-reviewers,mstange,sparky,gstoll,owlish 2024-08-31 03:39:50 +00:00
.arcconfig
.babel-eslint.rc.js
.clang-format
.clang-format-ignore
.cron.yml
.eslintrc-ignores.js
.eslintrc-rollouts.js Bug 1916616 - Clean up ESLint rollout exclusions for the no-insecure-url rule. r=frontend-codestyle-reviewers,Gijs 2024-09-04 13:03:26 +00:00
.eslintrc-test-paths.js
.eslintrc.js
.git-blame-ignore-revs
.gitattributes
.gitignore
.hg-annotate-ignore-revs
.hgignore
.hgtags No bug - tagging 2764529cc7a6f24781273f93d7af9805e1f45876 with FIREFOX_NIGHTLY_131_END a=release DONTBUILD CLOSED TREE 2024-09-02 13:36:29 +00:00
.lando.ini
.lldbinit
.mailmap
.prettierignore Bug 1913967 - Move shared modules to a shared folder. r=sylvestre,frontend-codestyle-reviewers,dimi 2024-08-21 14:12:52 +00:00
.prettierrc.js
.rstcheck.cfg Bug 1917163 - Update rstcheck to 6.2.4, fix resulting errors in documents, r=Standard8 2024-09-06 15:04:10 +00:00
.stylelintignore
.stylelintrc.js Bug 1913322 - Make arrowscrollbox use resizeobserver rather than overflow/underflow events. r=Gijs,dao,desktop-theme-reviewers,tabbrowser-reviewers,frontend-codestyle-reviewers 2024-08-21 12:23:34 +00:00
.taskcluster.yml
.trackerignore
.yamllint
.ycm_extra_conf.py
aclocal.m4
AUTHORS
build.gradle Bug 1917498 - Migrate the remaining AndroidX libraries to the AC dependencies plugin and clean up the manifests. r=android-reviewers,mcarare 2024-09-09 11:30:09 +00:00
Cargo.lock Backed out 4 changesets (bug 1917102) for causing crashes (bug 1917444). CLOSED TREE 2024-09-09 11:19:37 +03:00
Cargo.toml Backed out 2 changesets (bug 1888472) for causing failures in LateWriteChecks.cpp CLOSED TREE 2024-09-06 21:02:17 +03:00
client.mk
client.py
CLOBBER Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2024-09-02 13:36:39 +00:00
configure
configure.py Bug 1916786 - Modernize python/mozbuild/mozbuild to use exist_ok=True parameter from os.makedirs r=ahochheiden 2024-09-05 05:52:56 +00:00
GNUmakefile
gradle.properties
gradlew Bug 1900345 - Update Gradle to version 8.10. r=android-reviewers,ohall 2024-09-05 14:56:03 +00:00
gradlew.bat Bug 1900345 - Update Gradle to version 8.10. r=android-reviewers,ohall 2024-09-05 14:56:03 +00:00
LICENSE
mach
mach.cmd
mach.ps1
Makefile.in
mots.yaml Bug 1915387 - Add hjones as Desktop Theme peer. r=zeid 2024-08-28 12:56:51 +00:00
moz.build
moz.configure Bug 1910796 - Integrate libz-rs-sys as a replacement for zlib. r=supply-chain-reviewers,firefox-build-system-reviewers,nika,sergesanspaille 2024-09-02 22:49:59 +00:00
mozilla-config.h.in
old-configure.in Bug 1907180 - Remove obsolete AC_CANONICAL_SYSTEM from old-configure r=glandium 2024-08-29 07:42:33 +00:00
package-lock.json Bug 1870226 - Upgrade eslint-plugin-jsdoc to version 50.2.2. r=zombie,frontend-codestyle-reviewers,translations-reviewers,backup-reviewers,kpatenio 2024-08-23 16:43:57 +00:00
package.json Bug 1870226 - Upgrade eslint-plugin-jsdoc to version 50.2.2. r=zombie,frontend-codestyle-reviewers,translations-reviewers,backup-reviewers,kpatenio 2024-08-23 16:43:57 +00:00
pyproject.toml
README.txt
settings.gradle
substitute-local-geckoview.gradle
test.mozbuild

An explanation of the Firefox Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://firefox-source-docs.mozilla.org/contributing/directory_structure.html

For information on how to build Firefox from the source code and create the patch see:

    https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

If you have a question about developing Firefox, and can't find the solution
on https://firefox-source-docs.mozilla.org/, you can try asking your question on Matrix at chat.mozilla.org in `Introduction` (https://chat.mozilla.org/#/room/#introduction:mozilla.org) channel.


Nightly development builds can be downloaded from:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://www.mozilla.org/firefox/channel/desktop/#nightly

Keep in mind that nightly builds, which are used by Firefox developers for
testing, may be buggy.