Extract MaybeRandomizePixels() from GetImageBuffer() into a shared helper on
OffscreenCanvasDisplayHelper so it can be called from ExtractDataInternal when
the canvas has been transferred. The aOffscreenDisplay branch now uses
GetSurfaceSnapshot() + SurfaceToPackedBGRA() + MaybeRandomizePixels() +
GetInputStream(), consistent with the existing pipeline.
Also add the missing EfficientCanvasRandomization check to
ImageExtractionResult(OffscreenCanvas*).
Differential Revision: https://phabricator.services.mozilla.com/D291261
This reverts commit 2c05a82f05.
Revert "Bug 2022615: Add a test that ensures a transferred Offscreen Canvas gets randomized r=timhuang"
This reverts commit 6a5ffb2523.
Revert "Bug 2022615: Fix canvas randomization for HTMLCanvasElement with transferControlToOffscreen() r=tnikkel"
This reverts commit 7b20ac5232.
Revert "Bug 2022615: Use extractionBehavior in GetInputStream/GetImageBuffer r=timhuang"
This reverts commit dcc03ca752.
Revert "Bug 2022615: Add mochitest for HTMLCanvasElement readback after transferControlToOffscreen r=tnikkel"
This reverts commit d66396c53a.
Extract MaybeRandomizePixels() from GetImageBuffer() into a shared helper on
OffscreenCanvasDisplayHelper so it can be called from ExtractDataInternal when
the canvas has been transferred. The aOffscreenDisplay branch now uses
GetSurfaceSnapshot() + SurfaceToPackedBGRA() + MaybeRandomizePixels() +
GetInputStream(), consistent with the existing pipeline.
Also add the missing EfficientCanvasRandomization check to
ImageExtractionResult(OffscreenCanvas*).
Differential Revision: https://phabricator.services.mozilla.com/D291261
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
Image Encoders will be able to make use of a metadata
(aka randomization) key that will influence the resulting output
image.
This patch just adds that variable into all the API surfaces it
will need to be in to be accessible at the correct layer where
we will use it.
Differential Revision: https://phabricator.services.mozilla.com/D267097
This reverts commit d4cf73ac94.
Revert "Bug 1980264: Test Infra Fixes r=timhuang"
This reverts commit 992c24e4cf.
Revert "Bug 1980264: Implement a streaming randomization approach for PNG images r=tnikkel"
This reverts commit 5910c78f61.
Revert "Bug 1980264: Wire up an alternate efficient randomization layer r=timhuang"
This reverts commit a8a220b58a.
Revert "Bug 1980264: Plumb metatadata down to the Image Encoders r=tnikkel"
This reverts commit 3487904284.
Revert "Bug 1980264: Rename a variable to be more generic r=timhuang"
This reverts commit b6b02cefea.
Revert "Bug 1980264: Clang Formatting and a missing Permission Check r=timhuang"
This reverts commit f3c68965b8.
Image Encoders will be able to make use of a metadata
(aka randomization) key that will influence the resulting output
image.
This patch just adds that variable into all the API surfaces it
will need to be in to be accessible at the correct layer where
we will use it.
Differential Revision: https://phabricator.services.mozilla.com/D267097
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.
Differential Revision: https://phabricator.services.mozilla.com/D256800
Initially, the YCbCrUtils and yuv_convert APIs asserted success
internally. With recent changes, those assertions were removed. This
patch reintroduces those assertions on the caller's side instead, except
the `ConvertToRGBA` in ImageConversion.cpp.
Differential Revision: https://phabricator.services.mozilla.com/D216191
Canvas uses CSS pixels, so this patch encodes the information into the type
system. Some painting code still uses unknown sizes, so we need to use
`CSSIntSize::FromUnknownSize` and `ToUnknownSize()` to convert them.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D216463
This method always returned GetMainThreadSerialEventTarget(). This patch
switches all callers over to use that method instead.
We can't easily switch all calls to be calls to NS_GetMainThread(), as there is
no version of that method returning a bare nsIThread* instance.
I didn't introduce one, as we may want to add a lock around mMainThread in the
future, which would require removing nsThreadManager::GetMainThreadWeak. As
this method only returns nsISerialEventTarget, it method could remain
implemented, however, by returning a statically allocated fake event target
which forwards dispatches (and QIs to nsIThread) to the real main thread.
Differential Revision: https://phabricator.services.mozilla.com/D166608
This only changes the behaviour when called with a TaskQueue or other type
using SerialEventTargetGuard on the stack. They are being switched over as the
existing GetCurrentEventTarget method is being removed, as it is somewhat
confusing, and poorly documented.
Callers which need to get the current thread even when on a threadpool or
behind a TaskQueue were switched to GetCurrentEventTarget in the previous part.
Differential Revision: https://phabricator.services.mozilla.com/D166607
This method always returned GetMainThreadSerialEventTarget(). This patch
switches all callers over to use that method instead.
We can't easily switch all calls to be calls to NS_GetMainThread(), as there is
no version of that method returning a bare nsIThread* instance.
I didn't introduce one, as we may want to add a lock around mMainThread in the
future, which would require removing nsThreadManager::GetMainThreadWeak. As
this method only returns nsISerialEventTarget, it method could remain
implemented, however, by returning a statically allocated fake event target
which forwards dispatches (and QIs to nsIThread) to the real main thread.
Differential Revision: https://phabricator.services.mozilla.com/D166608
This only changes the behaviour when called with a TaskQueue or other type
using SerialEventTargetGuard on the stack. They are being switched over as the
existing GetCurrentEventTarget method is being removed, as it is somewhat
confusing, and poorly documented.
Callers which need to get the current thread even when on a threadpool or
behind a TaskQueue were switched to GetCurrentEventTarget in the previous part.
Differential Revision: https://phabricator.services.mozilla.com/D166607
Instead, use NS_ReleaseOnMainThread. This requires exactly the same number of
special-cases, but let me know if you instead want a separate
MainThreadSurfaceRef which implements RefPtrTraits and releases on the main
thread or something...
Depends on D90398
Differential Revision: https://phabricator.services.mozilla.com/D90399
Before P1, GetCurrentThreadSerialEventTarget would have always returned the same data as NS_GetCurrentThread, making the comment incorrect Now it will properly return the running TaskQueue if any.
This change of name more clearly exposes what they are doing, as we aren't always dealing with threads directly; but a nsISerialEventTarget
Differential Revision: https://phabricator.services.mozilla.com/D80354
* 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
* 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
* 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