Commit Graph

3917 Commits

Author SHA1 Message Date
Marco Castelluccio
c80fce2b07 Bug 1790816 - Reformat dom/ with isort. r=linter-reviewers,ahal DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162643
2022-11-23 22:09:53 +00:00
Kaiido
a454232b54 Bug 1799058 - Reset context on SetWidth and SetHeight. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D161925
2022-11-22 07:53:29 +00:00
Lee Salzman
f5ed77ef10 Bug 1801446 - Limit the maximum complexity of paths used with wpf-gpu-raster. r=jrmuizel
Some paths may contain so many types that their vertex representation far exceeds their
software rasterized representation in memory size. As a sanity-check, we should just set
a hard limit on the maximum allowed complexity of a path that we attempt to supply to
wpf-gpu-raster. Beyond that, we will instead just rasterize in software and upload
to a texture which can be more performant.

Differential Revision: https://phabricator.services.mozilla.com/D162481
2022-11-22 05:25:59 +00:00
Mathew Hodson
b7382dce22 Bug 1799319 - Disable mozTextStyle in early beta. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161747
2022-11-18 13:05:23 +00:00
Lee Salzman
5f08669bab Bug 1800826 - Remove all clips when reusing a target in Canvas2D. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D162237
2022-11-17 03:10:35 +00:00
Lee Salzman
f73a41e1ac Bug 1800581 - Use optimized snapshots for drawImage if canvases share internal context. r=aosmond
By default, BorrowSnapshot is pessimistic and forces DrawTargetWebgl to return a data snapshot on
the assumption that the snapshot might be used off thread. However, if we actually know the DrawTarget
we're going to be drawing the snapshot to, then we can check if they're both DrawTargetWebgls with
the same internal SharedContext. In that case, we can use a SourceSurfaceWebgl snapshot which can
pass through a GPU texture to the target. This requires us to plumb the DrawTarget down through
SurfaceFromElement all the way to DrawTargetWebgl to make this decision.

Differential Revision: https://phabricator.services.mozilla.com/D162176
2022-11-17 03:07:18 +00:00
Lee Salzman
5e17cdc939 Bug 1800301 - Use Vector instead of custom inlining_vector. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D162083
2022-11-15 08:05:09 +00:00
Kelsey Gilbert
186c6dca7d Bug 1800301 - Reduce allocs and ptr-chasing in ScopedResolveTexturesForDraw. r=gfx-reviewers,lsalzman
+ Add inlining_vector<T,N>, like AutoTArray, but using std::vector for
  familiarity and safety.

Differential Revision: https://phabricator.services.mozilla.com/D162059
2022-11-15 04:11:16 +00:00
Lee Salzman
eadcd17181 Bug 1800352 - Support bigger cache for PathCache. r=aosmond
We have only one path cache shared among all DrawTargetWebgl's, so it can get
bogged down with entries very quickly and needs to have a quite large number
of buckets to compensate.

Differential Revision: https://phabricator.services.mozilla.com/D161956
2022-11-13 23:01:53 +00:00
Narcis Beleuzu
0171c10fa3 Backed out changeset f5a6e0827824 (bug 1800301) for mochitest failure on WebGLContextDraw.cpp . CLOSED TREE 2022-11-12 21:18:23 +02:00
Kelsey Gilbert
02e71dba97 Bug 1800301 - Reduce allocs and ptr-chasing in ScopedResolveTexturesForDraw. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D161940
2022-11-12 18:48:06 +00:00
Lee Salzman
cb9096e766 Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 08:06:44 +00:00
Iulian Moraru
f838c68136 Backed out 3 changesets (bug 1799402) for causing windows build bustages. CLOSED TREE
Backed out changeset e51cd76008ef (bug 1799402)
Backed out changeset 3ff660b475ff (bug 1799402)
Backed out changeset 9cfa7581565e (bug 1799402)
2022-11-12 08:33:24 +02:00
Lee Salzman
bea9f37e42 Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 05:42:30 +00:00
Kelsey Gilbert
656fdb4cf3 Bug 1798929 - Reuse samplerByTexUnit capacity to avoid (de)allocs. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D161755
2022-11-10 08:41:39 +00:00
Lee Salzman
99f83e7841 Bug 1799069 - Preserve buffer provider on same size canvas resets. r=aosmond
Some canvas users attempt to set .width=.width to have the canvas reset as a
side-effect. When this happens, we throw out the buffer provider on reset. However,
this makes it impossible to do any sort of profiling for accelerated canvas inside
the buffer provider since its state is continually reset every frame in these
sorts of use-cases.

To work around this, we make our best attempt to keep the buffer provider around
so long as the size remains the same. The only caveat is that we still need to
keep the side-effect of clearing the buffer when this happens so that the
behavior is similar regardless.

Differential Revision: https://phabricator.services.mozilla.com/D161615
2022-11-09 04:01:55 +00:00
Lee Salzman
b00c9670cf Bug 1799495 - Ensure WaitForShmem has a valid DrawTargetWebgl to access. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D161554
2022-11-08 16:23:56 +00:00
Mathew Hodson
989ac59e8d Bug 1294360 - Remove mozCurrentTransform. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160998
2022-11-08 12:42:23 +00:00
Emilio Cobos Álvarez
44ef3b8685 Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-08 02:36:25 +00:00
sotaro
93ee669086 Bug 1798624 - Release image of SurfaceDescriptorD3D10 on Send-side after Ping response r=jgilbert,gfx-reviewers
GPUVideoTextureClient of SurfaceDescriptorD3D10 needs to be kept alive until WebGLParent::RecvTexImage() is handled by parent side.

Confirmed that test_conformance__textures__misc__texture-npot-video.html test failure was addressed.

Differential Revision: https://phabricator.services.mozilla.com/D161015
2022-11-08 00:32:17 +00:00
Sandor Molnar
7a39c6eef3 Backed out changeset c7f5349824c4 (bug 1799435) for causing crashes in mozilla::dom::HTMLImageElement::LoadSelectedImage CLOSED TREE 2022-11-08 02:39:14 +02:00
Emilio Cobos Álvarez
68c342910f Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-07 22:23:50 +00:00
Andrew Osmond
48ba41716e Bug 1799198 - Check FontFaceSetImpl::GetURLExtraData for nullptr. r=emilio
FontFaceSetWorkerImpl::GetURLExtraData should generally not return a
null pointer, but if it failed to initialize because the worker was
shutdown during FontFaceSetWorkerImpl initialization, then it may never
be created. This patch ensures we check for this race and handle it
appropriately.

Differential Revision: https://phabricator.services.mozilla.com/D161476
2022-11-07 19:34:52 +00:00
Iulian Moraru
2f0dd0e293 Backed out changeset 44cb21194dc0 (bug 1799435) for causing multiple resist fingerprint related failures. CLOSED TREE 2022-11-07 18:42:11 +02:00
Emilio Cobos Álvarez
bac0597c49 Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-07 14:40:57 +00:00
Kelsey Gilbert
2e7f5f28e7 Bug 1798703 - Enforce alignment for UniformData via union rather than overalignment. r=lsalzman
Reverts the overalignment from bug 1794237.

Differential Revision: https://phabricator.services.mozilla.com/D161360
2022-11-07 07:24:43 +00:00
sotaro
6b45a3fe5d Bug 1795050 - Set mResetLayer = true in ClientWebGLContext::Event_webglcontextrestored() r=gfx-reviewers,lsalzman
There was still a timing that hit the assert. When ClientWebGLContext::Event_webglcontextrestored() was called just before ClientWebGLContext::UpdateWebRenderCanvasData() the assert was failed.

Differential Revision: https://phabricator.services.mozilla.com/D161243
2022-11-05 04:14:31 +00:00
alwu
b8b9bafb85 Bug 1262276 - part16 : disable seamless looping for webgl-conf test. r=jgilbert
Per offline discussion with Kesley, we decided to disable seamless
looping for these tests first, and then spend time to figure the gfx
side crash due to not be able to manage texture's lifetime correctly.

For reference, the failed test is
`test_conformance__textures__misc__texture-corner-case-videos.html`.

Differential Revision: https://phabricator.services.mozilla.com/D160701
2022-11-05 02:23:35 +00:00
Razvan Cojocaru
1629218702 Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Narcis Beleuzu
a9a07a1d4d Backed out changeset 183400ded7d4 (bug 1294360) for bustages on CanvasRenderingContext2D.cpp. CLOSED TREE 2022-11-03 13:06:15 +02:00
Mathew Hodson
d09399daf1 Bug 1294360 - Remove mozCurrentTransform. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160998
2022-11-03 10:26:08 +00:00
Kelsey Gilbert
cde25793b6 Bug 1798539 - Release temp shmem on Send-side after Ping response. r=gfx-reviewers,lsalzman
Originally, we special-cased shmems to try to send them directly
without a copy.
Unfortunately, ipc::Shmem doesn't support that, so we
allocated a new shmem on PWebGL and sent that.
However, we didn't include shmem-cleanup steps in RecvTexImage, so we
leaked the shmem.

We would be tempted to check inside the Desc in RecvTexImage and cleanup that
shmem, *however* RawTexImage from dtwebgl also uses this path, and its shmems
are UnsafeShmems, which are *not* supposed to be cleaned up.

Rather than adding e.g. a bool to differentiate them, let's just explicitly do
the cleanup in the caller that knows it needs to clean up.

One pattern I want to use more often for cross-process lifetimes is:
```
  foo = new RefcountedResource();
  SendUseAsync(foo);
  SendPing()->Then([foo]() {});
```

By the time we the promise from SendPing is resolved, we know the remote side is
done with `foo`, and so our trivial capturing lambda will take care of releasing
it on the Send side. It's straightforward and safe, and the lifetimes have one
extra return-trip of latency, but that's almost always fine.

Differential Revision: https://phabricator.services.mozilla.com/D160996
2022-11-02 05:22:09 +00:00
sotaro
2ca9b289bc Bug 1795050 - Add context lost check to ClientWebGLContext::UpdateWebRenderCanvasData() r=gfx-reviewers,lsalzman
There was a case that context was lost with mResetLayer=false.

Differential Revision: https://phabricator.services.mozilla.com/D160874
2022-11-01 08:13:54 +00:00
Cosmin Sabou
7ed85f948e Bug 1796057 - Skip also test_2_conformance__textures__misc__texture-srgb-upload.html on android because of permanent failures. a=test-only. 2022-10-31 14:57:49 +02:00
Cosmin Sabou
2de23bff39 Bug 1796057 - Skip test_conformance__textures__misc__texture-srgb-upload.html on android for permanent failures. a=test-only 2022-10-31 08:23:20 +02:00
Cosmin Sabou
20979546ad Bug 1796057 - Mark as failing some webgl-conf/generated tests on android-aarch64 due to permanent failures. r=intermittent-reviewers,jmaher DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D160372
2022-10-28 18:35:25 +00:00
Chris Peterson
075d5c8197 Bug 1794164 - Fix C++20 -Wenum-float-conversion warnings in layout-related code. r=dholbert
C++20 deprecates some operations between enums and floating point types:

https://clang.llvm.org/docs/DiagnosticsReference.html#wenum-float-conversion

dom/canvas/CanvasRenderingContext2D.cpp:4743:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

dom/events/EventStateManager.cpp:6656:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'
dom/events/EventStateManager.cpp:6664:35 [-Wenum-float-conversion] comparison of floating-point type 'double' with enumeration type 'mozilla::EventStateManager::(unnamed enum at dom/events/EventStateManager.h:342:3)'

gfx/thebes/gfxTextRun.cpp:2992:24 [-Wenum-float-conversion] comparison of floating-point type 'gfxFloat' (aka 'double') with enumeration type 'gfxFontGroup::(unnamed enum at gfx/thebes/gfxTextRun.h:1035:3)'

layout/generic/nsVideoFrame.cpp:59:58 [-Wenum-float-conversion] arithmetic between enumeration type 'VideoInfo::Rotation' and floating-point type 'double'

layout/painting/nsCSSRenderingBorders.cpp:2752:27 [-Wenum-float-conversion] arithmetic between enumeration type 'mozilla::Corner' and floating-point type 'double'

Differential Revision: https://phabricator.services.mozilla.com/D158867
2022-10-28 00:45:25 +00:00
Lee Salzman
f7d832fd81 Bug 1794237 - Ensure worst case alignment of UniformData Range when serialized. r=jgilbert
The UniformData call accepts a Range<uint8_t>. When serialized by ClientWebGLContext,
however, the data is only serialized to the alignment of the supplied uint8_t type.
The HostWebGLContext may then alias it to a Range<uint32_t> or similar, while the data
was only aligned to 1-byte alignment. On some platforms such as ARM, these unaligned
accesses can cause a SIGBUS.

As a temporary workaround, we will now pessimistically align such ranges as if they
might be accessed as any possible data type with kUniversalAlignment.

Differential Revision: https://phabricator.services.mozilla.com/D160289
2022-10-26 04:34:37 +00:00
Iulian Moraru
28e7846678 Backed out changeset 0cbb0a1bb813 (bug 1794237) for causing multiple WebGL related failures. CLOSED TREE 2022-10-26 02:40:50 +03:00
Lee Salzman
cd73425fee Bug 1794237 - Ensure worst case alignment of UniformData Range when serialized. r=jgilbert
The UniformData call accepts a Range<uint8_t>. When serialized by ClientWebGLContext,
however, the data is only serialized to the alignment of the supplied uint8_t type.
The HostWebGLContext may then alias it to a Range<uint32_t> or similar, while the data
was only aligned to 1-byte alignment. On some platforms such as ARM, these unaligned
accesses can cause a SIGBUS.

As a temporary workaround, we will now pessimistically align such ranges as if they
might be accessed as any possible data type with kUniversalAlignment.

Differential Revision: https://phabricator.services.mozilla.com/D160289
2022-10-25 21:37:23 +00:00
Lee Salzman
8b2b4a62ba Bug 1793887 - Limit the size of stroked path uploads. r=aosmond
If we have stroked paths whose bounds cover a lot of screen area, that can lead
to a lot of empty area in the interior that bloats the path cache textures up
with unused pixels that still need to be uploaded. Try to avoid this by not
trying to accelerate paths with the path cache that take up a large amount
of screen area.

Differential Revision: https://phabricator.services.mozilla.com/D160023
2022-10-25 17:46:22 +00:00
Lee Salzman
1ca676e9e2 Bug 1797099 - Ensure the SurfacePattern transform is invertible. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D160091
2022-10-25 17:42:05 +00:00
Jonathan Kew
8888937e07 Bug 1461589 - Handle font-variant-emoji during font matching. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D147495
2022-10-22 09:43:49 +00:00
Emilio Cobos Álvarez
afcb3962b4 Bug 1796819 - Remove OffscreenCanvas origin trial / domain allowlist. r=aosmond
We've shipped this, a single pref should be enough.

Differential Revision: https://phabricator.services.mozilla.com/D159947
2022-10-21 19:00:57 +00:00
Jonathan Kew
15cc45b65a Bug 1796779 - Add a test for serialization of '.font' on offscreen canvas2d. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D159946
2022-10-21 17:09:13 +00:00
Jonathan Kew
51f703718f Bug 1796779 - Fix missing space in Canvas2d font serialization. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D159941
2022-10-21 17:09:13 +00:00
Kelsey Gilbert
ec6dfbd3c8 Bug 1772999 - Allow OES_draw_buffers_indexed by default. r=gfx-reviewers,jrmuizel
It might not be supported everywhere, but we won't block it on the
draft-ext pref anymore.

Differential Revision: https://phabricator.services.mozilla.com/D159885
2022-10-20 20:11:49 +00:00
Kelsey Gilbert
8c20431fa2 Bug 1696693 - Don't blit-tex-upload for srgb textures. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D159649
2022-10-19 01:22:43 +00:00
Kelsey Gilbert
72f9d0d744 Bug 1794956 - Repair and enable test_offscreencanvas_toimagebitmap.html. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D159453
2022-10-16 22:52:41 +00:00
Kelsey Gilbert
4e7b4b5647 Bug 1794956 - TransferToImageBitmap should reset bitmap but not state. r=gfx-reviewers,lsalzman
s/Reset/ResetBitmap/ and implement for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D159346
2022-10-16 22:52:40 +00:00