It seems as if any attempt to use PushLayer with the Blend effect causes alpha
to be incorrectly blended. Using FillGeometry explicitly with the clip geometry
and D2D1_PRIMITIVE_BLEND_COPY seems to work around this.
Differential Revision: https://phabricator.services.mozilla.com/D142501
The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.
The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.
Differential Revision: https://phabricator.services.mozilla.com/D142199
In these cases the combined local clip rect may be in reflected
local space. Map them to true raster space and then unmap them
back to the new local space to correct this.
Differential Revision: https://phabricator.services.mozilla.com/D142430
The shared font namespace was getting allocated by the RenderBackend, while
we otherwise allocated namespaces for documents on the client. We need to make
sure that if namespace allocation happens on the client, that it also happens
on the client for the shared font namespace. This adds to RendererOptions to
make passing in a shared font namespace allocated by the client possible.
Differential Revision: https://phabricator.services.mozilla.com/D142381
The trickiest bits are the PrintTargetCG ones, the rest is just plumbing
and cleanups and tests, but let me know if you want those to be split
out, can do.
The GTK change to nsPrintSettingsGTK::GetResolution is a no-op (we only
read resolution on windows), but I did that because we assume that it
doesn't fail and GTK returns a sane default anyways.
Differential Revision: https://phabricator.services.mozilla.com/D142199
DCSurfaceVideo::PresentVideo() needs to be called only when RenderTextureHost, swapChainSize or VideoSwapChain are updated.
Since bug 1667303 fix, DCSurfaceVideo::PresentVideo() is called even when it is not necessary.
Differential Revision: https://phabricator.services.mozilla.com/D142315
WebRender's AA doesn't look good with non-uniform scales, so we want to avoid exposing more content to it for now.
Depends on D142213
Differential Revision: https://phabricator.services.mozilla.com/D142214
Instead of reasoning about whether items should be active with a yes/no granularity, we consider whether it could/should be and have some logic to weight that against the risk of causing extra layerization when making containers active.
For example a small image *could* be made active, but we might not make it so if it causes extra layerization in cases where larger images would have been made active.
Differential Revision: https://phabricator.services.mozilla.com/D142213
We schedule additional composites as long as there is a CompositeUntil timestamp. These composites need a special tag and shouldn't carry the tags of whatever led us to check the timestamps. In addition, we should add the ASYNC_IMAGE tag when GetAndResetWillGenerateFrame returns true even if some other reason led us to check it.
Depends on D142233
Differential Revision: https://phabricator.services.mozilla.com/D142234
Also differentiate between skipped composites (too many pending frames) and discarded composites (paused or no display list).
Differential Revision: https://phabricator.services.mozilla.com/D142232
APZCTreeManager::GetGeckoFixedLayerMargins() is also removed,
but the field mGeckoFixedLayerMargins is kept as it's used internally
in WebRender codepaths.
Differential Revision: https://phabricator.services.mozilla.com/D142292
This patch just assumes NS_COORD_IS_FLOAT is undefined (which in practice it
always is), and deletes dead code accordingly.
It's unlikely we'll migrate nscoord to float anytime soon, so this code isn't
serving much of a purpose at this point. If we do someday make that migration,
the code that this macro is guarding would only represent a small step in that
migration, anyway; and at that point we can start by adding back the code that
this patch is removing.
In the meantime, it's not worth keeping this complexity and the untested/dead
code in the tree.
Differential Revision: https://phabricator.services.mozilla.com/D142246
With this change, `has-scroll-linked-effect` flag won't persist so that we can
avoid choosing either the one-frame delayed scroll offset or the latest scroll
offset in cases where there's no longer effective scroll linked effect. It will
mitigate scroll jittering.
Differential Revision: https://phabricator.services.mozilla.com/D141457
When the max surface size is exceeded, the raster spatial node
for a given surface is adjusted in `get_surface_rects`. However
a locally cached variable of the old raster spatial node index
was being used as a parameter when creating the render task.
Instead, only retrieve the raster spatial node after the call to
`get_surface_rects`, ensuring that it gets the updated value.
Also add support to wrench reftests to set the maximum surface
size, so that we can exercise this code path in reftests.
Differential Revision: https://phabricator.services.mozilla.com/D142015
We protect the shaped-word cache in each font with a RWLock, so that multiple threads can
shape in parallel using cached data; only when a new entry needs to be cached will we need
to take a write lock.
(To improve clarity, this patch also constifys a bunch of methods that do not mutate the
font instance.)
Differential Revision: https://phabricator.services.mozilla.com/D141473
According to [1], `MFShutdown` will shutdown the media foundation for every other call of `MFStartup`, which means it's possible to shutdown the media foundation even if other components are still using that.
Therefore, we should consider make the media foundation alive when the first time any component wants to use it, and shutdown it when the whole process destroys.
We already did similar thing on the RDD process [2] so it makes sense to do it as well on other places. Especially considering we will move the MFT decoder into the RDD process in the future, we definitely don't want an encoder incorrectly shutdown the media foundation the decoder is using.
Also, it saves time to call `MFStartup` if the media foundation is already started.
[1] https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mfshutdown
[2] https://searchfox.org/mozilla-central/rev/eeeba8183d3268e0d563c2becf9f4adc21a37368/dom/media/ipc/RDDParent.cpp#111,303,315
Differential Revision: https://phabricator.services.mozilla.com/D140757
The blob font tables in Moz2DImageRenderer are currently shared across all WebRender instances.
So if different blob fonts from different WebRender instances happen to share the same font keys,
in particular the same namespace, the font keys can thus accidentally collide and blob fonts can
end up getting shared across WebRender instances unintentionally.
To guard against this, we need to ensure that SharedFontResources is provided with a unique
namespace for the WebRender instance in which to allocate shared font keys so that collisions
can no longer occur.
Differential Revision: https://phabricator.services.mozilla.com/D141929
The blob font tables in Moz2DImageRenderer are currently shared across all WebRender instances.
So if different blob fonts from different WebRender instances happen to share the same font keys,
in particular the same namespace, the font keys can thus accidentally collide and blob fonts can
end up getting shared across WebRender instances unintentionally.
To guard against this, we need to ensure that SharedFontResources is provided with a unique
namespace for the WebRender instance in which to allocate shared font keys so that collisions
can no longer occur.
Differential Revision: https://phabricator.services.mozilla.com/D141929
With this change, `has-scroll-linked-effect` flag won't persist so that we can
avoid choosing either the one-frame delayed scroll offset or the latest scroll
offset in cases where there's no longer effective scroll linked effect. It will
mitigate scroll jittering.
Differential Revision: https://phabricator.services.mozilla.com/D141457
In CompositorBridgeParent::RecvAdoptChild(), NotifyChildCreated() is called before WebRenderBridgeParent::UpdateWebRender(). The NotifyChildCreated() updates sIndirectLayerTrees[child].mParent. It affects to WebRenderBridgeParent::GetRootCompositorBridgeParent().
In the UpdateWebRender(), WebRenderBridgeParent::ClearAnimationResources() is called. But in ClearAnimationResources(), OMTASampler is got from new CompositorBridgeParent. In this case, OMTASampler needs to be got from old CompositorBridgeParent.
Differential Revision: https://phabricator.services.mozilla.com/D141819
We protect the shaped-word cache in each font with a RWLock, so that multiple threads can
shape in parallel using cached data; only when a new entry needs to be cached will we need
to take a write lock.
(To improve clarity, this patch also constifys a bunch of methods that do not mutate the
font instance.)
Differential Revision: https://phabricator.services.mozilla.com/D141473
Chrome code should be able to rely on CSS pixel * devicePixelRatio =
device pixel.
Chrome code that cares about the override should use
BrowsingContext.overrideDPPX. We were exposing the no-override value in
WindowUtils but that's unneeded now.
Differential Revision: https://phabricator.services.mozilla.com/D141323