Commit graph

70 commits

Author SHA1 Message Date
Andrew Osmond
0329c1aaba Bug 1850871 - Resize canvas in ImageBitmapRenderingContext::TransferFromImageBitmap. r=gfx-reviewers,lsalzman
This patch makes it so that when a new ImageBitmap is provided to an
ImageBitmapRenderingContext, we resize its owning canvas rather than
crop or scale the given ImageBitmap to fit inside the canvas dimensions.

See discussion in https://github.com/whatwg/html/issues/7833.

Differential Revision: https://phabricator.services.mozilla.com/D188126
2023-10-16 11:23:43 +00:00
Tom Ritter
073f56f67a Bug 1852541: Do not randomize the canvas if it is one uniform pattern r=timhuang,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D188133
2023-10-11 14:56:45 +00:00
Cristian Tuns
5293640c25 Backed out 3 changesets (bug 1852541) for causing build bustages in nsRFPService.cpp CLOSED TREE
Backed out changeset 21d022246ce0 (bug 1852541)
Backed out changeset 4e369c26c1f6 (bug 1852541)
Backed out changeset 8832d7e6c0dc (bug 1852541)
2023-10-10 12:07:55 -04:00
Tom Ritter
511c8ac27c Bug 1852541: Do not randomize the canvas if it is one uniform pattern r=timhuang,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D188133
2023-10-10 15:03:52 +00:00
Iulian Moraru
cb0d7ccce8 Backed out 2 changesets (bug 1852541) for causing build bustages + bc failures. CLOSED TREE
Backed out changeset 7f516f079dd4 (bug 1852541)
Backed out changeset 9dea05c869be (bug 1852541)
2023-09-26 02:27:15 +03:00
Tom Ritter
ab0d4828fa Bug 1852541: Do not randomize the canvas if it is one uniform pattern r=timhuang,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D188133
2023-09-25 21:22:39 +00:00
Cosmin Sabou
f9be6e64d4 Backed out 2 changesets (bug 1852541) for causing build bustages on nsRFPService.cpp. CLOSED TREE
Backed out changeset dbb5ce808936 (bug 1852541)
Backed out changeset 6dff3776d3d5 (bug 1852541)
2023-09-25 21:37:30 +03:00
Tom Ritter
a77109e532 Bug 1852541: Do not randomize the canvas if it is one uniform pattern r=timhuang,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D188133
2023-09-25 18:06:13 +00:00
Tim Huang
05d8e8c08e Bug 1833213 - Clone the image data if canvas randomization is enabled in CanvasRenderingContext2D::GetImageDataArray(). r=tjr,lsalzman
When introducing the random noises to the image data in
CanvasRenderingContext2D::GetImageDataArray would also alter the actual
image buffer. This will change the random noises every time we call the
function because the random noises is generated according to the image
data. This is undesirable and the random noises should remain the
same in the browsing session with the same canvas.

To fix this issue, we clone the actual image data if canvas randomization is
enabled and introduce noises to the cloned data, which doesn't change
the actual image buffer. So, the random nosies will remain consistent in
a single browser session.

We also fix some minor issues in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D178327
2023-05-17 21:43:48 +00:00
Tim Huang
07cbc511d5 Bug 1816189 - Part 4: Add random noise when extracting data from canvas element when canvas randomization is enabled. r=tjr,lsalzman
This patch introduces random noises to data extraction functions of
canvas element and offscreen canvas. The random noise is based on the
random key of the cookieJarSettings and the image data itself.

The random noises would interfere the ability of fingerprinters that
use canvas data to fingerprint users. The random noise will make unique
canvas finerprint to for every browsing session. Therefore, fingerprinter
cannot use canvas fingerprint to tracker individuals across browsing
sessions.

Differential Revision: https://phabricator.services.mozilla.com/D175499
2023-05-08 14:04:35 +00:00
Kelsey Gilbert
eaf3360db2 Bug 1812932 - Add size outvar to GetImageBuffer. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D171764
2023-03-21 18:05:09 +00:00
Cristina Horotan
34c1361f96 Backed out changeset 7657d29cd872 (bug 1812932) for causing bc failures at browser_view_image.js CLOSED TREE 2023-03-07 09:26:40 +02:00
Kelsey Gilbert
0f88607820 Bug 1812932 - Add size outvar to GetImageBuffer. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D171764
2023-03-07 04:52:04 +00:00
Angus Sawyer
a585e302b1 Bug 1795506 Throw from transferFromImageBitmap when bitmap is detached, r=smaug
Thow expected error when attempting to use bitmap that has been detached with an imageBitmapRenderingContext.

Differential Revision: https://phabricator.services.mozilla.com/D166552
2023-01-26 10:17:03 +00:00
Butkovits Atila
cfb5b51ba3 Backed out changeset b3389fd511a0 (bug 1795506) for causing failures complaining about transferFromImageBitmap. CLOSED TREE 2023-01-23 18:30:42 +02:00
Angus Sawyer
ebb3edc329 Bug 1795506 Throw from transferFromImageBitmap when bitmap is detached, r=smaug
Thow expected error when attempting to use bitmap that has been detached with an imageBitmapRenderingContext.

Differential Revision: https://phabricator.services.mozilla.com/D166552
2023-01-23 15:42:38 +00:00
Kelsey Gilbert
4e7b4b5647 Bug 1794956 - TransferToImageBitmap should reset bitmap but not state. r=gfx-reviewers,lsalzman
s/Reset/ResetBitmap/ and implement for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D159346
2022-10-16 22:52:40 +00:00
Iulian Moraru
b3fd738eb1 Backed out 2 changesets (bug 1794956) for causing wpt failures on offscreencanvas.transfer.to.imagebitmap.html. CLOSED TREE
Backed out changeset 7b3067b086e6 (bug 1794956)
Backed out changeset 3abcf6ccf88a (bug 1794956)
2022-10-15 19:09:01 +03:00
Kelsey Gilbert
4253cbe5b3 Bug 1794956 - TransferToImageBitmap should reset bitmap but not state. r=gfx-reviewers,lsalzman
s/Reset/ResetBitmap/ and implement for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D159346
2022-10-15 09:01:46 +00:00
Kelsey Gilbert
61dc37049b Bug 1795193 - Remove unused chrome-only API MozGetIPCContext. r=gfx-reviewers,jrmuizel,emilio
And also remove SetIsIPC.

Differential Revision: https://phabricator.services.mozilla.com/D159351
2022-10-14 18:02:28 +00:00
Andrew Osmond
02150a3b67 Bug 1759527 - Ensure ImageBitmapRenderingContext checks for null surfaces. r=gfx-reviewers,jnicol
This could happen when the content process cannot access the underlying
surface directly for example.

Differential Revision: https://phabricator.services.mozilla.com/D141098
2022-03-15 12:41:02 +00:00
Andreas Pehrson
077549e08e 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
Lee Salzman
4d3a112bae Bug 1748438 - Check for null surface in ImageBitmapRenderingContext::GetImageBuffer. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D135253
2022-01-06 21:12:57 +00:00
Andrew Osmond
859ab18a73 Bug 1603339 - Add canvas attribute to ImageBitmapRenderingContext. r=lsalzman,emilio
Differential Revision: https://phabricator.services.mozilla.com/D133807
2021-12-15 21:36:20 +00:00
Andrew Osmond
a8a2e4152a Bug 1746059 - Fix broken ImageBitmapRenderingContext::TransferFromImageBitmap for OffscreenCanvas. r=lsalzman,emilio
This patch ensures that when we call TransferFromImageBitmap, it
actually gets the correct result and resets the context to all black,
instead of just crashing. We now also clear the ImageContainer properly
instead of adding a null image if none is provided.

Differential Revision: https://phabricator.services.mozilla.com/D133806
2021-12-15 21:36:20 +00:00
Andrew Osmond
8298ac607c Bug 1736177 - Part 6. Refactor WebRender display list building integration. r=kvark,jgilbert
This patch separates out new helper methods that are shared with the
OffscreenCanvas display integration in a later part in this series.
It also standardizes on SupportsWeakPtr/WeakPtr instead of mixing in C++
standard library versions.

Differential Revision: https://phabricator.services.mozilla.com/D130782
2021-12-10 02:57:53 +00:00
Csoregi Natalia
1c7cae16d7 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
01bdbad6ac Bug 1736177 - Part 6. Refactor WebRender display list building integration. r=kvark,jgilbert
This patch separates out new helper methods that are shared with the
OffscreenCanvas display integration in a later part in this series.
It also standardizes on SupportsWeakPtr/WeakPtr instead of mixing in C++
standard library versions.

Differential Revision: https://phabricator.services.mozilla.com/D130782
2021-12-09 19:25:26 +00:00
Andrew Osmond
3a98545701 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
d7a06601a0 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
472ab1dfc3 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
e5f5e8d032 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
4219d92daf 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
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
Andi-Bogdan Postelnicu
e872071d08 Bug 1671599 - Make dom/canvas buildable outside of unified-build environment. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D93753
2020-10-20 13:14:51 +00:00
sotaro
68439d9c26 Bug 1598998 - Fix CanvasContextType::ImageBitmap handling r=nical
Differential Revision: https://phabricator.services.mozilla.com/D56348

--HG--
extra : moz-landing-system : lando
2020-01-08 01:12:50 +00:00
Mihai Alexandru Michis
c8ca91e7db Backed out changeset 67142a370d4a (bug 1598998) for causing failures in ImageBitmapRenderingContext.cpp
CLOSED TREE

--HG--
extra : histedit_source : 1e4895b3c8773f7881b99f1ab0fca9c6b64b7644
2020-01-07 01:49:59 +02:00
sotaro
374fa2d1ea Bug 1598998 - Fix CanvasContextType::ImageBitmap handling r=nical
Differential Revision: https://phabricator.services.mozilla.com/D56348

--HG--
extra : moz-landing-system : lando
2020-01-06 10:14:15 +00:00
sotaro
0c611d19d9 Bug 1599653 - Support CanvasContextType::ImageBitmap with WebRender r=nical
Differential Revision: https://phabricator.services.mozilla.com/D54890

--HG--
extra : moz-landing-system : lando
2019-11-28 16:50:43 +00:00
sotaro
b6214da9fc Bug 1599696 - Fix ImageBitmapRenderingContext::IsContextCleanForFrameCapture() r=nical
Implementation borrows from CanvasRenderingContext2D::mIsCapturedFrameInvalid.

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

--HG--
extra : moz-landing-system : lando
2019-11-28 16:51:23 +00:00
Nathan Froyd
ebdc4b2408 Bug 1542344 - fix API mismatches in ImageEncoder; r=mccr8
ImageEncoder::ExtractDataInternal takes a `const nsAString&` for its
options, but flattens it into a null-terminated `nsString` so callees
can take a `char16_t*`.  But nearly all of those callees eventually wind
up calling ImageEncoder::GetInputStream, which just constructs an
`nsDependentString` from the passed character pointer.

There's no reason to do all this extra work.  We can just pass the
original options reference all the way through the stack and avoid
needless conversions.

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

--HG--
extra : moz-landing-system : lando
2019-04-08 01:51:17 +00:00
Andrea Marchesini
9e0663f555 Bug 1526218 - transferFromImageBitmap() should propage the origin-clean state to the canvas element, r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D19371

--HG--
extra : moz-landing-system : lando
2019-02-11 16:54:05 +00:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Markus Stange
90d2624508 Bug 1219985 - The canvas rendering context 2d should be opaque if either the moz-opaque attribute is set or if it has been initialized with alpha:false. r=jrmuizel
If the canvas is cleared by setting the width or height attributes, its
opaqueness should not be affected.

This patch keeps support for moz-opaque, and also keeps the behavior that
changing the moz-opaque attribute clears the canvas, even if this does not
affect the actual opaqueness of the canvas.

MozReview-Commit-ID: LOlsJxiP9kc

--HG--
extra : rebase_source : 8bb95b1d5932c39a8085e007f9fd1b88b97afe55
2018-05-02 11:23:53 -04:00
Sylvestre Ledru
fa45a3c670 Bug 1443080 - Use the static call for static methods (not instance) r=Ehsan
MozReview-Commit-ID: JwHh4bzxuTR

--HG--
extra : rebase_source : 5f5e37517aa80c2e7b5933962178d761074886e7
2018-03-16 14:29:15 +01:00
Coroiu Cristina
0f6841e0d2 Backed out 2 changesets (bug 1443080) for spidermonkey build bustage at build/src/js/src/jit/BaselineCacheIRCompiler.cpp
Backed out changeset 7d509bb8a35d (bug 1443080)
Backed out changeset 53bdcd5937cd (bug 1443080)

--HG--
extra : rebase_source : 59b5350d2959c0b065aedd34bfe8337216c0ea4b
2018-03-14 11:13:21 +02:00