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

188 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 25c0d10932 Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Peter Van der Beken 627ac90e0c Bug 1690111 - Use new TypedArray APIs for processing data. r=farre,media-playback-reviewers,padenot,chunmin,sfink
Depends on D152497

Differential Revision: https://phabricator.services.mozilla.com/D152498
2023-09-20 09:42:02 +00:00
Andrew Osmond 005b2d48b6 Bug 1852420 - Ensure surface and crop rect used in ImageBitmap are valid. r=gfx-reviewers,lsalzman
When ImageBitmap::PrepareForDrawTarget is called, we must ensure
that the surface returned is acceptable to the given DrawTarget. If
it is not, then we need to recreate the surface from mData. We must
also ensure similar when we are creating a new ImageBitmap from
another ImageBitmap, as we don't know in what context it may be
used.

Similarly, we need to ensure we produce DataSourceSurface compatible
surfaces when we need to both crop and premultiply.

Additionally, we now no longer clear mPictureRect or mAlphaType
when we set mSurface with the cached, cropped data. Since we may
need to clear the cached surface, we need to know the original crop
rect and alpha.

Differential Revision: https://phabricator.services.mozilla.com/D188056
2023-09-13 12:05:25 +00:00
Cosmin Sabou 680b4364c7 Backed out 13 changesets (bug 1690111) for causing fetch related crashes.
Backed out changeset 5f2c25d194ad (bug 1690111)
Backed out changeset 76c408bcd053 (bug 1690111)
Backed out changeset 6d0649fdafff (bug 1690111)
Backed out changeset c1330b5e8c43 (bug 1690111)
Backed out changeset 5fa36d8fd2a5 (bug 1690111)
Backed out changeset daf7d747853a (bug 1690111)
Backed out changeset f70e09a7f5c6 (bug 1690111)
Backed out changeset 40c6d6eed7f8 (bug 1690111)
Backed out changeset 692f2a759573 (bug 1690111)
Backed out changeset 7140866dd9f6 (bug 1690111)
Backed out changeset 2865fe682139 (bug 1690111)
Backed out changeset 9dcd2416f8a5 (bug 1690111)
Backed out changeset 9c411bf84079 (bug 1690111)
2023-09-11 17:55:24 +03:00
Peter Van der Beken 5738c01ba3 Bug 1690111 - Use new TypedArray APIs for processing data. r=farre,media-playback-reviewers,padenot,chunmin,sfink
Depends on D152497

Differential Revision: https://phabricator.services.mozilla.com/D152498
2023-09-11 12:52:20 +00:00
Timothy Nikkel 29dee56fcb Bug 1849704. Don't create a new ImageBitmapShutdownObserver if we are in XPCOMShutdown or later. r=gfx-reviewers,aosmond
XPCOMShutdownThreads is the phase just after XPCOMShutdown and XPCOMShutdown is when we destory the ImageBitmapShutdownObserver, so we need to not create a new ImageBitmapShutdownObserver if we are in XPCOMShutdown or later.

Differential Revision: https://phabricator.services.mozilla.com/D186852
2023-08-25 19:10:10 +00:00
Andrew Osmond c0bed56904 Bug 1645555 - Ensure we return surfaces with the proper size with canvas and ImageBitmap. r=gfx-reviewers,lsalzman
In general the canvas size and the surface size should match. However if
we are in the process of updating an OffscreenCanvas's size, it is
possible we may return a surface with a different size if an ImageBitmap
is created, or we draw using, the placeholder HTMLCanvasElement. In that
case we should ensure the surface we yield is the same size as the
current intrinsic size of the HTMLCanvasElement.

Differential Revision: https://phabricator.services.mozilla.com/D186376
2023-08-16 21:01:34 +00:00
Timothy Nikkel 5361e039c9 Bug 1845372. Don't create a (useless) shutdown observer for ImageBitmaps if we've already passed the main shutdown notification phase. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D184905
2023-08-01 01:31:31 +00:00
Timothy Nikkel 0ab04eb795 Bug 1839286. Use one shutdown observer for all ImageBitmaps. r=gfx-reviewers,lsalzman
Use on shutdown observer and manager a hashtable of all imagebitmaps. Observers are managed using an array, which is slow for large numbers of observers.

Differential Revision: https://phabricator.services.mozilla.com/D181432
2023-07-19 06:15:22 +00:00
Andrew Osmond e8d3205ad7 Bug 1781527 - Part 3. Implement support for surfaces requiring scaling/crop rects with canvas. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D182208
2023-07-10 00:26:47 +00:00
Andrew Osmond a975416b44 Bug 1781527 - Part 2. Implement means to use VideoFrame with ImageBitmap and CanvasRenderingContext2D. r=chunmin,webidl,gfx-reviewers,smaug,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150679
2023-07-10 00:26:47 +00:00
Cristian Tuns 982856d479 Backed out 4 changesets (bug 1781527) for causing Assertion failures in ImageBitmap.cpp CLOSED TREE
Backed out changeset d3ca9e70625b (bug 1781527)
Backed out changeset f6c56b5e6450 (bug 1781527)
Backed out changeset 34d140bc5b99 (bug 1781527)
Backed out changeset f7a2f2b89ba8 (bug 1781527)
2023-07-09 18:53:20 -04:00
Andrew Osmond 8d5b297ee9 Bug 1781527 - Part 3. Implement support for surfaces requiring scaling/crop rects with canvas. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D182208
2023-07-09 21:03:46 +00:00
Andrew Osmond caa1f6d751 Bug 1781527 - Part 2. Implement means to use VideoFrame with ImageBitmap and CanvasRenderingContext2D. r=chunmin,webidl,gfx-reviewers,smaug,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150679
2023-07-09 21:03:46 +00:00
Noemi Erli bce5e01de5 Backed out changeset ec7fc33e6ad4 (bug 1839286) for causing multiple failures 2023-06-20 13:10:09 +03:00
Timothy Nikkel ea79ebc114 Bug 1839286. Use one shutdown observer for all ImageBitmaps. r=gfx-reviewers,lsalzman
Use on shutdown observer and manager a hashtable of all imagebitmaps. Observers are managed using an array, which is slow for large numbers of observers.

Differential Revision: https://phabricator.services.mozilla.com/D181432
2023-06-20 08:35:18 +00:00
Angus Sawyer 843eab98fc Bug 1785635 Add flag to enforce from-image orientation for createImageBitmap r=emilio
New flag added to nsLayoutUtils to ensure any exif specified orientation
is applied to surfaces obtained from HTMLImage elements irrespective of the
presence of the element in the DOM. For use in createImageBitmap where from-image is
the required behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D168356
2023-01-31 16:04:17 +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
Andrew Osmond 2b5b6c5a20 Bug 1777411 - Improve error messages when cloning ImageBitmap. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150697
2022-06-30 13:36:34 +00:00
Timothy Nikkel 4a902a6a3e Bug 1768593. Allow createImageBitmap to work on img elements whose src is an svg with no specified size of resizeWidth/Height is specified. r=lsalzman
Just need to pass the resizeWidth/Height down into SurfaceFromElement for html image elements so we can ask for a frame of the right size from the image.

We have to annotate the new test that I add as failing, just like all of the existing tests, because we don't yet support the resizeQuality option, so we fail that part of the test and pass all of the rest of it. The part that we are fixing here passes.

Differential Revision: https://phabricator.services.mozilla.com/D147739
2022-06-02 03:31:43 +00:00
Angus Sawyer dad7ed1e23 Bug 1756803 scaling/premultiply alpha of ImageData r=aosmond
Two issues:

The result of scaling & premultiply is order critical, the previous order for ImageData was scale > premultiply, the other image sources were premultiplied by default so didn't expose this issue. Reorder in the ImageData and common code paths (the original order followed the w3c spec order of operations - maybe the spec needs amending).

The ImageData path did not set the premultiplied flag of the resulting ImageBitmap correctly so the image would be premultiplied again in PrepareForDrawTarget.

Differential Revision: https://phabricator.services.mozilla.com/D139700
2022-03-18 16:47:26 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Andrew Osmond 4129412779 Bug 1755792 - Handle surface unavailable cases in ImageBitmap. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D139369
2022-02-22 14:36:30 +00:00
Angus Sawyer 2916707472 Bug 1733559 - createImageBitmap() resizeWidth and resizeHeight support, r=aosmond,emilio
Also fixed negative cropping width/height for blob images.
Removes two unused class variables.

Differential Revision: https://phabricator.services.mozilla.com/D127250
2022-01-20 15:38:01 +00:00
Angus Sawyer 1cde8538a5 Bug 1748868 - support createImageBitmap colorSpaceConversion option, r=aosmond,emilio
Differential Revision: https://phabricator.services.mozilla.com/D135888
2022-01-15 15:14:32 +00:00
Andrew Osmond f918a60e22 Bug 1746093 - Allow OffscreenCanvas as an input for CanvasImageSource and ImageBitmapSource. r=lsalzman,emilio
As per the spec, we should allow one to create ImageBitmaps, and call
CanvasRenderingContext2D's drawImage and createPattern using an
OffscreenCanvas.

Differential Revision: https://phabricator.services.mozilla.com/D133808
2021-12-15 21:36:21 +00:00
aardgoose d413fc1976 Bug 1687658 - Recursive createImageBitmap ignores source cropping r=aosmond
Note: if the original imageBitmap has been use for display, the source surface will have been cropped and
the original cropping IntRect has been lost, in this case use cropped mSurface instead of mdata.

If some of the new clip rect falls outside the source we have to crop the source if it hasn't been cropped.

Q: Should I attempt to get tests for this added to WPT?

Differential Revision: https://phabricator.services.mozilla.com/D124607
2021-12-08 03:47:56 +00:00
Lee Salzman 0d1599dff4 Bug 1743851 - Ensure cropped ImageBitmap preserves surface format. r=gfx-reviewers,bradwerth
When an ImageBitmap needed to be cropped to prepare itself for a DT, it would
accidentally convert to the DT's format, which could cause issues if the DT
was opaque while the source surface was an alpha format.

Differential Revision: https://phabricator.services.mozilla.com/D132912
2021-12-06 18:05:07 +00:00
Lee Salzman 2fa8b582b1 Bug 1739454 - Don't overwrite the ImageBitmap's surface in PrepareForDrawTarget. r=emilio
ImageBitmap::PrepareForDrawTarget overwrites its surface's contents when premultiplying the
data. This code pattern seems to stem all the way back to bug 1239752. It doesn't seem like
we have much control over where this surface comes from, and we have no strong guarantees
that this surface isn't shared by multiple consumers. As such, overwriting the data could
result in another consumer getting premultiplied data in the surface that it didn't expect.
We should just always be cloning the surface first before premultiplying unless we can
otherwise prove the surface isn't shared.

* * *
Bug 1739454 - Remove reftest-wait in reftest. r?emilio

Differential Revision: https://phabricator.services.mozilla.com/D131583
2021-11-19 18:46:46 +00:00
Alexandru Michis e95d8cf175 Backed out 3 changesets (bug 1739454) for causing crashtest failures in 1739454-1.html
CLOSED TREE

Backed out changeset 3accfa522abb (bug 1739454)
Backed out changeset 18fdb7a13e63 (bug 1739454)
Backed out changeset 1de7d723923a (bug 1739454)
2021-11-19 19:33:53 +02:00
Lee Salzman 6978d1ffea Bug 1739454 - Don't overwrite the ImageBitmap's surface in PrepareForDrawTarget. r=emilio
ImageBitmap::PrepareForDrawTarget overwrites its surface's contents when premultiplying the
data. This code pattern seems to stem all the way back to bug 1239752. It doesn't seem like
we have much control over where this surface comes from, and we have no strong guarantees
that this surface isn't shared by multiple consumers. As such, overwriting the data could
result in another consumer getting premultiplied data in the surface that it didn't expect.
We should just always be cloning the surface first before premultiplying unless we can
otherwise prove the surface isn't shared.

Differential Revision: https://phabricator.services.mozilla.com/D131583
2021-11-19 16:22:09 +00:00
aardgoose d035f76673 Bug 1740031 - throw exception if croping/copying operation fails r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D130796
2021-11-19 13:24:06 +00:00
aardgoose 8a2e1cbcc6 Bug 1367251 - add bindings for options to createImageBitmap and support flipY r=bzbarsky,aosmond,baku
implementation of imageOrientation: none|flipY.
implementation of premultiplyAlpha: none|premultiply|default.

Differential Revision: https://phabricator.services.mozilla.com/D29562
2021-09-02 00:29:29 +00:00
Emilio Cobos Álvarez acf7359936 Bug 1717381 - Deal with Uint8ClampedArray::Init failure in canvas code. r=smaug
See bug 1716641 comment 4 for a way this can happen.

I don't know what the best way to add a test for this is / whether it's
worth adding one?

Differential Revision: https://phabricator.services.mozilla.com/D118307
2021-06-21 10:00:26 +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
Sylvestre Ledru 912aeb9ab5 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D102084
2021-01-18 16:50:16 +00:00
Steve Fink 613e55711f Bug 1682068 - Fix rooting hazard in ImageBitmap::CreateInternal by avoiding movable data r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D100428
2021-01-13 22:17:51 +00:00
Mihai Alexandru Michis bf411e8d30 Backed out 2 changesets (bug 1684123, bug 1682068) for causing bustages.
CLOSED TREE

Backed out changeset e6df68a131a3 (bug 1682068)
Backed out changeset 91ad893cc4d4 (bug 1684123)
2021-01-13 20:34:56 +02:00
Steve Fink 67a0878c54 Bug 1682068 - Fix rooting hazard in ImageBitmap::CreateInternal by avoiding movable data r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D100428
2021-01-08 20:14:53 +00:00
Lee Salzman 00c0e09335 Bug 1678909 - mark image bitmap as premult when converted so that we don't repeatedly premultiply it. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100287
2020-12-22 00:13:18 +00:00
Olli Pettay 7577f527cf Bug 1666285, try to avoid slow shrinking GC during sync calls r=sfink,asuth
Differential Revision: https://phabricator.services.mozilla.com/D97783
2020-12-15 10:40:42 +00:00
Emilio Cobos Álvarez f9e0de00c8 Bug 1681418 - Remove unreachable error checking codepaths in ImageBitmap. r=nical
CreateImageFromSurface never returns null.

Depends on D99260

Differential Revision: https://phabricator.services.mozilla.com/D99261
2020-12-10 17:05:51 +00:00
Karl Tomlinson 88c7f3ad66 Bug 1119956 derive from DiscardableRunnable instead of CancelableRunnable when Cancel() is not supported r=asuth,sg
Differential Revision: https://phabricator.services.mozilla.com/D98118
2020-12-03 09:04:44 +00:00
Simon Giesecke 6fac745ea4 Bug 1673931 - Remove dependency of BindingUtils.h on Document.h.
Differential Revision: https://phabricator.services.mozilla.com/D95048

Depends on D95047
2020-11-23 16:08:03 +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
Sylvestre Ledru fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00