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

3816 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 581c22e956 Bug 1677183 - Implement WebGPU's Queue.copyExternalImageToTexture. r=jgilbert,jimb,emilio
Differential Revision: https://phabricator.services.mozilla.com/D145269
2022-08-18 16:11:46 +00:00
Lee Salzman 98afe660d7 Bug 1784910 - Render bitmap fonts as light-on-dark text. r=aosmond
When we are rendering dark-on-light text, we invert the bitmap after
rendering to produce a standard white-on-black mask, since we must actually
render that as black-on-white to get CoreText to produce the correct dilation.

However, when we know we're rendering bitmap fonts for emoji, we don't actually
want this inversion to happen at all. So we need to ensure bitmaps go through
the normal light-on-dark path that doesn't do this.

Differential Revision: https://phabricator.services.mozilla.com/D154777
2022-08-16 16:49:10 +00:00
Lee Salzman 2ba1202314 Bug 1784315 - Ensure the clipping applied to glyph cache entries matches. r=aosmond,gfx-reviewers
If viewport clipping is applied to the bounds of glyphs, we can end up finding the
wrong entry if the clipping would differ, since we no longer compare the bounds to
the entry bounds when searching for a matching entry in an effort to reduce the
amount of bounds computations in the common case.

To workaround this, each entry now remembers its full, unclipped bounds. Upon
finding a candidate entry, we offset the full bounds to the new offset and reapply
clipping. If the bounds then match with the old clipped bounds with the new offset
applied, then we know the amount of applied clipping is the same, and it is safe
to reuse the entry.

Differential Revision: https://phabricator.services.mozilla.com/D154490
2022-08-16 03:05:45 +00:00
Andrew Osmond 5b2fd01232 Bug 1783309 - Convert OffscreenCanvas domain allowlist pref to DataMutexString. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153831
2022-08-16 01:00:23 +00:00
Andrew Osmond 8d1323b0e8 Bug 1782722 - Make WebGL override unmasked renderer/vendor pref accesses thread safe. r=gfx-reviewers,lsalzman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D153469
2022-08-16 01:00:22 +00:00
Marian-Vasile Laza d0b3c95cc2 Backed out 2 changesets (bug 1781728) for causing bustages on WebGLTexture.cpp. CLOSED TREE
Backed out changeset 94e7a44f0d16 (bug 1781728)
Backed out changeset 985d9726a7f6 (bug 1781728)
2022-08-15 09:33:13 +03:00
Paul Bone 4bdb2927d4 Bug 1781728 - Fix code style r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D154525
2022-08-15 03:48:48 +00:00
Paul Bone 41c56a5ac2 Bug 1781728 - Clamp WebGL mipmap levels r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D154524
2022-08-15 03:48:47 +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
Marian-Vasile Laza 58dfa7010d Backed out 10 changesets (bug 1771011) for causing bustages on DcompSurfaceImage.obj. CLOSED TREE
Backed out changeset 1ff210178343 (bug 1771011)
Backed out changeset 58a60aa8d5b8 (bug 1771011)
Backed out changeset cfe2f5232167 (bug 1771011)
Backed out changeset d4a6f861a2ce (bug 1771011)
Backed out changeset e85111774e42 (bug 1771011)
Backed out changeset c431eda74191 (bug 1771011)
Backed out changeset 4a9d4b84bba8 (bug 1771011)
Backed out changeset 3ff1b211a793 (bug 1771011)
Backed out changeset 39cbad610c66 (bug 1771011)
Backed out changeset c3f7229289f6 (bug 1771011)
2022-08-13 05:14:12 +03:00
alwu 58ebb98d1a 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 01:30:38 +00:00
Andrew Osmond 8751373382 Bug 1784565 - Annotate OffscreenCanvasDisplayHelper's mutex. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D154569
2022-08-12 21:16:06 +00:00
Andrew Osmond 9bcd835f26 Bug 1784514 - Avoid initialization and commit deadlocks for OffscreenCanvas. r=emilio
When creating an ImageContainer for OffscreenCanvas, we were holding a
lock for the OffscreenCanvas. The constructor for an ImageContainer may
do a sync call back to the ImageBridgeChild thread in the content
process, unlike its typical async notifications for other operations
once it has been created.

There is no need to hold the OffscreenCanvas lock while we create the
ImageContainer itself, so it is best to not to avoid any potential
deadlocks.

Similarly, we should avoid holding the lock when performing the
readback, if any, for the canvas during the display commit.

Differential Revision: https://phabricator.services.mozilla.com/D154556
2022-08-12 20:41:50 +00:00
Lee Salzman 681687a77b Bug 1783717 - Faster allocation of TexturePacker children. r=aosmond,gfx-reviewers
Rather than allocating TexturePacker children individually, allocate an array
of all the children at once to cut the number of memory allocations in half.

Depends on D154118

Differential Revision: https://phabricator.services.mozilla.com/D154182
2022-08-10 02:57:26 +00:00
Lee Salzman 119e3df4ef Bug 1783717 - Only compute glyph bounds on cache insertion. r=aosmond,gfx-reviewers
Now that we're actually hitting cache entries in the glyph cache, it turns out
always computing the local glyph bounds can be expensive, especially since they
should never really change. Instead, rely on the bounds that were initially
computed when an entry is inserted into the cache, and just change their relative
offset based on the current transform. This way, in the common case of a cache
hit, we never need to compute the bounds.

Differential Revision: https://phabricator.services.mozilla.com/D154118
2022-08-10 02:57:26 +00:00
Lee Salzman 93a7681a8c Bug 1783717 - Fix glyph cache entry bounds comparisons in DrawTargetWebgl. r=aosmond
Offsets were being specified in quantized space (i.e. scaled 1-4x) whereas bounds were
still in the original coordinate space. The bounds need to be transformed by the same
quantization scale so that glyph cache entries compare correctly. This was preventing
cache entries from being properly reused.

Differential Revision: https://phabricator.services.mozilla.com/D154102
2022-08-10 02:57:25 +00:00
Lee Salzman e78da6287c Bug 1783717 - Use hash chaining for DrawTargetWebgl cache entries. r=aosmond,bradwerth
This implements a rudimentary form of hash chaining for cache entries that reduces
the number of entry comparisons by about an order of magnitude. It's a bit of a bother
to use an actual hash table here since right now the code expects to be able to have
random access to cache entries in the list, and the MFBT hash table is not quite set
up for this. Instead, this just adds a reasonable fixed number of buckets to bring
the list size better under control.

Differential Revision: https://phabricator.services.mozilla.com/D154101
2022-08-10 02:57:23 +00:00
Kelsey Gilbert 9f564e90d8 Bug 1778808 - Trim unused code, particularly in TiedFields.h. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D153828
2022-08-09 21:01:56 +00:00
Kelsey Gilbert f608e1f1e0 Bug 1778808 - Use stricter TiedFields instead of IsTriviallySerializable in WebGL's QueueParamTraits. r=lsalzman,nika
```
// We guarantee our robustness via these requirements:
// * Object.MutTiedFields() gives us a tuple,
// * where the combined sizeofs all field types sums to sizeof(Object),
//   * (thus we know we are exhaustively listing all fields)
// * where feeding each field back into ParamTraits succeeds,
// * and ParamTraits is only automated for BytesAlwaysValidT<T> types.
// (BytesAlwaysValidT rejects bool and enum types, and only accepts int/float
// types, or array or std::arrays of such types)
// (Yes, bit-field fields are rejected by MutTiedFields too)
```

BytesAlwaysValidT<T> is the same as the IsTriviallySerializable<T> that
it replaces, however the emphasis is different, and should discourage
tagging structs as IsTriviallySerializable, since they more clearly
aren't BytesAlwaysValid.

Differential Revision: https://phabricator.services.mozilla.com/D151676
2022-08-09 21:01:55 +00:00
Norisz Fay 53ca28e903 Backed out changeset 4e76508f9136 (bug 1677183) for causing mochitest failures on test_queue_copyExternalImageToTexture.html CLOSED TREE 2022-08-08 14:03:15 +03:00
Andrew Osmond 2b1c7294dc Bug 1677183 - Implement WebGPU's Queue.copyExternalImageToTexture. r=jgilbert,jimb,emilio
Differential Revision: https://phabricator.services.mozilla.com/D145269
2022-08-08 09:54:25 +00:00
Lee Salzman 2273a39e73 Bug 1781064 - Get buffer size directly from BufferTextureData. r=aosmond,gfx-reviewers
Since the BufferTextureData is getting created based on ImageDataSerialize::ComputeRGBBufferSize,
the stride may be padded for alignment which doesn't agree with the simple calculation duplicated
here. In general, it is less error-prone to just ask the BufferTextureData itself for its buffer
size, so just do that here instead rather than trying to make duplicate calculations with invalid
assumptions.

Differential Revision: https://phabricator.services.mozilla.com/D153868
2022-08-05 18:48:48 +00:00
Fabrice Desré c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel 3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Mark Banner 7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Kelsey Gilbert 8969436550 Bug 1778144 - Add limit webgl.fake-verts.max=10M. r=gfx-reviewers,lsalzman
Otherwise seemingly lightweight but unusual calls like
drawArrays(offset:1.5billion) will try to allocate a very large gpu
buffer, which sometimes takes a very long time.

This is unusual and we shouldn't encourage it, so let's just add a
limit. 10M is 160MB, which is generally big enough but not too big.

Differential Revision: https://phabricator.services.mozilla.com/D153533
2022-08-03 06:11:14 +00:00
Kelsey Gilbert a8b77633d6 Bug 1778549 - Don't crash on validation failure in ReadPixelsPbo. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153423
2022-08-03 06:10:31 +00:00
Andrew Osmond b4665f2095 Bug 1780042 - Set CanvasPattern principal for main thread OffscreenCanvas. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152710
2022-08-02 15:51:45 +00:00
Kelsey Gilbert ae9bf670e5 Bug 1768190 - Forbid same tex unit different sampler types even if unbound. r=gfx-reviewers,lsalzman
Previously, we checked this but only if there was a texture bound to the
tex unit. However technically we're supposed to check regardless. ANGLE
and Mesa both do, which causes this error.

Differential Revision: https://phabricator.services.mozilla.com/D153422
2022-08-02 05:56:20 +00:00
Andreea Pavel 89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré 0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Iulian Moraru 27d760c7c2 Backed out 9 changesets (bug 1771374) for causing mochitest-webgl failures. CLOSED TREE
Backed out changeset ded977dd1896 (bug 1771374)
Backed out changeset adeb8b7d48f9 (bug 1771374)
Backed out changeset 7767340872c5 (bug 1771374)
Backed out changeset 33282b4ffaae (bug 1771374)
Backed out changeset 75db498cd0e7 (bug 1771374)
Backed out changeset 70035903ea37 (bug 1771374)
Backed out changeset 7c7de0fb66e1 (bug 1771374)
Backed out changeset 615df05e016f (bug 1771374)
Backed out changeset ac3411d21928 (bug 1771374)
2022-08-02 03:38:09 +03:00
Kelsey Gilbert 940ea9d31a Bug 1771374 - Mark test expectations. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D152818
2022-08-01 19:49:30 +00:00
Kelsey Gilbert 4b2a1851ac Bug 1771374 - Pad odd-sized surface swapchains to even numbers. r=gfx-reviewers,nical
We need to pad e.g. nv12 4:2:0 formats in order to have integer-sized
chroma planes.
But also to avoid needing laser-focused testing for this case, just
unconditionally pad odd-sizes to even numbers.

* Test handling of odd-number-sized surfaces.

Differential Revision: https://phabricator.services.mozilla.com/D152797
2022-08-01 19:49:29 +00:00
Kelsey Gilbert 2a5c922196 Bug 1771374 - Snap color_quads.html to device pixels. r=gfx-reviewers,bradwerth
This should reduce the fuzzy()ness we need to annotate.

Differential Revision: https://phabricator.services.mozilla.com/D152796
2022-08-01 19:49:28 +00:00
Kelsey Gilbert 5108ab70bf Bug 1771374 - Create swapchain with premult-alpha if hasAlpha. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152445
2022-08-01 19:49:28 +00:00
Kelsey Gilbert 5702c0640c Bug 1771374 - Use {bool, T} instead of Maybe<T> for now. r=gfx-reviewers,lsalzman
`Maybe` isn't is_trivially_copyable, and std::optional isn't either on
the old libstdc++ we use from gcc7 still.

I'm working on more robust approach to serialization but that's beyond
the scope of this bug.

Differential Revision: https://phabricator.services.mozilla.com/D151421
2022-08-01 19:49:28 +00:00
Kelsey Gilbert fa6e66aedd Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-08-01 19:49:26 +00:00
Andrew Osmond 0a97a80dae Bug 1782552 - Make CanvasRenderingContext2D::sErrorTarget threadsafe. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153374
2022-08-01 18:11:16 +00:00
Lee Salzman d5dca4e084 Bug 1782443 - Call MarkSkiaChanged in DrawTargetWebgl::LockBits. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D153317
2022-08-01 15:29:49 +00:00
Lee Salzman 57b5364468 Bug 1771007 - Add testcase. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D153308
2022-07-31 15:36:59 +00:00
Nika Layzell effe5537b9 Bug 1772006 - Part 6: Simplify and move the find+replace methods from ns[T]StringObsolete, r=xpcom-reviewers,barret
The remaining methods in ns[T]StringObsolete are all find+replace methods for
nsTSubstring. These were migrated in a similar way to the find methods, and
partially updated to avoid using methods from nsStringObsolete.cpp.

This change removes the ns[T]StringObsolete.cpp files completely, as they are
no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D148301
2022-07-30 00:12:49 +00:00
Andrew Osmond c5bc96cab6 Bug 1782242 - Remove assert for CanvasManagerChild::Get that we handle gracefully anyways. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D153290
2022-07-30 00:12:36 +00:00
Andreea Pavel 8e59a7d48d Bug 1705410 - disable test_drawWindow_widget_layers.html on linux r=intermittent-reviewers,jmaher DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D153210
2022-07-29 14:00:34 +00:00
Chun-Min Chang edc56a360b Bug 1776796 - Rename MarkAsContentSource r=media-playback-reviewers,alwu
`HTMLMediaElement::MarkAsContentSource` [1] was added in Bug 1299718 to
monitor the visibility / invisibility of various usage of video element.
However, that telemetry had been removed in Bug 1356046.
`MarkAsContentSource` is only used for logging currently. It's better to
reword its name and related comments to bring the code in line with the
current status.

[1] https://searchfox.org/mozilla-central/rev/5b2d2863bd315f232a3f769f76e0eb16cdca7cb0/dom/html/HTMLMediaElement.h#799

Differential Revision: https://phabricator.services.mozilla.com/D150434
2022-07-27 00:20:45 +00:00
Lee Salzman c78dca6613 Bug 1779681 - Mark WebGL framebuffer as initially valid in DrawTargetWebgl. r=aosmond,gfx-reviewers
mWebglValid gets initialized to false, but it will never get reset to true until the next
frame, causing us to render into Skia the first frame rather than accelerate. Therefor, we
should just initialize it to valid. Since it is cleared to zero initially, this is safe.

Differential Revision: https://phabricator.services.mozilla.com/D151896
2022-07-26 13:41:32 +00:00
Norisz Fay 33900387eb Backed out changeset 4b19d16c4fec (bug 1779681) for causing reftest failures on radialGradient-basic-03.svg CLOSED TREE 2022-07-26 09:59:13 +03:00
Norisz Fay 3acd52cdf0 Backed out changeset ad83f5251083 (bug 1780042) for causing wpt failures on nsICanvasRenderingContextInternal.cpp 2022-07-26 09:58:19 +03:00
Andrew Osmond 15caf02999 Bug 1780042 - Set CanvasPattern principal for main thread OffscreenCanvas. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152710
2022-07-26 02:00:57 +00:00