Commit graph

172 commits

Author SHA1 Message Date
Kelsey Gilbert
56c7f1eafc Bug 1878930 - r/RawBuffer/Span/: TexImage: Don't copy desc. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D202026
2024-02-29 00:37:29 +00:00
Andrew Osmond
95c593b9a7 Bug 1870065 - Make WebGL check for null surfaces with ImageBitmap. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D196437
2024-02-28 18:08:57 +00:00
Sandor Molnar
d16ed2c545 Backed out 7 changesets (bug 1878930) for causing build bustages @ dom/canvas/WebGLTypes.h CLOSED TREE
Backed out changeset 631db0feebb4 (bug 1878930)
Backed out changeset 72ab4dbbf8ed (bug 1878930)
Backed out changeset e5119acd8c8f (bug 1878930)
Backed out changeset 3cd4b2423281 (bug 1878930)
Backed out changeset 4a5512ff4424 (bug 1878930)
Backed out changeset 6f5c64075e31 (bug 1878930)
Backed out changeset fb3b3487a529 (bug 1878930)
2024-02-20 21:25:02 +02:00
Kelsey Gilbert
bbfd7b04e2 Bug 1878930 - r/RawBuffer/Span/: TexImage: Don't copy desc. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D202026
2024-02-20 17:59:08 +00:00
Kelsey Gilbert
b04996924d Bug 1037100 - Scoped.h removed because no outstanding uses. r=glandium,dom-storage-reviewers,jesup,janv
Differential Revision: https://phabricator.services.mozilla.com/D201763
2024-02-14 06:41:58 +00:00
Timothy Nikkel
f6d459b9ba Bug 1841050. r=gfx-reviewers,nical,ahale
Differential Revision: https://phabricator.services.mozilla.com/D191597
2023-10-25 00:21:00 +00:00
Andrew Osmond
34f04947f7 Bug 1781526 - Implement means to use VideoFrame with WebGL. r=webidl,smaug,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D181118
2023-09-20 22:40:24 +00:00
Butkovits Atila
14c4666a5f Backed out changeset 0a2985a48339 (bug 1769747) for causing gl failures. 2022-10-05 01:38:13 +03:00
Kelsey Gilbert
5e0abe1b97 Bug 1769747 - Support non-RGBA video-to-texture fastpath. r=gfx-reviewers,nical
Also scale back some asserts from debug-fatal to just warnings, because
I kept hitting them during testing because of our poor surface lifetime
handling.

Differential Revision: https://phabricator.services.mozilla.com/D157993
2022-10-04 20:31:42 +00:00
Ashly Hale
182567c9fe Bug 1789729 - Implement webgl.max-size-per-texture-mib r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D156903
2022-10-03 13:27:12 +00:00
alwu
efe35b01d5 Bug 1771011 - part2 : wrap media engine's dcomp handle, and use it on our gfx pipeline in the GPU process.r=jolin,sotaro
In this patch, we ask the media engine to return a handle for shareable
dcomp surface, which will then be packaged into a new texture data type
and being shared with the GPU process via the video bridge.

DcompSurfaceImage is the image which contains the handle texture data,
which doesn't support being accessed in the content process. When the
compositor uploads the image to the GPU process, the corresponding
texture host will be created.

The render texture host will be created by that texture host, and it
will be used in DCLayerTree. In DCLayerTree, we create a new type of
surface for our dcomp handle. DCSurfaceHandle will ask the render
texture host to reconstruct the surface by the handle shared from the
remote process (the handle is actually duplicated to the parent process
first due to the sandbox policy, and then be duplicated to the GPU
process later)

DCSurfaceHandle will attach that surface to its visual in order to
display the video frame directly. In the whole process, it's not
possible for Gecko to access any decoded video data which is protected by the
media engine itself.

Depends on D149941

Differential Revision: https://phabricator.services.mozilla.com/D151019
2022-08-13 23:48:07 +00:00
Kelsey Gilbert
e780e343c7 Bug 1682612 - Check for ArrayBuffer Detach/Transfer in texImage2D(ImageData). r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D141689
2022-03-21 23:21:42 +00:00
Kelsey Gilbert
aeeb1e199d Bug 1750310 - Centralize and reuse pixelstorei pack/unpack handling. r=lsalzman
* Accept that finding an explicit unpack for a given stride might fail.
* Directly use the logic from the GLES spec for unpacking stride calculations.
* Use structuredSrcSize member.
* Calc explicit unpack based on dstStride, not srcStride.

Differential Revision: https://phabricator.services.mozilla.com/D136052
2022-02-12 02:20:42 +00:00
Andrew Osmond
50109bb823 Bug 1751915 - Ensure WebGLRenderingContext texImage/etc support OffscreenCanvas as a source. r=jgilbert,webidl,smaug
This patch adds OffscreenCanvas as a texture source for texImage2D,
texSubImage2D and texSubImage2D. This applies to both
WebGLRenderingContext and WebGL2RenderingContext. This was causing
several test failures in the WebGL conformance suite with
OffscreenCanvas.

Differential Revision: https://phabricator.services.mozilla.com/D136924
2022-01-27 15:38:02 +00:00
Andrew Osmond
21fd249c37 Bug 1747176 - Make ClientWebGLContext::TexImage2D with a DOM element work with OffscreenCanvas. r=jgilbert
We cannot access DOM elements off the main thread, so any uses of that
must be a mistake. Also, if we are in use with an OffscreenCanvas, we
won't have an HTMLCanvasElement, so we need to make sure we pull the
nsIPrincipal from the OffscreenCanvas object instead.

Differential Revision: https://phabricator.services.mozilla.com/D136275
2022-01-18 23:45:17 +00:00
Kelsey Gilbert
ddb05ea412 Bug 1747299 - [UniqueBuffer] Use UniqueBuffer::Take instead of copy constructors for void*. r=gfx-reviewers,sotaro
Differential Revision: https://phabricator.services.mozilla.com/D134589
2021-12-25 00:31:48 +00:00
aardgoose
90f897f991 Bug 1367251 - ignore gl.UNPACK_FLIP_Y_WEBGL & UNPACK_PREMULTIPLY_ALPHA for textures uploading ImageBitmap data as per spec. r=jgilbert
***

Differential Revision: https://phabricator.services.mozilla.com/D29469
2021-09-02 00:29:28 +00:00
Jeff Gilbert
f434e44ced Bug 1675410 - Update S3TC/BPTC/RGTC w/h restrictions. r=gfx-reviewers,lsalzman
Tracks spec+test updates here:
https://github.com/KhronosGroup/WebGL/pull/3304

Differential Revision: https://phabricator.services.mozilla.com/D121581
2021-08-07 07:44:20 +00:00
Emilio Cobos Álvarez
01419dd4c8 Bug 1709622 - Apply EXIF resolution to SurfaceFromElement. r=tnikkel,jrmuizel,jgilbert
And make sure we return the surface of the right size for canvas, which
makes that assumption in a bunch of places.

Depends on D114686

Differential Revision: https://phabricator.services.mozilla.com/D114687
2021-05-10 23:39:05 +00:00
Emilio Cobos Álvarez
6d91a5484a Bug 1709622 - Remove no-op FLAG_WANT_DATA_SURFACE. r=tnikkel,jgilbert
Depends on D114685

Differential Revision: https://phabricator.services.mozilla.com/D114686
2021-05-10 23:39:04 +00:00
Jeff Gilbert
c2e4fdeb90 Bug 1686750 - Upload zeros if layers::Image => SurfaceDescriptor fails. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D101948
2021-01-15 19:18:38 +00:00
Jeff Gilbert
a8926ffa47 Bug 1640607 - Send SurfaceDescriptors for GPU blitting for video-to-webgl. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D101061
2021-01-14 01:23:06 +00:00
Simon Giesecke
1c53236b70 Bug 1679272 - Include ScopeExit.h exactly where used. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D98888
2020-12-07 14:25:59 +00:00
Simon Giesecke
971b645fe3 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
Jeff Gilbert
439d12dc7e Bug 1676242 - Enforce BPTC/RGTC level 0 => w/h multiple of 4. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D96457
2020-11-09 22:04:21 +00:00
Botond Ballo
01b3c7969d Bug 1667594 - Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.

This avoids including nsLayoutUtils.h in nsRange.h.

Differential Revision: https://phabricator.services.mozilla.com/D91685
2020-09-30 21:06:47 +00:00
Jeff Gilbert
62f6cc5d9c Bug 1659225 - Apply UNPACK_ params only after init. r=lsalzman
+ Add asserts that we are infact in the default state.

Differential Revision: https://phabricator.services.mozilla.com/D87964
2020-08-23 06:09:33 +00:00
Jeff Gilbert
f25a4cdbe8 Bug 1607940 - IPC TexImage. r=lsalzman,nika,handyman
Differential Revision: https://phabricator.services.mozilla.com/D83291
2020-07-21 22:57:01 +00:00
Dorel Luca
4681060e62 Backed out 3 changesets (bug 1367251) for Mda failures in /test_background_video_tainted_by_createimagebitmap.html. CLOSED TREE
Backed out changeset 871379f9b194 (bug 1367251)
Backed out changeset a76c2c98b33c (bug 1367251)
Backed out changeset a55cda2431fc (bug 1367251)
2020-07-15 16:37:32 +03:00
aardgoose
10c1acf825 Bug 1367251 - ignore gl.UNPACK_FLIP_Y_WEBGL & UNPACK_PREMULTIPLY_ALPHA for textures uploading ImageBitmap data as per spec. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D29469
2020-07-15 11:02:28 +00:00
Jeff Gilbert
cd6049bac5 Bug 1625404 - webgl.copyTexSubImage should lazily-initialize unwritten destination pixels. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D68938

--HG--
extra : moz-landing-system : lando
2020-03-31 01:00:50 +00:00
Daniel Varga
dda7e26657 Backed out changeset 8717adb8b05b (bug 1625404) for causing node debugger failures
CLOSED TREE
2020-03-30 22:39:10 +03:00
Jeff Gilbert
bab92087d4 Bug 1625404 - webgl.copyTexSubImage should not preserve existing dest rect contents. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D68516

--HG--
extra : moz-landing-system : lando
2020-03-30 18:50:30 +00:00
Simon Giesecke
0cc5c6e63f Bug 1052940 - Make Maybe<T> only declare copy/move operations if T is copyable/movable. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68172

--HG--
extra : moz-landing-system : lando
2020-03-27 14:10:45 +00:00
Jeff Gilbert
011c0a1fd7 Bug 1616715 - SurfaceFromElement gets alpha Premult unless opt-in to NonPremult. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63421

--HG--
extra : moz-landing-system : lando
2020-02-21 02:27:08 +00:00
Csoregi Natalia
0d667d17dd Backed out changeset 5005fe56b7b0 (bug 1616715) for failures on test_2_conformance2__canvas__to-data-url-with-pack-params.html. CLOSED TREE 2020-02-21 01:33:48 +02:00
Jeff Gilbert
95d86374ba Bug 1616715 - SurfaceFromElement gets alpha Premult unless opt-in to NonPremult. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63421

--HG--
extra : moz-landing-system : lando
2020-02-20 20:52:10 +00:00
Edgar Chen
9e846bd48a bug 1610296 - Rename TypedArray_base::ComputeLengthAndData to TypedArray_base::ComputeState; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D60514

--HG--
extra : moz-landing-system : lando
2020-01-23 03:22:06 +00:00
Jeff Gilbert
0dfd1a2a0d Bug 1477756 - Fix all webgl regression tests according to CI. r=handyman
(This is a combination of 31 commits)

* Fix Linux compilation.

* Fix mac compilation.

* CI compile fixes.

* printf's size_t is %zu. %tu would be unsigned ptrdiff_t.

* No non-ref Maybe args.

* MOZ_CRASH for noreturn

* Handle implied texture sizes, rewrite comment stripping.

* Replace e.g. WebGLProgramInner with simpler webgl::ProgramKeepAlive.

* Bounce ValidateProgram call off driver.

* Uniform name length limit, cubemap fb-attach, non-array uniforms, undersized texImage views.

* alignas for uint8_t[sizeof(float)*N] pun buffers.

* CC fixes?

* Fill attrib0Active.

* Repair max-warnings limit.

* This is basically required in order for CI's logging to not explode.

* Don't cache WebGLMemoryTracker.

* Deleted prog/shader error, no texSubImage(null), client-side fingerprint resist for exts.

* Fix GetUniformIndices and MakeRangeFromView.

* CC Traverse base class from within derived class to fix leaking the world. :(

* PauseTransformFeedback
* TexImage video fastpath
* GetFragLocation for arrays
* Forbid BindBufferRange during TF

* Mark tests and fix RBAB query and test.

* Change(!) query deletion behavior to match spec.
* Mark conformance2/query/query.html failing for now.

* Implicitly EndQuery on DeleteQuery while spec is in flux.

* Fix error code for test.

* RAII LruPosition for WebGL context limit.

* Include std::list.

* Mark CompileResult and LinkResult.pending as false when retrieved.

* Hold strong-ref to NotLostData during Run<> to prevent LoseContext=>UAF.

* Don't assume GetUniformLocation(foo+'[0]') means foo is an array.
* Don't assume !mCanvasElement means !!mOffscreenCanvas.

* Handle composition while context-lost.

* All non-value-init members must be const or have inline init.

* Mark passing tests on Linux.

Depends on D54019

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

--HG--
extra : moz-landing-system : lando
2020-01-08 22:19:23 +00:00
Jeff Gilbert
e1d0fe64bb Bug 1477756 - Client-side bindings mirror for precise CC, and merge similar codepaths. r=handyman
* Context loss using RAII
* Move Program reflection Client-side

Depends on D54018

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

--HG--
extra : moz-landing-system : lando
2020-01-08 22:19:16 +00:00
David Parks
198fa063c2 Bug 1477756 - Initial out-of-process WebGL implementation. r=mccr8,handyman
Splits WebGLContext into ClientWebGLContext and HostWebGLContext.  The Client enables the JS-control of a WebGL context in a content procecss while the Host executes the WebGL graphics operations (via a WebGLContext that maintains much of the existing code) in the compositor process.  At this point, the cross-process behavior is disabled -- this series of patches is an incremental step toward that final goal.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 22:19:14 +00:00
Greyson Gilbert
20a52c4874 Bug 1564293 - Allow efficient slicewise upload of 3D textures r=jgilbert
Before this patch any partial upload to a texture would incur
a zeroing of the texture first to prevent leakage of information.
The texture now tracks, for each image not fully initialized,
which z-slices have been initialized, and only zeroes the rest
of the slices when the texture is used.

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

--HG--
extra : moz-landing-system : lando
2019-07-30 23:32:29 +00:00
Brindusan Cristian
339a4ceab8 Backed out changeset ac0666e2b27c (bug 1564293) for build bustages on WebGLFramebuffer.cpp:883:26. CLOSED TREE 2019-07-26 12:04:54 +03:00
Greyson Gilbert
a22343ae66 Bug 1564293 - Allow efficient slicewise upload of 3D textures r=jgilbert
Before this patch any partial upload to a texture would incur
a zeroing of the texture first to prevent leakage of information.
The texture now tracks, for each image not fully initialized,
which z-slices have been initialized, and only zeroes the rest
of the slices when the texture is used.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 06:43:02 +00:00
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Greyson Gilbert
5ab46fc0a3 Bug 1535809 - Add warning on use of implicitly enabled extensions r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D36431

--HG--
extra : moz-landing-system : lando
2019-07-09 05:21:30 +00:00
Nicholas Nethercote
76f416f162 Bug 1562331 - Make webgl.* static prefs follow the naming convention. r=KrisWright
Also converts webgl.pref-16bpp from a VarCache pref to a normal pref, because
it doesn't need to be a VarCache pref.

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

--HG--
extra : rebase_source : 5aa1d251b751c41ec525fef7d0467ffebe401d9a
2019-06-29 07:56:43 +10:00
Jeff Gilbert
07c032ccbd Bug 1319426 - Don't keep ANGLE shader compilers around. r=lsalzman
This will also make it easier if we want to reuse compilers/validators.

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

--HG--
extra : moz-landing-system : lando
2019-06-21 16:52:50 +00:00
Jeff Gilbert
7ac9159761 Bug 1442825 - Remove ScopedGLWrapper base class. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D35138

--HG--
extra : moz-landing-system : lando
2019-06-17 06:40:27 +00:00
Jeff Gilbert
bbb1e5a221 Bug 1533522 - Truncate Buffer/Texture on GL_OOM. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D34982

--HG--
extra : moz-landing-system : lando
2019-06-14 03:26:18 +00:00