Commit Graph

99 Commits

Author SHA1 Message Date
Lee Salzman
37b46af14d Bug 1757067 - Explicitly specify chroma subsampling scheme for YCbCr data. r=jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139656
2022-03-10 09:24:15 +00:00
smolnar
aa6117776f Backed out changeset 36c6350bc7d1 (bug 1757067) for causing build bustages in gfx/gl/GLBlitHelperD3D.cpp CLOSED TREE 2022-03-10 10:10:10 +02:00
Lee Salzman
5f3ba19f78 Bug 1757067 - Explicitly specify chroma subsampling scheme for YCbCr data. r=jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139656
2022-03-10 07:48:53 +00:00
Lee Salzman
1b6e9ef767 Bug 1750858 - Respect mPicSize in WebRender. r=sotaro
This makes WR properly handle mPicSize when RenderBufferTextureHost is used.
The main change is that we need to take care to pass in display().Size() from
the descriptor, and then further use that to carefully limit the size of the
CbCr texture, as it doesn't necessarily maintain an appropriate half-sized
scale with respect to the Y texture if it is padded.

Given that mPicSize should now actually work, we should no longer need any
of the previous mCroppedSize mechanisms that were added to work around this,
and so they are removed in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D139267
2022-02-22 17:56:30 +00:00
sotaro
2c6d59afb0 Bug 1753575 - Make BufferTextureData of ffmpeg decoded video recycled again r=gfx-reviewers,nical
Before Bug 1713276  fix, BufferTextureData of ffmpeg decoded video was recycled.
ShmemTextureData::CropYCbCrPlanes() changed BufferDescriptor. And it blocks the BufferTextureData to be recycled. The BufferDescriptor needs to be restored to original value before recycling.

Differential Revision: https://phabricator.services.mozilla.com/D137829
2022-02-07 23:15:25 +00:00
alwu
73005a6bcb Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-25 02:44:59 +00:00
Butkovits Atila
76a312eddf Backed out 5 changesets (bug 1713276) for causing reftest failures at color_quads/720p.png.bt709.bt709.pc.yuv420p10.vp9.webm. CLOSED TREE
Backed out changeset 9ac49fde0e53 (bug 1713276)
Backed out changeset 21a1cb173d50 (bug 1713276)
Backed out changeset d8e319535a01 (bug 1713276)
Backed out changeset 0a1be4875045 (bug 1713276)
Backed out changeset b2676297c6ff (bug 1713276)
2022-01-22 23:14:05 +02:00
alwu
c0c41cc61e Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-22 17:25:22 +00:00
Cristian Tuns
c178ff5013 Backed out 4 changesets (bug 1713276) on suspicion of causing wpt failure in canvas + video test CLOSED TREE
Backed out changeset f4ca14151598 (bug 1713276)
Backed out changeset 52fdcd1dc5ed (bug 1713276)
Backed out changeset 5503198fc6b2 (bug 1713276)
Backed out changeset 002c71e3c3f7 (bug 1713276)
2022-01-21 04:26:22 -05:00
alwu
f0da420157 Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-20 23:53:10 +00:00
Norisz Fay
0c059a17e8 Backed out 4 changesets (bug 1713276) for causing build bustage and wpt failures CLOSED TREE
Backed out changeset cee073e045a3 (bug 1713276)
Backed out changeset 9a47b267032e (bug 1713276)
Backed out changeset 3d88e393a0cb (bug 1713276)
Backed out changeset f8814abefa20 (bug 1713276)
2022-01-20 11:39:56 +02:00
alwu
6e9e28ebe4 Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-20 05:50:54 +00:00
Narcis Beleuzu
4f154a6e3b Backed out 4 changesets (bug 1713276) for bustages on FFmpegVideoDecoder.cpp . CLOSED TREE
Backed out changeset 12a9f3fad481 (bug 1713276)
Backed out changeset cdc8216b3f18 (bug 1713276)
Backed out changeset b23498172031 (bug 1713276)
Backed out changeset 13ce7037ff27 (bug 1713276)
2022-01-20 07:26:12 +02:00
alwu
bf37a911cf Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-20 04:11:48 +00:00
Kelsey Gilbert
4d978ff74d Bug 1746111 - (Re)serialize WebRTC frame SurfaceDescriptorBuffers for convert-and-upload on WebGLParent. r=gfx-reviewers,nika,lsalzman
Also generally de-inline (WebGLParent::TexImage not DispatchCommand)
TexImage(SurfaceDescriptor).

Differential Revision: https://phabricator.services.mozilla.com/D132851
2021-12-15 01:54:21 +00:00
sotaro
b1085e745d Bug 1743930 - Remove unused TextureAllocationFlags flag handling r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D132648
2021-12-02 07:08:43 +00:00
Alexandru Michis
f93636af80 Backed out changeset d889e102b481 (bug 1743930) for causing mda failures in DeviceManagerDx.cpp 2021-12-02 05:42:06 +02:00
sotaro
d9e71e44f8 Bug 1743930 - Remove unused TextureAllocationFlags flag handling r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D132648
2021-12-02 02:42:00 +00:00
sotaro
a42329ba14 Bug 1742739 - Remove HasIntermediateBuffer r=gfx-reviewers,jnicol
HasIntermediateBuffer is always false. It could be removed.

Differential Revision: https://phabricator.services.mozilla.com/D131996
2021-11-28 11:40:16 +00:00
Nika Layzell
6aff4075e1 Bug 1734735 - Part 6: Remove dead TextureSync code, r=dthayer
Differential Revision: https://phabricator.services.mozilla.com/D128215
2021-11-23 16:15:22 +00:00
sotaro
c34d68e605 Bug 1741111 - Remove LayersBackend::LAYERS_BASIC r=gfx-reviewers,bradwerth
LayersBackend::LAYERS_BASIC is not used any more.

Differential Revision: https://phabricator.services.mozilla.com/D131104
2021-11-17 22:05:47 +00:00
Andrew Osmond
2569649469 Bug 1724936 - Remove XRender support. r=jrmuizel
This has been deprecated for a long time, and it doesn't work in
conjuction with WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D122368
2021-08-25 19:35:23 +00:00
Butkovits Atila
0745451aff Backed out changeset f767bc7e5cd8 (bug 1724936) for causing build bustages on nsLookAndFeel.cpp. CLOSED TREE 2021-08-25 21:21:59 +03:00
Andrew Osmond
d428f646cc Bug 1724936 - Remove XRender support. r=jrmuizel
This has been deprecated for a long time, and it doesn't work in
conjuction with WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D122368
2021-08-25 17:45:04 +00:00
Andi-Bogdan Postelnicu
e89c7568d8 Bug 1694161 - some fixes for the MacOS non unified environment. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D106616
2021-02-27 08:05:46 +00:00
smolnar
973811895c Backed out 2 changesets (bug 1694161) as requested by dev. DONTBUILD CLOSED TREE
Backed out changeset 0fb8a1114e84 (bug 1694161)
Backed out changeset 453ce7dffdcc (bug 1694161)
2021-02-26 18:52:04 +02:00
Andi-Bogdan Postelnicu
a8e208c764 Bug 1694161 - some fixes for the MacOS non unified environment. r=sg
Depends on D105977

Differential Revision: https://phabricator.services.mozilla.com/D106616
2021-02-26 16:39:18 +00:00
Simon Giesecke
46908cfb51 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Lee Salzman
77670103bd Bug 1677236 - don't require padding for SWGL FBO textures. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D97061
2020-11-16 16:43:23 +00:00
Jean-Yves Avenard
daa87f8e36 Bug 1595994 - P1D. Properly serialize display size when sending image over IPC. r=mattwoodrow
The code always assumed that the size of the image with the Y plane dimensions, which, while often the case, isn't correct.
We remove the assertions that the display offset was always (0,0) and properly carry the actual data over IPC.

Remoting the theora decoder and enabling fast video copy exposed several other related issues in the various D3D11 image types.
Various WPT uses theora YUV44 images (because we do not support YUV444 H264 ones). Those images are made of 32 pixels planes with a display size set to 20 pixels. Prior P1D the backend image was a ShareYCbCrPlanar image which correctly handled the size settings.

Like the image serializer, the various D3D11 images always assumed that the Y plane size was the image size.

This however expose existing issues where the offset position of the display is completely ignored for some image type. See bug 1669054

All those problems explain why sometimes we displayed more pixels than we should have.

Depends on D91914

Differential Revision: https://phabricator.services.mozilla.com/D92233
2020-10-20 23:30:04 +00:00
Lee Salzman
b754aa0add 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
49b0cb84ec 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
dca51388e1 Bug 1652894 - add SWGL RenderTextureHosts. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D86340
2020-08-11 15:53:15 +00:00
sotaro
5247b1e486 Bug 1639874 - Fix YCbCrTextureClientAllocationHelper::IsCompatible() r=jrmuizel
IsCompatible() also needs to check YStride and CbCrStride. They also affect to buffer size.

Differential Revision: https://phabricator.services.mozilla.com/D76323
2020-05-21 18:53:42 +00:00
Emilio Cobos Álvarez
778b011866 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

Differential Revision: https://phabricator.services.mozilla.com/D60327
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez
2efdea1ee5 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

Differential Revision: https://phabricator.services.mozilla.com/D60323
2020-01-20 16:18:20 +00:00
David Parks
e44d28bcef Bug 1600595: Part 2 - Change BufferTexture to allow any IShmemAllocator owner r=mattwoodrow
The only reason BufferTexture needs a LayersIPCChannel instead of the IShmemAllocator base interface is that it needs to know if the allocator is cross-process or not.  Both LayersIPCChannel and ISurfaceAllocator use IsSameProcess() for this but without a common interface for it.  Rather than further complicate the inheritance diagram for the layers and IPDL core classes, this patch makes BufferTexture handle both with generic code.

Differential Revision: https://phabricator.services.mozilla.com/D56225
2020-01-04 19:35:38 +00:00
Mihai Alexandru Michis
92210843cc Backed out 5 changesets (bug 1600595) for causing webgl tests and reftests to time out.
CLOSED TREE

Backed out changeset 2f3a6a8e47bc (bug 1600595)
Backed out changeset c6712886b650 (bug 1600595)
Backed out changeset e905d5af4919 (bug 1600595)
Backed out changeset c497070467dd (bug 1600595)
Backed out changeset 27fd9a1b31f0 (bug 1600595)
2019-12-24 09:37:02 +02:00
David Parks
45ace2c440 Bug 1600595: Part 2 - Change BufferTexture to allow any IShmemAllocator owner r=mattwoodrow
The only reason BufferTexture needs a LayersIPCChannel instead of the IShmemAllocator base interface is that it needs to know if the allocator is cross-process or not.  Both LayersIPCChannel and ISurfaceAllocator use IsSameProcess() for this but without a common interface for it.  Rather than further complicate the inheritance diagram for the layers and IPDL core classes, this patch makes BufferTexture handle both with generic code.

Differential Revision: https://phabricator.services.mozilla.com/D56225
2019-12-23 21:26:16 +00:00
Jean-Yves Avenard
325a79ad0a Bug 1543359 - P6. Add backend for color range information. r=mattwoodrow.
Add code for YCbCr buffer and IOSurface backend.

Differential Revision: https://phabricator.services.mozilla.com/D27213
2019-07-26 08:45:31 +00:00
Narcis Beleuzu
5e823403ff Backed out 15 changesets (bug 1543359) for wrench bustages on image.rs . CLOSED TREE
Backed out changeset 548006270186 (bug 1543359)
Backed out changeset c9585e9d9f3c (bug 1543359)
Backed out changeset 1c7ca95a2a9b (bug 1543359)
Backed out changeset d742d80b892f (bug 1543359)
Backed out changeset 210eee703fd9 (bug 1543359)
Backed out changeset 4eb933d55d88 (bug 1543359)
Backed out changeset fb9b71ed9f4b (bug 1543359)
Backed out changeset 98b968443458 (bug 1543359)
Backed out changeset a85bd4691bea (bug 1543359)
Backed out changeset b576317853e9 (bug 1543359)
Backed out changeset 095bca5c9b1a (bug 1543359)
Backed out changeset 48eb0ebf9f2e (bug 1543359)
Backed out changeset b22b0eb708b8 (bug 1543359)
Backed out changeset 52187d9320b1 (bug 1543359)
Backed out changeset fa6792c1c2e8 (bug 1543359)
2019-07-26 11:40:33 +03:00
Jean-Yves Avenard
c97acded3d Bug 1543359 - P6. Add backend for color range information. r=mattwoodrow.
Add code for YCbCr buffer and IOSurface backend.

Differential Revision: https://phabricator.services.mozilla.com/D27213
2019-07-26 06:13:37 +00:00
Cosmin Sabou
037643879f Backed out 14 changesets (bug 1543359) for causing build bustages. CLOSED TREE
Backed out changeset 87c99ef85813 (bug 1543359)
Backed out changeset cd0afc5758ba (bug 1543359)
Backed out changeset 101ac87ff017 (bug 1543359)
Backed out changeset 348e748e3451 (bug 1543359)
Backed out changeset d9e937f5caf4 (bug 1543359)
Backed out changeset 2f4eb6501552 (bug 1543359)
Backed out changeset 0d316ef8c668 (bug 1543359)
Backed out changeset bf238b58c694 (bug 1543359)
Backed out changeset 496f206d03d6 (bug 1543359)
Backed out changeset 7c3a1f23baa8 (bug 1543359)
Backed out changeset 90fff717198b (bug 1543359)
Backed out changeset b2ce591ca398 (bug 1543359)
Backed out changeset a63968f077e3 (bug 1543359)
Backed out changeset ca660ab1e0c1 (bug 1543359)
2019-07-26 07:39:11 +03:00
Jean-Yves Avenard
c6e850aa6f Bug 1543359 - P6. Add backend for color range information. r=mattwoodrow.
Add code for YCbCr buffer and IOSurface backend.

Differential Revision: https://phabricator.services.mozilla.com/D27213
2019-07-22 08:24:30 +00:00
sotaro
bad6d6b048 Bug 1550402 - Remove unnecessary return nullptr in ShmemTextureData::Create() r=nical
The "return nullptr" is redundant.

Differential Revision: https://phabricator.services.mozilla.com/D30457
2019-05-09 07:36:40 +00:00
Jean-Yves Avenard
3fd6d1b0ab Bug 1493898 - P6. Move YUVColorSpace definition in the gfx namespace. r=mattwoodrow.
YUVColorSpace is inseparable from the bit depth as the matrix coefficients to be calculated need the bit depth information.

So let's put the two types together. gfx namespace also makes more sense as that's where we find IntRect, IntSize and other.

The extent of the changes highlight how much similar data structures are duplicated across the code, to the point it's scary.

Differential Revision: https://phabricator.services.mozilla.com/D25347
2019-04-11 12:41:33 +00:00
Alex Gaynor
eaf2024578 Bug 1441651 - Part 2 - pass Shmem and ByteBuf by rvalref to Send* IPC methods; r=nika,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D19954
2019-03-04 16:35:30 +00:00
Ehsan Akhgari
498e2df734 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset
2019-01-18 10:16:18 +01:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Lee Salzman
d3cca0c9bb Bug 1493080 - remove reference cycle between BufferTextureData and DrawTargets. r=jrmuizel 2018-11-14 11:16:01 -05:00