Commit Graph

42715 Commits

Author SHA1 Message Date
Lee Salzman
162987b5a3 Bug 1759715 - Avoid using layers with D2D blend effect. r=aosmond
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
2022-03-31 08:58:39 +00:00
Emilio Cobos Álvarez
7e23a4287f Bug 1760836 - Support printing to an nsIOutputStream. r=jfkthame,jrmuizel,webdriver-reviewers,geckoview-reviewers,agi
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
2022-03-30 18:51:58 +00:00
Ryan VanderMeulen
3bbd35fed4 Bug 1762183 - Cherry-pick some upstream HarfBuzz fixes to address recent regressions. r=jfkthame
Fixes:
https://github.com/harfbuzz/harfbuzz/issues/3512
https://github.com/harfbuzz/harfbuzz/issues/3513

Differential Revision: https://phabricator.services.mozilla.com/D142454
2022-03-30 13:15:24 +00:00
Glenn Watson
3ee9f1d69a Bug 1761460 - Fix local space clip rects on snapped surfaces with reflections r=gfx-reviewers,nical
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
2022-03-30 08:42:56 +00:00
Jens Stutte
03343af68c Bug 1761961: Check CanSend() before Send__delete__ to PCompositorBridge. r=bhood
Differential Revision: https://phabricator.services.mozilla.com/D142332
2022-03-30 07:11:04 +00:00
Iulian Moraru
1d32d9291b Backed out changeset 4d020158e79f (bug 1207753) for causing xpcshell jobs to fail with Task aborted - max run time exceeded error. CLOSED TREE 2022-03-30 03:01:43 +03:00
Lee Salzman
914e4af30a Bug 1761437 - Ensure the shared font namespace is allocated by the client. r=gw
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
2022-03-29 20:46:36 +00:00
Iulian Moraru
7a3ed2ce2a Backed out changeset d42d7505c9cf (bug 1760836) for causing mochitest failures on browser_print_stream.js. CLOSED TREE 2022-03-29 23:32:39 +03:00
Randell Jesup
ec276f7582 Bug 1207753: Add thread-safety annotations to CompositorBridgeParent r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D142083
2022-03-29 18:16:08 +00:00
Jonathan Kew
60b0b30676 Bug 1761965 - Accelerate InitializeCodepointsWithNoFonts() by only constructing the bitset incrementally once, then copying it to the other array entries. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D142336
2022-03-29 17:59:57 +00:00
Emilio Cobos Álvarez
b0fb172236 Bug 1760836 - Support printing to an nsIOutputStream. r=jfkthame,jrmuizel,webdriver-reviewers,geckoview-reviewers,agi
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
2022-03-29 17:50:58 +00:00
sotaro
f0edec0bb1 Bug 1761906 - Call DCSurfaceVideo::PresentVideo() only when it is necessary r=gfx-reviewers,jrmuizel
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
2022-03-29 14:12:45 +00:00
Nicolas Silva
e19ab0c7a2 Bug 1761770 - Dont make non-uniformly scaled items active. r=jrmuizel
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
2022-03-29 13:34:28 +00:00
Nicolas Silva
ee545aca41 Bug 1761770 - Adjust item activity decisions. r=jrmuizel
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
2022-03-29 13:34:28 +00:00
Nicolas Silva
5810368294 Bug 1761744 - Better tag frames coming from the async image pipeline manager. r=gfx-reviewers,aosmond
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
2022-03-29 09:30:56 +00:00
Nicolas Silva
84b0ae8f89 Bug 1761744 - Tag frames caused by the start of observe vsync. r=gfx-reviewers,aosmond
Also tag frames from FlushGenerateFrames.

Depends on D142232

Differential Revision: https://phabricator.services.mozilla.com/D142233
2022-03-29 09:30:55 +00:00
Nicolas Silva
7b8485e486 Bug 1761744 - Tag frames coming from skipped composites. r=gfx-reviewers,aosmond
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
2022-03-29 09:30:55 +00:00
Botond Ballo
5e29e2eee3 Bug 1755490 - Increase POLYGON_CLIP_VERTEX_MAX from 16 to 32. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D142260
2022-03-29 03:12:32 +00:00
sotaro
a85bae612a Bug 1760724 - Let video overlay ride the trains to release on intel GPU on Windows r=gfx-reviewers,lsalzman
pref gfx.webrender.dcomp-video-overlay-win-force-enabled was added to enable video overlay even when it is blocked.

Differential Revision: https://phabricator.services.mozilla.com/D141712
2022-03-29 02:47:18 +00:00
Botond Ballo
644d1c7d9d Bug 1761872 - Remove APZSampler::GetGeckoFixedLayerMargins(). r=hiro
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
2022-03-29 00:33:18 +00:00
Daniel Holbert
88e7f564ee Bug 1761804: Remove checks for NS_COORD_IS_FLOAT, and its associated VERIFY_COORD() function. r=jrmuizel
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
2022-03-28 22:20:59 +00:00
Andrew Osmond
dfd75c103a Bug 1761832 - Protect GLLibraryEGL singleton against race conditions. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D142257
2022-03-28 21:16:58 +00:00
David Shin
093b63fe3c Bug 1755770 - Ensure TextRenderedRun::GetRunUserSpaceRect casts float to int without invoking Undefined Behavior r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D142223
2022-03-28 21:07:58 +00:00
Marian-Vasile Laza
6080eee972 Backed out changeset 6a067384b1c0 (bug 1751693) for causing wr bustages on Cargo.toml. CLOSED TREE 2022-03-28 00:44:57 -07:00
Bas Schouten
3f4629d024 Bug 1751693: Add telemetry probe to measure glyph rasterization time and the required plumbing for WR. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D140681
2022-03-28 07:21:14 +00:00
Lee Salzman
d9a80ab175 Bug 1761685 - Check for negative step in blendTextureNearestRepeat. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D142175
2022-03-28 01:47:58 +00:00
Hiroyuki Ikezoe
90fe3bc201 Bug 1760222 - Test cases for Ignore unchanged property value for scroll-linked effect detector. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141458
2022-03-27 23:40:25 +00:00
Hiroyuki Ikezoe
6b7b8b0942 Bug 1760222 - Detect scroll-linked effects only in the same refresh driver's timestamp. r=botond
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
2022-03-27 23:40:24 +00:00
Timothy Nikkel
a87e2f808f Bug 1761239. Use an EnumSet for nsIScrollableFrame::IsScrollAnimating. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141960
2022-03-26 02:22:57 +00:00
Glenn Watson
7da10101cb Bug 1761299 - Fix raster spatial node indices being out of sync r=gfx-reviewers,nical
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
2022-03-25 10:27:38 +00:00
Kelsey Gilbert
5362a1dd62 Bug 1449575 - Don't attempt ColorMask elision in WebGL. r=gfx-reviewers,aosmond
* Always use DoColorMask(u32?, u8) in webgl code.
* Handle OES_draw_buffers_indexed ColorMaski in GLBlitHelper.

Differential Revision: https://phabricator.services.mozilla.com/D141543
2022-03-24 19:39:06 +00:00
Jonathan Kew
6bbbf58763 Bug 1756468 - Add locking to gfxFont, to allow worker threads to do text shaping. r=lsalzman
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
2022-03-24 18:58:00 +00:00
alwu
68dd7e07df Bug 1759033 - no longer start or shutdown MediaFoundation explictly, and ensure the media foundation's life cycle long enough. r=bryce
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
2022-03-24 18:56:16 +00:00
Brad Werth
66f5f1c938 Bug 1751217 Part 2: Change nsDeviceContext::GetDepth to eliminate the outparam. r=emilio
This function always succeeds so there's no reason to maintain an nsresult.

Differential Revision: https://phabricator.services.mozilla.com/D141407
2022-03-24 18:19:49 +00:00
Jonathan Kew
40a7b7fbbd Bug 1759988 - Ensure InitializeCodepointsWithNoFonts() is always called during font-list initialization. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D141953
2022-03-24 14:23:34 +00:00
Cristian Tuns
f0ccbd470c Backed out 4 changesets (bug 1760222) for causing reftest failures on disable-apz-for-sle-pages.html CLOSED TREE
Backed out changeset 1bf5e1ca3746 (bug 1760222)
Backed out changeset aff6bf37365d (bug 1760222)
Backed out changeset e9b3e3f52aec (bug 1760222)
Backed out changeset f65d2d719277 (bug 1760222)
2022-03-24 02:36:42 -04:00
Lee Salzman
e1069f8d9b Bug 1759891 - Ensure shared font keys have a unique namespace per WebRender instance. r=gw,gfx-reviewers
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
2022-03-24 03:14:35 +00:00
Butkovits Atila
beeff2d22e Backed out changeset 8da43c1bdd49 (bug 1759891) causing Webrender busatges. CLOSED TREE 2022-03-24 05:06:15 +02:00
Lee Salzman
e034aaf71b Bug 1759891 - Ensure shared font keys have a unique namespace per WebRender instance. r=gw,gfx-reviewers
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
2022-03-24 02:42:59 +00:00
Hiroyuki Ikezoe
f22d3daeb2 Bug 1760222 - Test cases for Ignore unchanged property value for scroll-linked effect detector. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141458
2022-03-24 02:20:47 +00:00
Hiroyuki Ikezoe
dfe4a7e735 Bug 1760222 - Detect scroll-linked effects only in the same refresh driver's timestamp. r=botond
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
2022-03-24 02:20:46 +00:00
Butkovits Atila
131dd31758 Backed out changeset f26f836c1575 (bug 1756468) for causing leakes. CLOSED TREE 2022-03-24 03:28:12 +02:00
sotaro
a75b92ee74 Bug 1760618 - Call NotifyChildCreated() after WebRenderBridgeParent::UpdateWebRender() in CompositorBridgeParent::RecvAdoptChild() r=gfx-reviewers,aosmond
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
2022-03-24 00:18:33 +00:00
Timothy Nikkel
c2e46664d6 Bug 1695598. Add test. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D107043
2022-03-23 23:58:24 +00:00
Jonathan Kew
5a3bb65719 Bug 1756468 - Add locking to gfxFont, to allow worker threads to do text shaping. r=lsalzman
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
2022-03-23 23:17:34 +00:00
Ryan VanderMeulen
d18a71361f Bug 1757738 - Update HarfBuzz to 4.1.0. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D140064
2022-03-23 20:13:18 +00:00
Butkovits Atila
fbd6ad4819 Backed out 5 changesets (bug 1751217) for causing failures at dynamic-range.html. CLOSED TREE
Backed out changeset f0a4879c9709 (bug 1751217)
Backed out changeset 50b6310935d4 (bug 1751217)
Backed out changeset bfa455b8bb1a (bug 1751217)
Backed out changeset 277064a1facb (bug 1751217)
Backed out changeset 21e1650b12db (bug 1751217)
2022-03-23 22:22:54 +02:00
Andrew Osmond
3df496f168 Bug 1760887 - Expose FEATURE_VP8_HW_DECODE and FEATURE_VP9_HW_DECODE to the downloadable blocklist. r=gfx-reviewers,jnicol,media-playback-reviewers,alwu
This patch also exposes it as a gfxVar for cross process/thread-safe access.

Differential Revision: https://phabricator.services.mozilla.com/D141803
2022-03-23 19:28:57 +00:00
Brad Werth
09e7757ba7 Bug 1751217 Part 2: Change nsDeviceContext::GetDepth to eliminate the outparam. r=emilio
This function always succeeds so there's no reason to maintain an nsresult.

Differential Revision: https://phabricator.services.mozilla.com/D141407
2022-03-23 18:23:01 +00:00
Emilio Cobos Álvarez
79f3fe026d Bug 1759962 - Don't return the DPI override in devicePixelRatio to privileged code. r=nchevobbe,webdriver-reviewers
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
2022-03-23 17:03:04 +00:00