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

168 Коммитов

Автор SHA1 Сообщение Дата
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
Butkovits Atila 964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru 5f29324f60 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 08:29:00 +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
Botond Ballo e6c29de3e7 Bug 1667594 - Move nsLayoutUtils::SurfaceFromElementResult to its own file. r=emilio
Along with a dependent struct DirectDrawInfo.

This allows nsImageRenderer.h and CanvasRenderingContext2D.h to
avoid including nsLayoutUtils.h.

For nsImageRenderer.h in particular, a forward declaration is
not sufficient as nsImageRenderer stores SurfaceFromElementResult
by value.

A couple of method definitions elsewhere are moved out of line
to keep things compiling without including nsLayoutUtils.h in
additional headers.

Differential Revision: https://phabricator.services.mozilla.com/D91684
2020-09-30 21:05:34 +00:00
Matt Woodrow 820348e12f Bug 1653409 - Set ImageBitmap's picture rect using the picture rect of layers::Image, not the size. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D85356
2020-08-04 01:18:44 +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 b01831ccc4 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
2020-07-15 11:03:51 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Dzmitry Malyshau 3021defc28 Bug 1602133 - WebGPU presentation r=jgilbert,webidl,smaug,aosmond
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

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

--HG--
extra : moz-landing-system : lando
2020-04-06 22:29:18 +00:00
Cosmin Sabou 2f4d9af7d3 Backed out changeset bc6b2b003c6e (bug 1602133) for causing build bustages on CanvasRenderingContextHelper.cpp.
--HG--
extra : histedit_source : 917f3627a3e3f8dab0d806b69fc716bfd9f1d483
2020-04-06 23:46:51 +03:00
Dzmitry Malyshau 5004affc0e Bug 1602133 - WebGPU presentation r=jgilbert,webidl,smaug,aosmond
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

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

--HG--
extra : moz-landing-system : lando
2020-04-06 20:10:03 +00:00
Bogdan Tara 7f7cc68c64 Backed out changeset 377a757c583d (bug 1602133) for webgpu related bustages CLOSED TREE 2020-04-06 21:59:57 +03:00
Dzmitry Malyshau 4c3a924336 Bug 1602133 - WebGPU presentation r=jgilbert,webidl,smaug,aosmond
This change adds support for CanvasContext presenting WebGPU via CPU readback.
The presentation is handled mostly on GPU process side by managing a list of staging buffers
and copying the contents into a WR external image (backed by an external buffer).

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

--HG--
extra : moz-landing-system : lando
2020-04-02 19:55:01 +00:00
Boris Zbarsky c878a8bb26 Bug 1619112 part 2. Pass char literals instead of char16_t literals into ErrorResult throwing methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65538

--HG--
extra : moz-landing-system : lando
2020-03-06 21:04:58 +00:00
Simon Giesecke 723b05dfb6 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/canvas. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D63142

--HG--
extra : moz-landing-system : lando
2020-02-18 21:08:00 +00:00
Jeff Gilbert cc0f990650 Bug 1615851 - layer::Image::GetAsSourceSurface is fallible. r=lsalzman
This fixes a crash, where we expected it to be infallible.

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

--HG--
extra : moz-landing-system : lando
2020-02-16 04:07:20 +00:00
Boris Zbarsky 6c66fa85a4 Bug 1615022 part 2. Require an rvalue reference to reject a Promise with an ErrorResult. r=farre,kvark
The rejection process consumes the ErrorResult, so an rvalue reference is the honest thing here.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 15:42:30 +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
Doug Thayer 86601b48c5 Bug 1602646 - Remove vestigial references to cooperative scheduling r=froydnj
GetCurrentPhysicalThread and GetCurrentVirtualThread are, in practice,
identical, as the TLS override that GetCurrentVirtualThread depends on
is never actually set. This simply removes that and renames some things/
deletes some comments.

Rebased across https://hg.mozilla.org/mozilla-central/rev/3f0b4e206853
by Karl Tomlinson <karlt+@karlt.net>.

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

--HG--
extra : moz-landing-system : lando
2019-12-12 00:56:53 +00:00
Andrea Marchesini 1888d35204 Bug 1593860 - Correct error reporting when createImageBitmap() fails, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D52654

--HG--
extra : moz-landing-system : lando
2019-11-12 17:08:17 +00:00