Commit Graph

164 Commits

Author SHA1 Message Date
Butkovits Atila
01197944a0 Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
fe15f2115d 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
53d15de5c7 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
8c124e4008 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
c1ec1dd8c0 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
26a21a9723 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
13c1674214 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
5c54ad5bb8 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
a4a8855aa9 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
730827aad0 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
fdda4b08e5 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
ed45bd6443 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
e0960f8710 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
7f88046de7 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
2f81b2cb7c 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
ddcb9eb4bc 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
7f3ccfbb05 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
1c07e0bee6 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
f451e7d825 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
97d00cc4ac 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
f3cada8e5f 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
42ab499774 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
7afb800388 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
a9f246233d 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
46908cfb51 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
68b806d604 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
a6e7dcc53f Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru
8f709b39e8 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
1074cb3575 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
7c3f28b3c1 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
416232ee9c 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
ef1c4daeff 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
5f5aa3ed65 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
a69d79b6db 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
da83703f59 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
2020-04-06 22:29:18 +00:00
Cosmin Sabou
9def97fd40 Backed out changeset bc6b2b003c6e (bug 1602133) for causing build bustages on CanvasRenderingContextHelper.cpp. 2020-04-06 23:46:51 +03:00
Dzmitry Malyshau
deb2867b31 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
2020-04-06 20:10:03 +00:00
Bogdan Tara
1cfabed655 Backed out changeset 377a757c583d (bug 1602133) for webgpu related bustages CLOSED TREE 2020-04-06 21:59:57 +03:00
Dzmitry Malyshau
4a5833e82b 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
2020-04-02 19:55:01 +00:00
Boris Zbarsky
e62a6fc4d1 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
2020-03-06 21:04:58 +00:00
Simon Giesecke
e138819a70 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/canvas. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D63142
2020-02-18 21:08:00 +00:00
Jeff Gilbert
42b2cac699 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
2020-02-16 04:07:20 +00:00
Boris Zbarsky
35bc278e5f 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
2020-02-14 15:42:30 +00:00
Edgar Chen
ac8c576f36 bug 1610296 - Rename TypedArray_base::ComputeLengthAndData to TypedArray_base::ComputeState; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D60514
2020-01-23 03:22:06 +00:00
Doug Thayer
9f70804193 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
2019-12-12 00:56:53 +00:00
Andrea Marchesini
67a10dba6b Bug 1593860 - Correct error reporting when createImageBitmap() fails, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D52654
2019-11-12 17:08:17 +00:00
Brindusan Cristian
dc5f656d75 Backed out changeset 41c6b7e917fd (bug 1367251) for mochitest failures at test_conformance__textures__image_bitmap_from_blob__tex-2d-luminance-luminance-unsigned_byte.html. CLOSED TREE 2019-10-07 04:46:13 +03:00
aardgoose
61cc1c9044 Bug 1367251 - add bindings for options to createImageBitmap and support flipY r=bzbarsky,aosmond
implementation of imageOrientation: none|flipY.

Differential Revision: https://phabricator.services.mozilla.com/D29562
2019-10-04 15:20:53 +00:00
Andrew Osmond
f42921f736 Bug 1583238 - Check if ImageBitmap was closed in WriteStructuredClone. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D47259
2019-09-26 15:02:27 +00:00
Mihai Alexandru Michis
e72165184d Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE
Backed out changeset cb739de6606d (bug 1510226)
Backed out changeset b6f670610dc3 (bug 1510226)
2019-09-25 04:25:07 +03:00