mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
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
2e495f6789
On Android we use SurfaceTextures to render content from sources such as the video decoder. These may have a transform set which is supposed to be applied to the texture coordinates used to sample the texture. Webrender (and software webrender), however, do not handle this correctly, meaning videos may be rendered at the incorrect size on some devices. SurfaceTextures should always be rendered with their bottom-left being their origin, eg vertically flipped. Additionally, the texture transform returned on most devices seems to be a simple y-flip transform with no scaling. Webrender currently just ignores the y-flip due to the texture origin, which cancels out us not handling the y-flip from the transform, meaning video looks correct on most devices. Some devices, however, do return a scaling transform which we must handle. This patch removes the override of WebRenderTextureHost::NeedsYFlip() that was causing us to ignore the y-flip due to the texture origin - since we will now apply the transform we must handle this correctly too. It adds a virtual method RenderTextureHost::GetUvCoords(), that returns the texture coordinates that should be used by webrender to sample from external textures. In most cases these are simply (0, 0) and (size.x, size.y), but in RenderAndroidSurfaceTextureHost we override this function to apply the transformation. This ensures we use the correct coordinates whenever the texture is rendered by webrender, eg in both software and hardware webrender when rendering in the non-compositing-path, and by hardware webrender's draw compositor. Additionally, the composite.glsl shader requires a fix to calculate the UV bounds correctly, as the coordinates may now be inverted. Lastly, we fix software webrender with the OpenGL compositor. CompositorOGL already has the required functionality to apply the texture transformation as it was used back in the layers days. We must simply ensure that we pass the value of the mIgnoreTransform flag from the original SurfaceTextureHost, through to the RenderAndroidSurfaceTextureHost, and finally to the SurfaceTextureSource which we hand to CompositorOGL. Differential Revision: https://phabricator.services.mozilla.com/D144306 |
||
---|---|---|
.cargo | ||
.vscode | ||
accessible | ||
browser | ||
build | ||
caps | ||
chrome | ||
config | ||
devtools | ||
docs | ||
docshell | ||
dom | ||
editor | ||
extensions | ||
gfx | ||
gradle/wrapper | ||
hal | ||
image | ||
intl | ||
ipc | ||
js | ||
layout | ||
media | ||
memory | ||
mfbt | ||
mobile | ||
modules | ||
mozglue | ||
netwerk | ||
nsprpub | ||
other-licenses | ||
parser | ||
python | ||
remote | ||
security | ||
services | ||
servo | ||
startupcache | ||
storage | ||
taskcluster | ||
testing | ||
third_party | ||
toolkit | ||
tools | ||
uriloader | ||
view | ||
widget | ||
xpcom | ||
xpfe/appshell | ||
.arcconfig | ||
.babel-eslint.rc.js | ||
.clang-format | ||
.clang-format-ignore | ||
.cron.yml | ||
.eslintignore | ||
.eslintrc.js | ||
.flake8 | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.hg-annotate-ignore-revs | ||
.hg-format-source | ||
.hgignore | ||
.hgtags | ||
.lando.ini | ||
.lldbinit | ||
.mailmap | ||
.prettierignore | ||
.prettierrc | ||
.taskcluster.yml | ||
.trackerignore | ||
.yamllint | ||
.ycm_extra_conf.py | ||
aclocal.m4 | ||
AUTHORS | ||
build.gradle | ||
Cargo.lock | ||
Cargo.toml | ||
client.mk | ||
client.py | ||
CLOBBER | ||
configure.in | ||
configure.py | ||
GNUmakefile | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
LICENSE | ||
mach | ||
mach.cmd | ||
mach.ps1 | ||
Makefile.in | ||
moz.build | ||
moz.configure | ||
mozilla-config.h.in | ||
old-configure.in | ||
package-lock.json | ||
package.json | ||
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.