Commit Graph

126 Commits

Author SHA1 Message Date
Kagami Sascha Rosylight
ca80f84bf8 Bug 1767996 - Apply readability-make-member-function-const on dom/html r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D145627
2022-05-13 05:35:25 +00:00
Kagami Sascha Rosylight
eee4ffde66 Bug 1619574 - Remove HTMLCanvasElement::MozGetAsFile r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D144815
2022-04-27 16:13:14 +00:00
Andrew Osmond
bd22f89c38 Bug 1753302 - Part 1. Integrate WebGPU with OffscreenCanvas plumbing. r=gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D141491
2022-04-04 16:42:02 +00:00
Andrew Osmond
db4b4fdeb9 Bug 1760907 - Avoid mutex contention on display list updates for OffscreenCanvas. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D141811
2022-03-23 11:50:12 +00:00
Andrew Osmond
b0a072c0f1 Bug 1755698 - Ensure we destroy HTMLCanvasElement's members during cycle collection unlinking. r=gfx-reviewers,lsalzman
OffscreenCanvasDisplayHelper may call back into HTMLCanvasElement after
it has been unlinked and violate our assumption that
HTMLCanvasElement::InvalidateCanvasPlaceholder is only called when we
have an OffscreenCanvas member. This patch makes it so that we clear the
relevant references during unlinking so that we don't make this mistake.

Differential Revision: https://phabricator.services.mozilla.com/D139380
2022-02-23 00:20:01 +00:00
Andrew Osmond
4370e54b02 Bug 1756186 - Fix Canvas2D CreatePattern and DrawImage with no context OffscreenCanvas. r=lsalzman
This patch ensures we return an empty surface as per the spec when
the OffscreenCanvas passed into CreatePattern and DrawImage has no
context bound to it.

Differential Revision: https://phabricator.services.mozilla.com/D139127
2022-02-22 21:16:16 +00:00
Andreas Pehrson
ec80ba2a6f Bug 1752351 - Do not rely on a timer for canvas.captureStream's TimerDriver. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D137158
2022-02-02 22:30:33 +00:00
Csoregi Natalia
d4ba52a78b Backed out 7 changesets (bug 1752351) for failures on test_capture_throttled.html. CLOSED TREE
Backed out changeset 7d6d47f9429b (bug 1752351)
Backed out changeset 8f75bab2ab54 (bug 1752351)
Backed out changeset 0c171c3b5e27 (bug 1752351)
Backed out changeset 1694bfb744ee (bug 1752351)
Backed out changeset 801268f30e94 (bug 1752351)
Backed out changeset 861e5267cafc (bug 1752351)
Backed out changeset 34237ea4f82f (bug 1752351)
2022-02-02 22:15:04 +02:00
Andreas Pehrson
52b5cc3aa7 Bug 1752351 - Do not rely on a timer for canvas.captureStream's TimerDriver. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D137158
2022-02-02 18:47:57 +00:00
Andrew Osmond
9cb33c7532 Bug 1751205 - Part 2. Ensure we y-flip surfaces with OffscreenCanvas if needed. r=gfx-reviewers,jgilbert
On the path that we need to read the pixels from the canvas for display
purposes, instead of using a platform buffer handle, we need to take
into account the need to y-flip for WebGL. This patch ensures that we do
so.

Differential Revision: https://phabricator.services.mozilla.com/D136504
2022-02-01 13:20:50 +00:00
Norisz Fay
187a2bb9ef Backed out 2 changesets (bug 1751205) for causing multiple wpt failures on offscreencanvas.resize.html CLOSED TREE
Backed out changeset 70e5f13d08cc (bug 1751205)
Backed out changeset e97271d90795 (bug 1751205)
2022-01-28 09:14:15 +02:00
Andrew Osmond
f3161d747f Bug 1751205 - Part 2. Ensure we y-flip surfaces with OffscreenCanvas if needed. r=gfx-reviewers,jgilbert
On the path that we need to read the pixels from the canvas for display
purposes, instead of using a platform buffer handle, we need to take
into account the need to y-flip for WebGL. This patch ensures that we do
so.

Differential Revision: https://phabricator.services.mozilla.com/D136504
2022-01-28 05:16:02 +00:00
Andreas Pehrson
f2fcf5de40 Bug 1344524 - Change ContextCleanForFrameCapture flag to a Watchable FrameCaptureState. r=jgilbert
This allows the canvas element to be notified when a draw that would trigger
a captureStream-frame to be captured.

Differential Revision: https://phabricator.services.mozilla.com/D136003
2022-01-24 15:31:14 +00:00
Kagami Sascha Rosylight
d30aa95f80 Bug 1748874 - Part 1: Mark the decl of HTMLCanvasElement::CallPrintCallback as CAN_RUN_SCRIPT r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D135400
2022-01-11 11:52:26 +00:00
Andrew Osmond
fb14462521 Bug 1747476 - Fix resizing errors with OffscreenCanvas. r=gfx-reviewers,kvark,mstange
When we attempt to resize an OffscreenCanvas, or an HTMLCanvasElement
with transferControlToOffscreen caled on it, we need to ensure we throw
the right error, and a message that is clear to the user. We also need
to propogate size changes to the placeholder
HTMLCanvasElement/OffscreenCanvas, when the OffscreenCanvas object on
the worker thread has its size changed.

Differential Revision: https://phabricator.services.mozilla.com/D134637
2021-12-28 16:47:02 +00:00
Andrew Osmond
51d7cf43a9 Bug 1736177 - Part 11. Plumb in OffscreenCanvasDisplayHelper. r=jgilbert
This patch integrates OffscreenCanvasDisplayHelper with
HTMLCanvasElement, OffscreenCanvas and nsDisplayCanvas to allow
asynchronous display of an OffscreenCanvas.

Differential Revision: https://phabricator.services.mozilla.com/D130787
2021-12-10 02:57:55 +00:00
Andrew Osmond
61e3f99b3d Bug 1736177 - Part 8. Remove unused visibility observer from HTMLCanvasElement. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D130784
2021-12-10 02:57:54 +00:00
Andrew Osmond
86d592cb56 Bug 1736177 - Part 1. Rename CanvasRenderingContextHelper::GetContext to GetOrCreateContext. r=jgilbert
This patch contains no functional changes but sets us up for refactoring
in a later part in this series. It also helps silence a bunch of
compiler warnings.

Differential Revision: https://phabricator.services.mozilla.com/D130777
2021-12-10 02:57:51 +00:00
Csoregi Natalia
77f4c3192d Backed out 17 changesets (bug 1738971, bug 1736177) for bp-hybrid failures and others. CLOSED TREE
Backed out changeset 828633114de2 (bug 1736177)
Backed out changeset 5be8557c4721 (bug 1736177)
Backed out changeset 49f8b4205a46 (bug 1736177)
Backed out changeset 2610d4464ad5 (bug 1736177)
Backed out changeset 6d6c78c31c28 (bug 1736177)
Backed out changeset d55f1ee88bb9 (bug 1736177)
Backed out changeset bf588f8ffcf1 (bug 1736177)
Backed out changeset 86f6f6d86c6c (bug 1736177)
Backed out changeset f400c75c5829 (bug 1736177)
Backed out changeset 4a34124d5f4e (bug 1736177)
Backed out changeset 70aff7fcd001 (bug 1736177)
Backed out changeset db2347ee8147 (bug 1736177)
Backed out changeset 3dde5ddb65e5 (bug 1738971)
Backed out changeset 894ba6b7b68f (bug 1738971)
Backed out changeset dc4503052cf1 (bug 1738971)
Backed out changeset d9aef3e9797e (bug 1738971)
Backed out changeset 562a1e8e5ac3 (bug 1738971)
2021-12-10 01:13:23 +02:00
Andrew Osmond
c2d0f104c6 Bug 1736177 - Part 11. Plumb in OffscreenCanvasDisplayHelper. r=jgilbert
This patch integrates OffscreenCanvasDisplayHelper with
HTMLCanvasElement, OffscreenCanvas and nsDisplayCanvas to allow
asynchronous display of an OffscreenCanvas.

Differential Revision: https://phabricator.services.mozilla.com/D130787
2021-12-09 19:25:28 +00:00
Andrew Osmond
6816862f1e Bug 1736177 - Part 8. Remove unused visibility observer from HTMLCanvasElement. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D130784
2021-12-09 19:25:27 +00:00
Andrew Osmond
32ec981831 Bug 1736177 - Part 1. Rename CanvasRenderingContextHelper::GetContext to GetOrCreateContext. r=jgilbert
This patch contains no functional changes but sets us up for refactoring
in a later part in this series. It also helps silence a bunch of
compiler warnings.

Differential Revision: https://phabricator.services.mozilla.com/D130777
2021-12-09 19:25:24 +00:00
Andrew Osmond
53bce6dc87 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-18 11:44:51 +00:00
Iulian Moraru
5ec6e27b91 Backed out changeset 089962073382 (bug 1728903) for causing Bp-hybrid bustages on ImageBitmapRenderingContext.cpp. CLOSED TREE 2021-09-03 18:49:32 +03:00
Andrew Osmond
6a5f7ab2d3 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-03 12:52:05 +00:00
Noemi Erli
6fcdaed88b Backed out changeset f12c6a6cd1a5 (bug 1728903) for causing build bustage in TestTextures.cpp CLOSED TREE 2021-09-03 05:16:59 +03:00
Andrew Osmond
a5a30fa776 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-03 01:48:17 +00:00
Matt Woodrow
09cee2c09b Bug 1724839 - Don't use BasicLayerManager for painting ImageBitmap <canvas> elements. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D122171
2021-08-10 03:38:40 +00:00
Miko Mynttinen
8df6649834 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-19 11:28:20 +00:00
Alexandru Michis
9b9c5fe24e Backed out 2 changesets (bug 1720804) for causing bustages.
CLOSED TREE

Backed out changeset 5278e88c6d34 (bug 1720804)
Backed out changeset 1acb4ed79b6b (bug 1720804)
2021-07-16 18:10:11 +03:00
Miko Mynttinen
397ffc88e1 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-16 14:36:34 +00:00
Emilio Cobos Álvarez
6ddc96e2db Bug 1700640 - Map width and height to aspect-ratio in <canvas>, <input type=image>, and <video>. r=boris
As per https://html.spec.whatwg.org/#attributes-for-embedded-content-and-images:

> The width and height attributes map to the aspect-ratio property on
> img, canvas, and video elements, and input elements with a type
> attribute in the Image Button state.

See https://github.com/whatwg/html/issues/6527 for the parsing issue
with canvas and zero. For now allow both behaviors in the tests.

We also remove the width-and-height-map-to-aspect-ratio pref, as it is
true everywhere and has been for a while.

Differential Revision: https://phabricator.services.mozilla.com/D109618
2021-03-24 22:18:55 +00:00
Simon Giesecke
aa6ab49743 Bug 1673931 - Avoid including BindingDeclarations.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D97612
2021-03-04 14:32:14 +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
Kartikaya Gupta
0b466c2600 Bug 1665955 - Stop including nsIScrollableFrame.h from Element.h. r=emilio
Changes to nsIScrollableFrame.h cause the world to rebuild which I find annoying.
This removes the inclusion into Element.h which is responsible for the
world-rebuilding and is relatively easy to eliminate. A bunch of usages of
nsIScrollableFrame get moved from .h files into .cpp files and I include the
header into .cpp files as needed.

Differential Revision: https://phabricator.services.mozilla.com/D90735
2020-09-18 18:32:13 +00:00
Emilio Cobos Álvarez
d55f820460 Bug 1662456 - Remove HTMLCanvasElement::CountContexts and related code. r=nical
Canvas only has one context, and that assumption is pretty baked into
the code, so having an API that pretends otherwise is silly.

Differential Revision: https://phabricator.services.mozilla.com/D88990
2020-09-02 14:20:50 +00:00
Emilio Cobos Álvarez
47634b1c9e Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Jeff Gilbert
76b360ac16 Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-15 18:25:55 +00:00
Dorel Luca
64b1646aa1 Backed out 7 changesets (bug 1632249) for Gtest perma chrash in [@ mozilla::BlockingResourceBase::CheckAcquire()]. CLOSED TREE
Backed out changeset 4ff99aab3ee8 (bug 1632249)
Backed out changeset d5b7fe789001 (bug 1632249)
Backed out changeset 64fbb616a0f3 (bug 1632249)
Backed out changeset 6f19f43e0a0b (bug 1632249)
Backed out changeset 073302d26c5e (bug 1632249)
Backed out changeset 7c94d37c446e (bug 1632249)
Backed out changeset 204b899f436d (bug 1632249)
2020-06-11 19:44:20 +03:00
Jeff Gilbert
3aaf9ac591 Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-11 06:37:35 +00:00
Mihai Alexandru Michis
e083b100cf Backed out 6 changesets (bug 1632249) for causing bustages in CanvasRenderingContext2D.cpp
CLOSED TREE

Backed out changeset c93972b05d4f (bug 1632249)
Backed out changeset 04f5127c85d5 (bug 1632249)
Backed out changeset b15d91e64a25 (bug 1632249)
Backed out changeset 71ad2ed8e9ba (bug 1632249)
Backed out changeset 6e9a89ead3a5 (bug 1632249)
Backed out changeset dd00e2da3a0f (bug 1632249)
2020-06-11 02:43:35 +03:00
Jeff Gilbert
8cb4edc9fb Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-10 22:21:02 +00:00
Dorel Luca
71e5f22bb8 Backed out 4 changesets (bug 1632249) for Build bustages and mda failures. CLOSED TREE
Backed out changeset cdaa8a4e9e36 (bug 1632249)
Backed out changeset 9ff26bcc580c (bug 1632249)
Backed out changeset 16d84439756f (bug 1632249)
Backed out changeset bbfe23c61add (bug 1632249)
2020-06-09 03:19:48 +03:00
Jeff Gilbert
e37269cf62 Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-08 20:34:15 +00:00
Dzmitry Malyshau
0b87411823 Bug 1630072 - WebGPU CanvasContext invalidation r=jgilbert,aosmond
This change enables light tracking of the commands and submissions
that affect a CanvasContext. Upon reaching the GPUQueue, they send
a signal for the parent HTML Element to be invalidated.
We are also invalidating the HTML Element and requesting a new
frame to be built on the creation of the swapchain.

Differential Revision: https://phabricator.services.mozilla.com/D71194
2020-04-20 23:50:04 +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