Граф коммитов

22 Коммитов

Автор SHA1 Сообщение Дата
Jamie Nicol 2e495f6789 Bug 1731980 - Ensure SurfaceTextures with transforms get rendered at correct size. r=gfx-reviewers,lsalzman
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
2022-04-25 16:47:51 +00:00
Matt Woodrow 979882e86f Bug 1673983 - Add RenderTextureHostSWGL support to D3D11 RenderTextureHosts. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D95799
2020-11-06 00:01:36 +00:00
Narcis Beleuzu 37bd723824 Backed out 4 changesets (bug 1673983) for linting failure on moz.build CLOSED TREE
Backed out changeset f408fc890ba1 (bug 1673983)
Backed out changeset 49ae9de85ab9 (bug 1673983)
Backed out changeset 91d8f0f829fd (bug 1673983)
Backed out changeset 91cb8ee8ddd8 (bug 1673983)
2020-11-06 00:10:34 +02:00
Matt Woodrow 489a752d51 Bug 1673983 - Add RenderTextureHostSWGL support to D3D11 RenderTextureHosts. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D95799
2020-11-05 20:18:13 +00:00
smolnar 625b8a74be Backed out 4 changesets (bug 1673983) for causing build bustages in RenderCompositorD3D11SWGL. CLOSED TREE
Backed out changeset 134e621d0902 (bug 1673983)
Backed out changeset 81601a02d9b7 (bug 1673983)
Backed out changeset 72d4bf5b093e (bug 1673983)
Backed out changeset 99b2e5c55a25 (bug 1673983)
2020-11-05 11:40:36 +02:00
Matt Woodrow b8c9f1b675 Bug 1673983 - Add RenderTextureHostSWGL support to D3D11 RenderTextureHosts. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D95799
2020-11-05 09:15:05 +00:00
Lee Salzman 8326780f95 Bug 1652894 - add SWGL RenderTextureHosts. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D86340
2020-08-12 21:25:17 +00:00
Mihai Alexandru Michis f44ab317a5 Backed out 4 changesets (bug 1652894) for causing multiple reftest failures.
CLOSED TREE

Backed out changeset d6786fcf717b (bug 1652894)
Backed out changeset 97df16d3b738 (bug 1652894)
Backed out changeset 8a1f8b9e2524 (bug 1652894)
Backed out changeset 96bca5729430 (bug 1652894)
2020-08-12 02:08:28 +03:00
Lee Salzman 75d072859c Bug 1652894 - add SWGL RenderTextureHosts. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D86340
2020-08-11 15:53:15 +00:00
Csoregi Natalia cc057fb442 Backed out 4 changesets (bug 1652894) for texture related crashes. CLOSED TREE
Backed out changeset 714ad1b01cb2 (bug 1652894)
Backed out changeset e3b4753fd09c (bug 1652894)
Backed out changeset 8abaf47071d8 (bug 1652894)
Backed out changeset 175df7659c3f (bug 1652894)
2020-08-11 15:50:07 +03:00
Lee Salzman 6b4a081f33 Bug 1652894 - add SWGL RenderTextureHosts. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D86340
2020-08-11 07:38:10 +00:00
Csoregi Natalia 555c643104 Backed out 4 changesets (bug 1652894) for bustages on RenderThread.cpp. CLOSED TREE
Backed out changeset 0e0107226c9e (bug 1652894)
Backed out changeset ff5e4bffb497 (bug 1652894)
Backed out changeset 2e4c7cced692 (bug 1652894)
Backed out changeset a8b850455c90 (bug 1652894)
2020-08-11 08:52:47 +03:00
Lee Salzman 385e5cc6c6 Bug 1652894 - add SWGL RenderTextureHosts. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D86340
2020-08-11 05:24:04 +00:00
Botond Ballo 0db5983e81 Bug 1627482 - Fix non-unified build errors in gfx/webrender_bindings. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D69736

--HG--
extra : moz-landing-system : lando
2020-04-05 03:49:51 +00:00
sotaro 817c9ec8c9 Bug 1529870 - Add handling of single buffer mode android SurfaceTexture r=nical
When SurfaceTexture is single buffer mode, UpdateTexImage() should be called only once for each publish. If UpdateTexImage() is called more than once, it causes hand on puglish side.

Differential Revision: https://phabricator.services.mozilla.com/D24483

--HG--
extra : moz-landing-system : lando
2019-04-03 22:05:27 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Henrik Winnemöller b45616020b Bug 1452979 - Use ImageRendering property to provide proper filtering on NativeTexture external images. r=nical
Introduce an ImageRendering argument to the lock call to external images. In case of NativeTexture external images, this ImageRendering argument is used to set the GL_TEXTURE_MIN/MAG_FILTER on texture creation. The filtering is also updated when a lock call is used on an existing texture with a different ImageRendering argument. The WR bindings and auto generated files have been updated.
2018-09-03 21:43:31 +02:00
Daniel Holbert 126bd9e1a4 Bug 1412427 part 8: (automated patch) Switch a bunch of C++ files in gfx to use our standard mode lines. r=jrmuizel
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: 77D61xpSmIl

--HG--
extra : rebase_source : c6162fa3cf539a07177a19838324bf368faa162b
2017-10-27 16:10:06 -07:00
JerryShih e76df89dc3 Bug 1366502 - Make sure the RenderTextureHost is released in render thread. r=sotaro.
The RenderTextureHost might calls some thread-specific functions(e.g. OpenGL calls) in ~RenderTextureHost(). Add a checking here to prevent this problem.

MozReview-Commit-ID: 62QlavmXOig
2017-06-07 23:44:05 +08:00
JerryShih b0ffca2f70 Bug 1347062 - P4: create RenderBufferTextureHost and RenderMacIOSurfaceTextureHostOGL. r=nical,sotaro
1) make RenderTextureHost into a abstract base class for all RenderXXXTextureHost.
2) create a base class RenderTextureHostOGL for all texture handle base texture.
3) create RenderBufferTextureHost for buffer texture at render thread.
4) create RenderMacIOSurfaceTextureHostOGL for MacIOSurface at render thread.

--HG--
rename : gfx/webrender_bindings/RenderBufferTextureHost.h => gfx/webrender_bindings/RenderTextureHost.h
2017-03-31 22:29:14 +08:00
JerryShih f8987906e1 Bug 1347062 - P3: rename from RenderTextureHost to RenderBufferTextureHost for further updating. r=sotaro
We will have a class RenderTextureHost as the base-class and its sub-class RenderBufferTextureHost in next patch. Use "rename" to preserve the file history.

MozReview-Commit-ID: KiqaO616AHc

--HG--
rename : gfx/webrender_bindings/RenderTextureHost.cpp => gfx/webrender_bindings/RenderBufferTextureHost.cpp
rename : gfx/webrender_bindings/RenderTextureHost.h => gfx/webrender_bindings/RenderBufferTextureHost.h
2017-03-31 22:29:14 +08:00
sotaro 1d710a54ef Bug 1343764 - Add ExternalBuffer handling r=nical 2017-03-07 19:37:28 +09:00