Commit Graph

37523 Commits

Author SHA1 Message Date
Jean-Yves Avenard
87438519f0 Bug 1637500 - P2. Rename methods as they are not always dealing with "threads". r=froydnj
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
2020-06-23 05:05:36 +00:00
Jean-Yves Avenard
8d2ff29220 Bug 1647133 - P4. Use nsISerialEventTarget where it's actually that. r=mattwoodrow
We are here, always actually dealing with the compositor thread, with the exception of VRDisplayPresentation which is passing  the main thread.

Depends on D80422

Differential Revision: https://phabricator.services.mozilla.com/D80423
2020-06-22 09:38:34 +00:00
Kagami Sascha Rosylight
c2e026792f Bug 1643464 - Part 3: Rename LEFT/RIGHT_BUTTON as PRIMARY/SECONDARY_BUTTON r=masayuki,geckoview-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D80333
2020-06-19 17:50:43 +00:00
Kagami Sascha Rosylight
994a3b64f9 Bug 1643464 - Part 2: Rename eLeft/eRightFlag to ePrimary/eSecondaryFlag r=masayuki,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D80332
2020-06-22 22:54:07 +00:00
Kagami Sascha Rosylight
166f2891a2 Bug 1643464 - Part 1: Rename eLeft/eRight to ePrimary/eSecondary r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D80331
2020-06-19 18:02:41 +00:00
Narcis Beleuzu
1f50773a6e Backed out 8 changesets (bug 1647225) for xpcshell failures on test_gfxBlacklist_Version.js CLOSED TREE
Backed out changeset b6f88195da61 (bug 1647225)
Backed out changeset a5b3f54cb5f2 (bug 1647225)
Backed out changeset 6a1025189b0e (bug 1647225)
Backed out changeset b95de94b444e (bug 1647225)
Backed out changeset ed2c7dfd8373 (bug 1647225)
Backed out changeset 1adc99494bcb (bug 1647225)
Backed out changeset 5d0cf22c335a (bug 1647225)
Backed out changeset 956b43a8636f (bug 1647225)
2020-06-23 04:34:12 +03:00
sotaro
8f5e819367 Bug 1647253 - Remove unused CreateSharedRGBImage() r=jrmuizel
CreateSharedRGBImage() is not used.

Differential Revision: https://phabricator.services.mozilla.com/D80436
2020-06-22 14:24:21 +00:00
Dzmitry Malyshau
74b412c826 Bug 1641370 - Add optional SPIR-V shader validation to WebGPU, via naga r=jgilbert
This change attempts to parse the incoming SPIR-V shader modules with
Naga SPIR-V front-end. It's not complete, but it returns an Error if it's unable to parse,
in which case we just continue without the validation (for now).
If it succeeds, we extract the reflection information from it, and use it for the pipeline.

This is just a start. More states would need to be validated, and SPIR-V front-end needs more work.

Differential Revision: https://phabricator.services.mozilla.com/D77170
2020-06-22 21:21:18 +00:00
Kartikaya Gupta
3be958c0fa Bug 1647225 - Change the string exposed via gfxInfo. r=jrmuizel
This includes things like about:support, gfxCriticalNote, probably telemetry
environment stuff.

Depends on D80450

Differential Revision: https://phabricator.services.mozilla.com/D80451
2020-06-22 14:04:56 +00:00
Kartikaya Gupta
347a55ff38 Bug 1647225 - Change some failure IDs and strings. r=jrmuizel
Depends on D80449

Differential Revision: https://phabricator.services.mozilla.com/D80450
2020-06-22 14:06:18 +00:00
Kartikaya Gupta
015478ec51 Bug 1647225 - Fix some comments. r=jrmuizel,geckoview-reviewers,agi
Depends on D80448

Differential Revision: https://phabricator.services.mozilla.com/D80449
2020-06-22 22:54:00 +00:00
Kartikaya Gupta
793dc7ec5d Bug 1647225 - Consistently use blocklist terminology for gfxFeature. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D80425
2020-06-22 14:04:38 +00:00
Hiroyuki Ikezoe
3f5ea943fb Bug 1618446 - Clear runningOnCompositor flag in the case where WebRenderAnimationData is destroyed. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D80341
2020-06-22 20:46:31 +00:00
Ryan VanderMeulen
b34980f800 Bug 1647303 - Update HarfBuzz to 2.6.8. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D80476
2020-06-22 15:44:53 +00:00
tkhan
6ccabd4784 Bug 1602668 - M(1) manifest and test changes. r=kmag,karlt,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70362
2020-06-22 19:09:49 +00:00
Bob Owen
9594760b33 Bug 1644575 part 2: Remove now unused SFNT* files and functions. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D80429
2020-06-22 12:19:56 +00:00
Bob Owen
96bf0011e8 Bug 1644575: Change SFNTData::GetUniqueKey to use a hash of head tables within the font data. r=jfkthame
This is used instead of hashing the first full name.

Differential Revision: https://phabricator.services.mozilla.com/D80412
2020-06-22 12:19:39 +00:00
Noemi Erli
bbe92cb7fa Backed out 7 changesets (bug 1642629) for causing multiple failures and crashes CLOSED TREE
Backed out changeset 325a298e5e11 (bug 1642629)
Backed out changeset 2195069a75c9 (bug 1642629)
Backed out changeset a076f17ed2da (bug 1642629)
Backed out changeset 073fe13cd98b (bug 1642629)
Backed out changeset 88dd02d36e0d (bug 1642629)
Backed out changeset 683b75cdd3c4 (bug 1642629)
Backed out changeset 33d6d6b9097d (bug 1642629)
2020-06-22 15:10:18 +03:00
Emilio Cobos Álvarez
b9b9e38dd9 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-22 09:45:40 +00:00
Nicolas Silva
7036817d6e Bug 1642629 - Recycle FrameVisibilityState's clip_chain_stack and surface_stack. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80193
2020-06-22 08:51:10 +00:00
Nicolas Silva
178669f284 Bug 1642629 - Reserve items in SegmentBuilder before simple loops. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80192
2020-06-22 08:50:50 +00:00
Nicolas Silva
7564409e4a Bug 1642629 - Recycle shared clips allocation in picture.rs. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D80178
2020-06-22 08:50:38 +00:00
Nicolas Silva
de3b9e9e20 Bug 1642629 - Regroup recycled data structures into scratch buffers. r=gw
This change just restructures the recycling added in previouscommits.

Differential Revision: https://phabricator.services.mozilla.com/D80096
2020-06-22 08:54:49 +00:00
Nicolas Silva
65dd685282 Bug 1642629 - Recycle dirty_region_stack in FrameBuilder. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79858
2020-06-22 08:54:49 +00:00
Nicolas Silva
64e4930c6f Bug 1642629 - Recycle a couple of vectors in PictureUpdateState. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79857
2020-06-22 08:49:35 +00:00
Nicolas Silva
ebb2b1e263 Bug 1642629 - Recycle the surface info vector in frame building. r=gw
This vector is usually small, but on some pages it can be fairly large (500+ in https://forum.xda-developers.com/redmi-note-3/development for example).

Differential Revision: https://phabricator.services.mozilla.com/D79855
2020-06-22 08:49:13 +00:00
Martin Stransky
2b91832e28 Bug 1645704 [Wayland] Rename WaylandDMABufSurface to DMABufSurface at gxf, r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D79637
2020-06-21 13:59:17 +00:00
Jamie Nicol
2e61ade1af Bug 1646243 - Guard against null state in UiCompositorControllerParent::Initialize(). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D80205
2020-06-18 16:17:34 +00:00
Markus Stange
4c8b889f5e Bug 1646066 - Make partial valid rects work properly in NativeLayerCA. r=jrmuizel
This moves the clipping responsibility into the layer. It also brings back
assertions that make sure that no invalid content reaches the screen.
On the layer side I'm renaming validRect to displayRect, because at the time
NextSurface* is called, that rect is not yet valid.
This implementation also allows having valid content outside of the display
rect. So, for example, if you grow and shrink the display rect multiple times
but most of the outer parts are transparent, in theory this allows you to paint
the transparent pixels only once rather than every time the display rect
expands.

Differential Revision: https://phabricator.services.mozilla.com/D79842
2020-06-18 22:15:22 +00:00
Kartikaya Gupta
c488788746 Bug 1645937 - Add reftest. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D80055
2020-06-18 12:17:19 +00:00
Daniel Lu
966189d812 Bug 1646172 - Added an event marker to the profiler that shows how many draw calls have been made in a frame. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79912
2020-06-18 22:17:54 +00:00
Jeff Muizelaar
6613f1b6b7 Bug 1646741 - Update gleam to 0.12. r=kvark
For stride calculation and SSBOs

Differential Revision: https://phabricator.services.mozilla.com/D80191
2020-06-18 18:11:13 +00:00
Coroiu Cristina
96536abc93 Backed out changeset 9367aa4b97e2 (bug 1646741) for wrench failures on a CLOSED TREE 2020-06-18 21:03:36 +03:00
Jeff Muizelaar
c326a65a01 Bug 1646741 - Update gleam to 0.12. r=kvark
For stride calculation and SSBOs

Differential Revision: https://phabricator.services.mozilla.com/D80191
2020-06-18 15:02:08 +00:00
Cosmin Sabou
65d75a47f3 Backed out changeset 299e19193e11 (bug 1646224) for causing font related failures. CLOSED TREE 2020-06-18 18:26:51 +03:00
Daniel Lu
ef0d982880 Bug 1646389 - Consolidated profiler markers for the number of picture cache tiles that are invalidated. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D80065
2020-06-18 13:06:49 +00:00
Markus Stange
c5cf53e63b Bug 1642603 - Make TransformAndClipBounds stop discarding the corner positions of empty rectangles. r=kip
Differential Revision: https://phabricator.services.mozilla.com/D79582
2020-06-17 18:54:46 +00:00
Emilio Cobos Álvarez
090e3d2409 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-18 13:55:03 +00:00
Nick Alexander
2a0de542af Bug 1635273 - Make FT_LCD_FILTER_H a relative rather than absolute path. r=froydnj
This helps get sccache hits across source directories.

The previous presentation guaranteed the version of `ftlcdfil.h` in
the tree, while this unorthodox presentation only ensures that the
`freetype2` directory has parent `modules`.  This is at least unlikely
to occur in random `/usr/include` directories.

If this turns out to be an issue it would be possible to copy
`ftlcdfil.h` into the object directory, potentially with a unique
name, and then reference that (with a relative path).

Differential Revision: https://phabricator.services.mozilla.com/D73759
2020-06-18 13:40:40 +00:00
Butkovits Atila
34722d7f3a Backed out 2 changesets (bug 1645937) for gv-junit failures on VerticalClippingTest. CLOSED TREE
Backed out changeset e0f3090a46a4 (bug 1645937)
Backed out changeset c1021d851157 (bug 1645937)
2020-06-18 14:59:18 +03:00
Kartikaya Gupta
44c15927f5 Bug 1645937 - Add reftest. r=tnikkel
Depends on D80054

Differential Revision: https://phabricator.services.mozilla.com/D80055
2020-06-18 08:56:53 +00:00
Hiroyuki Ikezoe
77bf0111ce Bug 1467765 - Sample off-main-thread animations on the render backend thread in case of WebRender. r=kats
Now CompositorAnimationStorage::GetAnimatedValue() and SetAnimatedValue()s
are called on the sampler thread in case of WebRender, are called on the
compositor thread in case of non WebRender, so we drop assertions of
IsInCompositorThread check there. A mLock.AssertCurrentThreadOwns call in
each function should make sure the function gets called on the
sampler/compositor thread with acquiring the lock.

One caveat in this change is that in case we try to get an animation value via
nsIDOMWindowUtils.getOMTAStyle(), we do sample animations on the _compositor_
thread and we never call UpdateDynamicProperties, which means if it gets called
in testing refresh driver mode, visual results will differ from what the value
returned by the getOMTAStyle should look like. But it should be fine because we
disallow using any chrome priviledge APIs in reftests and also we will never use
the testing refresh driver mode in the reftest harness. Also in mochitests the
visual results' differences might make people confusing if the person can notice
it, but in principal getOMTAStyle() is designed to get computed animating values
so that it doesn't matter what the visual result is.

Differential Revision: https://phabricator.services.mozilla.com/D79982
2020-06-17 23:47:20 +00:00
Hiroyuki Ikezoe
5ac8e30f29 Bug 1467765 - Factor out resetting previous time stamp stuff. r=kats
|mPreviousFrameTimeStamp| will be moved into the sampler for OTMA in the next
commit though.

Differential Revision: https://phabricator.services.mozilla.com/D79981
2020-06-17 23:32:22 +00:00
Hiroyuki Ikezoe
b974ebc500 Bug 1467765 - Factor out clear animation resources stuff. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79980
2020-06-17 23:32:10 +00:00
Glenn Watson
0f92ede9c2 Bug 1646279 - Remove primitive opacity collapse support. r=Bert,kvark
The code to support collapsing a picture with a single primitive
and an opacity filter into a primitive + opacity binding is
no longer an important optimization, due to picture caching.

Removing this old optimization also reduces complexity during
scene building, and slightly simplifies batching and picture
cache dependency tracking.

Differential Revision: https://phabricator.services.mozilla.com/D79975
2020-06-18 00:01:44 +00:00
Jeff Gilbert
71aeba305c Bug 1635293 - Cherry-pick ANGLE fix: Update tex cache even if new type is InvalidEnum. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D79755
2020-06-15 22:07:44 +00:00
Gijs Kruitbosch
222e2d1158 Bug 1644863 - fix trailing whitespace in cross-tree tests, r=emilio,marionette-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D79202
2020-06-17 22:45:31 +00:00
Hiroyuki Ikezoe
cde94b34ea Bug 1646263 - Introduce a lock in CompositorAnimationStorage. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79949
2020-06-17 22:39:50 +00:00
Hiroyuki Ikezoe
8c6ba30865 Bug 1646263 - Make internal-only methods of CompositorAnimationStorage private. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79948
2020-06-17 22:39:42 +00:00
Hiroyuki Ikezoe
282639cf63 Bug 1646263 - Move the non WebRender version of SampleAnimations into CompositorAnimationStorage. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79947
2020-06-17 22:39:40 +00:00
Hiroyuki Ikezoe
35f57c1650 Bug 1646263 - Add CompositorAnimationStorage::CollectWebRenderAnimations. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79946
2020-06-17 22:39:35 +00:00
Hiroyuki Ikezoe
2c54786097 Bug 1646263 - Move the WebRender version of AnimationHelper::SampleAnimations into CompositorAnimationStorage. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79945
2020-06-17 22:39:33 +00:00
Hiroyuki Ikezoe
4af8413479 Bug 1646263 - Separate CompositorAnimationStorage from AnimationHelper.[cpp,h]. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79944
2020-06-17 22:38:30 +00:00
Hiroyuki Ikezoe
2259081765 Bug 1646263 - Use a proper name for NS_NewRunnableFunction in APZSampler. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79943
2020-06-17 22:38:13 +00:00
Hiroyuki Ikezoe
ca5e547627 Bug 1646263 - Drop nsTArray.h from APZSampler.h. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79942
2020-06-17 22:38:00 +00:00
Imanol Fernandez
cc77358c6f Bug 1646073 - Enable WebGL SwapChain pooling on Android. Use a separate SwapChain for WebVR. r=jgilbert
- Enable WebGL SwapChain pooling on Android. Creating and releasing Android Surfaces every frame causes a big performance hit due to AndroidSurface slow destructors bug.
- Add a separate SwapChain for WebVR. We are already using separate SwapChains for WebXR (WebGLFramebuffer::mOpaqueSwapChain) but not for WebVR (it uses the canvas backbuffer).

Differential Revision: https://phabricator.services.mozilla.com/D79840
2020-06-17 18:56:16 +00:00
Sylvestre Ledru
acaa9649a8 Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D79796
2020-06-16 22:35:03 +00:00
Martin Stransky
206cdde0d6 Bug 1646051 [Wayland] Use dmabuf video textures when vaapi is enabled, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D79830
2020-06-17 06:54:07 +00:00
Razvan Maries
5ae8a2d95b Backed out changeset 217914372d03 (bug 1642629) for WebRender bustages. CLOSED TREE 2020-06-17 02:35:32 +03:00
Nicolas Silva
c37718ab0c Bug 1642629 - Recycle the surface info vector in frame building. r=gw
This vector is usually small, but on some pages it can be fairly large (500+ in https://forum.xda-developers.com/redmi-note-3/development for example).

Differential Revision: https://phabricator.services.mozilla.com/D79855
2020-06-16 20:11:39 +00:00
Nicolas Silva
cc2446726c Bug 1642629 - Remove the lookback limit for alpha batches. r=kvark
An alternative patch to take only if we don't land https://phabricator.services.mozilla.com/D79545

The main observations here are:
 - In the vast majority of times we find a compatible bacth or intersect an incompatible one within 3 iterations when looking for batch candidates.
 - In addition, most of the time we don't need to iterate per-item rects thanks to a fast path kleveraging per-batch bounding rects, making it reasonably cheap to iterate over more batches.

This gives us room to allow ourselves to visit a lot more batches without a large impact on CPU time (under the assumption that removing a handful of draw calls will more than make up for the extra iterations).

Depends on D79479

Differential Revision: https://phabricator.services.mozilla.com/D79794
2020-06-16 14:44:24 +00:00
sotaro
3f0b08deb4 Bug 1645579 - Disable RecycleAllocator for RDD process when WebRender is disabled on Mac r=nical
Recycling caused rendering problem on a MacOS PC with OpenGL compositor. TextureHost reuse with OpenGL compositor seemed to have a problem.

Adds pref layers.recycle-allocator-rdd for disable/enable the RecycleAllocator.

Differential Revision: https://phabricator.services.mozilla.com/D79639
2020-06-16 18:14:46 +00:00
Markus Stange
7b1b52b19b Bug 1592739 - Stop using the vibrant region as the transparent region. r=mattwoodrow
This code was assuming that the only non-opaque parts of compositor rendering would be the
parts of the window that had vibrancy. But now that the default window background is transparent,
we can have non-vibrant parts where we render into transparency. Dialog windows such as sheet
windows are an example of this.
So instead of using the non-vibrant region of the window as its opaque region, we now use
the region that is covered by opaque Gecko layers. This region is a lot more conservative:
For example, the main browser chrome is now entirely transparent, because the chrome's opaque
parts share a layer with its transparent parts.
As a result, this change slightly affects the CALayer partitioning in the main browser window:
The entire browser chrome is now transparent, not just the tab bar.
The web content area is still opaque.

I think this will be fine. The thing I'm most concerned about is that scrolling inside web
content might cause invalidations of pixels from the chrome, because then we'd recomposite
the CALayers that cover the vibrant tab bar. This doesn't seem to happen most of the time
though, from what I can tell.

Differential Revision: https://phabricator.services.mozilla.com/D51466
2020-06-11 18:46:04 +00:00
Markus Stange
f0b3aa554a Bug 1592739 - Stop clearing the background behind vibrant -moz-appearance items. r=mattwoodrow
Now that there is no Gecko-contributed background color in the window any more,
there's nothing that needs to be cleared away. This simplifies things.

Differential Revision: https://phabricator.services.mozilla.com/D51464
2020-06-11 18:46:39 +00:00
Jonathan Kew
ccb0928606 Bug 1645685 - Don't re-try font entry creation in gfxPlatformFontList::GetOrCreateFontEntry if we already cached a null result. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D79613
2020-06-16 14:47:11 +00:00
Jonathan Kew
de7c977e78 Bug 1645645 - Fix error handling in gfxDWriteFontList::CreateFontEntry to avoid risk of null-deref. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D79612
2020-06-16 14:52:15 +00:00
Sylvestre Ledru
85c05f3a47 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D79795
2020-06-16 14:37:23 +00:00
Nicolas Silva
8a2c8481b7 Bug 1642629 - Only track per-item rects in batches if a per-batch approximation isn't good enough. r=kvark
Tested this on a few pages and it lets us avoid allocating per-item rects for roughly a quarter to a third of the batches. For batches that end up allocating per item rects we get to allocate fewer of them. It also further reduces the amount of times we need to test all item rects against intersections.

Differential Revision: https://phabricator.services.mozilla.com/D79479
2020-06-16 09:30:45 +00:00
cbrewster
82df51ad78 Bug 1645281: Limit the size of box shadow render tasks r=gw,Bert
Differential Revision: https://phabricator.services.mozilla.com/D79593
2020-06-15 22:01:26 +00:00
Hiroyuki Ikezoe
d427812e04 Bug 1645900 - Use AutoTArray for sampling animation values. r=boris
In the sampling methods, we do basically sample an animation value for each
CSS property other than transform-like properties.

Differential Revision: https://phabricator.services.mozilla.com/D79749
2020-06-15 21:50:06 +00:00
Jeff Gilbert
82ef5d6cc1 Bug 1632249 - Check weakptr value before deref in gl::Texture/Renderbuffer. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D79626
2020-06-15 18:26:17 +00:00
Jeff Gilbert
fac855a09e Bug 1632249 - Determine webgl's layers::TextureType in Present. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D79617
2020-06-15 18:26:14 +00:00
Jeff Gilbert
4232c2c466 Bug 1632249 - Replace GLContextProvider::CreateOffscreen with GLContext::CreateOffscreenDefaultFb. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D79390
2020-06-15 18:26:12 +00:00
Jeff Gilbert
4d9dcd8e1d Bug 1632249 - Fix Bb failures. r=gw
> /builds/worker/checkouts/gecko/gfx/gl/SharedSurface.cpp:141:1: error: control reaches end of non-void function [-Werror=return-type]

Old compilers don't realize the switch being exhaustive means the
function always returns, which we workaround here.

Differential Revision: https://phabricator.services.mozilla.com/D78837
2020-06-15 18:26:05 +00:00
Jeff Gilbert
3ae501809c Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-15 18:26:02 +00:00
Jeff Gilbert
fd44ed35e8 Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-15 18:25:58 +00:00
Jeff Gilbert
a97c615de2 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
Nicolas Silva
af826aab13 Bug 1642629 - Avoid iterating over all batch item rects in some cases. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D79480
2020-06-15 13:28:13 +00:00
Nicolas Silva
dbf71f4793 Bug 1642629 - preallocate a few vectors in CompositeState. r=gw
These vectors are rebuilt once per frame. we can't recycle them because they are sent to the renderer. On a 4k screen for most sites the element counts are low enough that we can get away with preallocation from a pessimistic estimate, but high enough that reallocation happens a few times per frame and takes a small but visible portion of the profile.

Differential Revision: https://phabricator.services.mozilla.com/D79457
2020-06-15 13:28:13 +00:00
sotaro
ff041549ae Bug 1640901 - Update CompositorBridgeID when ImageHost is async in ImageLayerComposite::SetLayerManager() r=mattwoodrow
When Tab is moved to another window, all async ImageHosts need to update CompositorBridgeID. It is used for calling ScheduleComposition().

Differential Revision: https://phabricator.services.mozilla.com/D79068
2020-06-14 07:29:20 +00:00
Jonathan Kew
52874b4df6 Bug 1645587 - Add missing null-check for family in FontList::SetLocalNames, in case font families are blocked by the font whitelist or visibility prefs. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D79595
2020-06-14 13:08:21 +00:00
Martin Stransky
48eab6d50c Bug 1629788 [Wayland] Add widget.wayland-dmabuf-video-textures.enabled preference, r=jhorak
- widget.wayland-dmabuf-video-textures.enabled controls dmabuf texture backend for decoded video frames.

Differential Revision: https://phabricator.services.mozilla.com/D78293
2020-06-13 18:38:45 +00:00
Jean-Yves Avenard
9b85722f24 Bug 1644254 - Keep a reference to the CompositorThreadHolder until gfx shutdown tasks have run. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D79596
2020-06-13 12:30:27 +00:00
Bogdan Tara
f3d007c8fd Backed out 3 changesets (bug 1629788) for WaylandDMABufSurface.cpp related bustages CLOSED TREE
Backed out changeset 31fba4d1fe1d (bug 1629788)
Backed out changeset 9d1e4da287a6 (bug 1629788)
Backed out changeset 23791ccf64dd (bug 1629788)
2020-06-13 13:56:04 +03:00
Martin Stransky
ef2c5466dd Bug 1629788 [Wayland] Add widget.wayland-dmabuf-video-textures.enabled preference, r=jhorak
- widget.wayland-dmabuf-video-textures.enabled controls dmabuf texture backend for decoded video frames.

Differential Revision: https://phabricator.services.mozilla.com/D78293
2020-06-13 10:35:32 +00:00
Jonathan Kew
5de135d535 Bug 1645524 - Correctly set the return value of gfxDWriteFontList::ReadFaceNames to support src:local(...) face search. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D79564
2020-06-13 03:11:23 +00:00
Dzmitry Malyshau
1df0745ce1 Bug 1642495 - Use the same usage hint in WebRender for one-time reset r=gw
This should let the GL drivers to re-use the PBOs more aggressively,
and traverse the orphan list less.
Fwiw, it doesn't look like Angle differentiates between StreamDraw and DynamicDraw:
https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/gfx/angle/checkout/src/libANGLE/renderer/d3d/BufferD3D.cpp#65-66

Differential Revision: https://phabricator.services.mozilla.com/D78339
2020-06-13 01:38:10 +00:00
Jonathan Kew
4a4f4331c2 Bug 1645482 - Don't leak dwrite font table references after reading font names. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D79534
2020-06-12 19:50:07 +00:00
Kartikaya Gupta
8004743db4 Bug 1643884 - Don't run APZCCallbackHelper::NotifyPinchGesture synchronously to avoid re-entrancy in InputQueue::ProcessQueue. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D79459
2020-06-12 16:45:28 +00:00
Dzmitry Malyshau
8a480da876 Bug 1642495 - Limit WebRender instance buffer sizes r=gw
This is an attempt to improve our relationship with the drivers.
Currently, we work with the instance buffer limit dictated by the macOS drivers.
We can consider lowering it, since it will only make the driver work eaiser.

Differential Revision: https://phabricator.services.mozilla.com/D78164
2020-06-12 16:46:51 +00:00
Jonathan Kew
556989ec22 Bug 1644285 - Use descriptor rather than index (which might change) to record font face in local-names InitData record on Linux. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D79192
2020-06-12 12:07:05 +00:00
Andrew Osmond
8f69882854 Bug 1628657 - Make canvas use computed reference frame transforms. r=kvark
When a transform depends on the layout size of an element, one can see
visual distortions caused by the difference between the unsnapped size
used in the transform, and the snapped size calculated during scene
building. Ideally we could compute the transform after we snap, rather
than before. This patch adds support for a computed reference frame
which takes parameters to calculate the ideal transform dynamically.

In a future patch, we should make videos take advantage of this same
mechanism to avoid similar problems. This requires support for mirroring
and rotations.

Differential Revision: https://phabricator.services.mozilla.com/D77956
2020-06-11 20:46:05 +00:00
Andrew Osmond
65ad608400 Bug 1641594 - Remove the wrapper around recycled surfaces. r=tnikkel
We can perform the same function as RecyclingSourceSurface by checking
the ref count of the underlying surface directly. We need to ensure
WebRender is explicitly aware that it is a recycled surface, but that is
easily achieved by changing the type of the surface. This avoids
unnecessary heap allocations, particularly in the case where many
elements on the same page refer to the same animation (and thus
duplicating RecyclingSourceSurface objects).

Differential Revision: https://phabricator.services.mozilla.com/D77513
2020-06-11 17:49:13 +00:00
Nicolas Silva
6f344901e5 Bug 1642629 - Reduce the amount of vector reallocation when adding primitives to batches. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D79277
2020-06-12 08:44:58 +00:00
Glenn Watson
649907c2a1 Bug 1623792 - Remove unused add_prim_to_start code path. r=nical
Remove associated enum and code path that are no longer used since
the removal of Push/PopClipChain display items.

Differential Revision: https://phabricator.services.mozilla.com/D79406
2020-06-12 08:21:13 +00:00
Nicolas Silva
c10ab4920c Bug 1645124 - Bump the number of layers per alpha texture array from 4 to 8. r=gw
This prevent frequent batch breaks with non-sub-px-aa text runs.

Differential Revision: https://phabricator.services.mozilla.com/D79327
2020-06-11 20:16:24 +00:00
Jean-Yves Avenard
71373f3f10 Bug 1644009 - P7. Revert "Bug 1592488 - P4. Ensure an AbstractThread exists for the Compositor Thread." r=mattwoodrow
DirectTask dispatching will now be directly handled by nsThread.

Differential Revision: https://phabricator.services.mozilla.com/D79091
2020-06-12 05:10:10 +00:00
Kartikaya Gupta
ba088f5b71 Bug 1644271 - Add a ManagerType field to the MVM, to allow conditional behaviour. r=tnikkel
The MVM is needed for both handling of meta-viewport tags and APZ zooming.
However, the set of functionality needed in the two modes are not the same.
This patch adds a mechanism to create an MVM with a flag that lets it know
which mode it is operating in. Eventually we may want to split this into two
or more classes but for now this seems like a reasonable way forward.

The flag is currently set on the MVM on creation based on whether or not the
meta-viewport support is needed. There's no code that meaningfully *uses* the
flag yet, so this patch should have no functional change. The bulk of the
patch is ensuring that we appropriately destroy and re-create the MVM if the
flag required changes.

Differential Revision: https://phabricator.services.mozilla.com/D79224
2020-06-12 01:15:42 +00:00
Razvan Maries
4326a2fab5 Backed out changeset 88406054eb6c (bug 1636645) for perma failures on 456219-1a.html. CLOSED TREE 2020-06-12 02:11:46 +03:00
Kearwood Gilbert
8584903f39 Bug 1644579 - Allow VR backends to be enabled and disabled without restarting. Ensure that all other backends are disabled when the VR puppet is enabled. r=daoshengmu
Differential Revision: https://phabricator.services.mozilla.com/D78993
2020-06-10 19:04:19 +00:00
Dzmitry Malyshau
c91ee11436 Bug 1636645 - Batch instance and rects consolidation r=gw
The main idea here is lifting the storages of batches, instances, and instance rects,higher up. Currently, to the level of the alpha/opaque batcher.
In the short term, this would result in less heap allocations on frame building.
For example, we no longer have a Vec<InstanceRect> per batch, stored in a separate Vec,
and we don't have a separate Vec<InstanceData> per batch.
There is also a matter of code refactor and cleanup that could make our life better.

In the longer term, once Angle is updated, we'll be able to lift the VBO updates up
accordingly, and use baseInstance drawing with them.

Sub-commits:
- Minor refactor of the batch intersection logic
- Instance stacks for transparent alpha batches
- Use instance stacks for opaque batches as well
- Implement and re-enable batch list merging
- Encapsulate instance stack LRU indexing into a class
- Internal BatchList type, bumped StackIndex size.
- Adjust the tests
- Test the stack count of 4

Differential Revision: https://phabricator.services.mozilla.com/D76715
2020-06-10 22:42:28 +00:00
Botond Ballo
f91b39185b Bug 1643604 - Move the check for a resized layout viewport in NotifylayersUpdated to the non-first-paint case. r=kats
In the first-paint case, we are accepting the incoming scroll metadata
wholesale, so most of the consequences of this code block will happen
anyways -- except for the extra repaint, which is not actually needed
and in fact undesirable in the first-paint case.

Differential Revision: https://phabricator.services.mozilla.com/D79195
2020-06-11 21:05:09 +00:00
Dorel Luca
255f146f14 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
sotaro
c5381ed0cd Bug 1638819 - Skip SyncObjectD3D11Host::Synchronize() when RenderTextureHosts do not use ID3D11Texture2D r=jrmuizel
Simple implementation of skipping SyncObjectD3D11Host::Synchronize(). More optimization could be done in Bug 1635629.

Differential Revision: https://phabricator.services.mozilla.com/D75781
2020-06-11 07:28:30 +00:00
Emilio Cobos Álvarez
4cb5da08a2 Bug 1640623 - Use an enum class for LookAndFeel::FontID. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D76696
2020-06-11 11:27:58 +00:00
Jeff Gilbert
15ac3e9445 Bug 1632249 - Fix Bb failures. r=gw
> /builds/worker/checkouts/gecko/gfx/gl/SharedSurface.cpp:141:1: error: control reaches end of non-void function [-Werror=return-type]

Old compilers don't realize the switch being exhaustive means the
function always returns, which we workaround here.

Differential Revision: https://phabricator.services.mozilla.com/D78837
2020-06-11 06:37:43 +00:00
Jeff Gilbert
2ac2690670 Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-11 06:37:40 +00:00
Jeff Gilbert
06fa957778 Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-11 06:37:36 +00:00
Jeff Gilbert
cf3c8fedea 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
Jamie Nicol
6ac8fcda94 Bug 1644732 - Don't call NotifyNotUsed() from ~RenderAndroidSurfaceTextureHostOGL(). r=sotaro
Doing so means it is called twice, which causes an assertion failure.

Differential Revision: https://phabricator.services.mozilla.com/D79127
2020-06-11 05:27:09 +00:00
Mihai Alexandru Michis
59ad7ed333 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
85f3804e14 Bug 1632249 - Fix Bb failures. r=gw
> /builds/worker/checkouts/gecko/gfx/gl/SharedSurface.cpp:141:1: error: control reaches end of non-void function [-Werror=return-type]

Old compilers don't realize the switch being exhaustive means the
function always returns, which we workaround here.

Differential Revision: https://phabricator.services.mozilla.com/D78837
2020-06-10 22:21:17 +00:00
Jeff Gilbert
d415e13cc1 Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-10 22:21:09 +00:00
Jeff Gilbert
28d2828abe Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-10 22:21:04 +00:00
Jeff Gilbert
9b09e54345 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
Kartikaya Gupta
6e27d8c5cc Bug 1644829 - Avoid using SimpleTest.is etc. in helper subtests run by runSubtestsSeriallyInFreshWindows. r=botond
Using `SimpleTest.is` directly instead of the "global" `is` installed by
runSubtestsSeriallyInFreshWindows means that the helper test filename doesn't
get emitted in the assertions, which is a nice thing to have. (Ditto for `ok`
and friends).

Problematic tests identified using:
for helper in helper_*.html; do
    if [[ $(grep "$helper" test_group*) ]]; then
        echo $helper;
        grep -e 'SimpleTest.\(is\|ok\)' "$helper";
    fi;
done

While it would be nice to catch this sort of thing directly in the code, it's
a bit tricky to do because SimpleTest.(ok|is) do get used legitimately by helper
methods that are used by group subtests and top-level tests.

Depends on D79171

Differential Revision: https://phabricator.services.mozilla.com/D79172
2020-06-10 19:35:48 +00:00
Kartikaya Gupta
ff2651cdc1 Bug 1644829 - Add an isnot reflection to the subtest window as well. r=botond
Depends on D79170

Differential Revision: https://phabricator.services.mozilla.com/D79171
2020-06-10 19:35:45 +00:00
Kartikaya Gupta
2aba4a7dc4 Bug 1644829 - For consistency ensure all tests that use runSubtestsSeriallyInFreshWindows have a _group in the name. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D79170
2020-06-10 19:34:47 +00:00
Kartikaya Gupta
5e5dea416b Bug 1643459 - Remove APZ:TransformEnd observer after subtest is done. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D79173
2020-06-10 19:27:51 +00:00
Daosheng Mu
47c6c14def Bug 1643514 - Avoid requesting VR display when it already completed. r=kip,imanol
Differential Revision: https://phabricator.services.mozilla.com/D78437
2020-06-10 00:57:26 +00:00
Daosheng Mu
d9e2924e6f Bug 1643514 - Clean up VRManager usage. r=kip,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D78436
2020-06-10 01:26:52 +00:00
Jamie Nicol
45d8be2493 Bug 1644678 - Don't set DEALLOCATE_CLIENT flag for SharedSurface_SurfaceTextures. r=sotaro
The flag is not required for SharedSurface_SurfaceTexture, as
GeckoSurfaceTexture is reference counted. When the GeckoSurface is
disposed on the client side it simply decrements the refcount of the
GeckoSurfaceTexture on the host side, which will remain alive until
the TextureHost's reference is also dropped.

Differential Revision: https://phabricator.services.mozilla.com/D79073
2020-06-10 14:03:55 +00:00
Simon Giesecke
82dc9b2271 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 10:46:14 +00:00
Kartikaya Gupta
c6ee908c91 Bug 1643504 - Update webrender github-CI to use new docker image. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D78903
2020-06-09 20:39:10 +00:00
Butkovits Atila
e3dce68834 Backed out 3 changesets (bug 1643289, bug 1642949) for causing failure at test_headless_screenshot.html. CLOSED TREE
Backed out changeset 98c420f73380 (bug 1643289)
Backed out changeset 9447ea8910aa (bug 1643289)
Backed out changeset 0c827da9d847 (bug 1642949)
2020-06-10 10:07:23 +03:00
Simon Giesecke
d419f0ff08 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 05:49:28 +00:00
Hiroyuki Ikezoe
d7e086f85f Bug 1644591 - Store AnimationStorageData as std::unique_ptr in std::unordered_map. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D79000
2020-06-09 23:37:01 +00:00
Glenn Watson
19581b3441 Bug 1641751 - Part 4 - Introduce an LRU eviction policy for the texture cache r=Bert,kvark
Previously, when we decided to evict elements from the texture cache,
a very simple scheme was used. All elements would be scanned, and
any element that was older than a given threshold would be freed.

This is not ideal for a number of reasons:
 - When an eviction takes place, a large number of elements must be scanned.
 - When we do evict elements, we often evict a large number of elements in
   a single frame, causing CPU spikes.
 - We often evict more items than necessary, resulting in redundant
   uploads of the same elements again on subsequent frames.

This patch introduces a new LRU cache collection, which is used to
manage the lifetime of most texture cache entries [1].

With this change, we can now:
 - Efficiently evict items from oldest to newest, without scanning the entire list.
 - Efficiently evict only a small number of items per frame, reducing the
   chance of CPU frame spikes.
 - Evict only enough elements to reduce memory under a specific threshold,
   which reduces the number of redundant evictions / re-uploads required.

[1] Picture cache tiles and manual eviction elements are stored inside
    the new cache for efficiency, but the lifetime of them is managed
    separately by the texture cache.

Differential Revision: https://phabricator.services.mozilla.com/D78216
2020-06-09 20:43:44 +00:00
sotaro
dfcc816bd3 Bug 1644115 - Remove unused WebRenderTextureHost::mExternalImageId r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D78666
2020-06-09 16:16:26 +00:00
Mike Hommey
57fa3660c9 Bug 1643504 - Upgrade webrender and wgpu docker images to Debian buster. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D78419
2020-06-09 13:35:40 +00:00
Bob Owen
75f69ba6de Bug 1644208: Change RecordSourceSurfaceDestruction to take a void* not SourceSurface* to avoid AddRef during destructor. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D78770
2020-06-09 14:21:31 +00:00
Glenn Watson
238bfaa4ae Bug 1640496 - Fix incorrect FBO state caching when updating external textures. r=sotaro
The `reset_state` method being called after locking external textures
was resetting the cached state, but not actually forcing the GL
state to match.

This could result in cached state getting out of sync with GL. In
this case, we'd end up trying to composite to the external texture
FBO rather than the main framebuffer.

Differential Revision: https://phabricator.services.mozilla.com/D78851
2020-06-09 06:12:23 +00:00
Kearwood Gilbert
f1e15241c4 Bug 1555188 - Enable PuppetVRSession to work when VR process is enabled r=thomasmo
Differential Revision: https://phabricator.services.mozilla.com/D72059
2020-06-08 23:57:27 +00:00
Dorel Luca
7289b66d6f 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
Kris Taeleman
ca4c948827 Bug 1643832 - Add Pref flag to enable shader precaching at startup. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D78580
2020-06-08 08:18:34 +00:00
Dzmitry Malyshau
59b6551dd5 Bug 1638672 - Use shaders to clear texture cache regions r=geckoview-reviewers,gw,snorp
This is a suggested workaround for an interesting visual bug that we see on
some platforms with Intel Broadwell GPUs.

Also reverts https://phabricator.services.mozilla.com/D57100

Differential Revision: https://phabricator.services.mozilla.com/D78705
2020-06-08 21:05:03 +00:00
Jeff Gilbert
e29ee2bc92 Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-08 20:58:03 +00:00
Jeff Gilbert
8d174dfafc Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-08 20:36:14 +00:00
Jeff Gilbert
de6377896c 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
Glenn Watson
082e587b98 Bug 1643435 - Fix incorrect z ordering of compositor surface overlays. r=Bert
Ensure that even if an entire picture cache slice is opaque, if it
has intersecting compositor surfaces we respect the draw order of
those tiles, to ensure correct z-buffer ordering.

Differential Revision: https://phabricator.services.mozilla.com/D78628
2020-06-08 20:13:01 +00:00
Bert Peers
2d6599e875 Bug 1643620 - zoom in on pdf in pdf.js BeginDraw call fails r=gw
Limit the maximum size of surface requests sent to the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D78582
2020-06-08 19:25:07 +00:00
cbrewster
5752d62db3 Bug 1642440: Wait to cast picture device rects to i32 until ensuring it won't overflow r=Bert
Differential Revision: https://phabricator.services.mozilla.com/D78555
2020-06-08 17:57:42 +00:00
James Willcox
feb9d115fd Bug 1536833 - Fix overscroll effect on Android r=botond,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D78130
2020-06-08 17:13:28 +00:00
Botond Ballo
e49f09d719 Bug 1642884 - Protect all access to Axis::mVelocity with a mutex. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D78556
2020-06-08 16:14:29 +00:00
Simon Giesecke
ebbc7ae838 Bug 1642989 - Use RemoveLastElements instead of RemoveElementsAt where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78049
2020-06-08 08:50:15 +00:00
Simon Giesecke
13502cf27c Bug 1642991 - Use RemoveElementsBy where easily possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78055
2020-06-08 09:01:48 +00:00
Timothy Nikkel
779fc72cff Bug 1632268. Add browser chrome test for select dropdown position with pinch (apz) zooming. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D78025
2020-06-08 05:45:34 +00:00
Kartikaya Gupta
99e81069c0 Bug 1627708 - Record pinch source in a telemetry histogram. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77829
2020-06-06 00:32:26 +00:00
Kartikaya Gupta
67a28c6551 Bug 1627708 - Add a PinchGestureSource enum that indicates the source of a PinchGestureInput event. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77828
2020-06-06 00:32:19 +00:00
Kartikaya Gupta
4a10c7144b Bug 1643706 - Make spatial_tree.print() work on Android too. r=kvark
Instead of using the default TreePrinter implementation which sends output
to stdout, collect it into a Vec<u8> and use the debug! macro to log it,
which sends it to a more useful destination (logcat) on Android.

Depends on D78536

Differential Revision: https://phabricator.services.mozilla.com/D78537
2020-06-05 17:33:07 +00:00
Kenny Levinsen
979767c4db Bug 1641033 - Fire vsync observers directly from Wayland frame callback. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D77047
2020-06-05 18:35:22 +00:00
Kartikaya Gupta
c06eb6ae82 Bug 1643042 - Switch mLastSmoothScrollOrigin to using None as well. r=tnikkel
This uses "None" instead of "NotSpecified" as the value for
mLastSmoothScrollOrigin when there is no smooth scroll in progress.

Depends on D78439

Differential Revision: https://phabricator.services.mozilla.com/D78469
2020-06-05 09:41:07 +00:00
Kartikaya Gupta
7ac36807b1 Bug 1643042 - Turn the scroll origin parameter into a strongly-typed enum. r=tnikkel
This patch is a fairly mechanical conversion. The old `nullptr` gets converted
to ScrollOrigin::NotSpecified, and all the other possible values get corresponding
values in the new ScrollOrigin enum. A few switch statements are introduced to
clean up big if statements, but other than that, additional cleanups will happen
in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D78438
2020-06-05 09:37:51 +00:00
sotaro
650f64603f Bug 1642839 - Implement WebRenderLayerManager::SendInvalidRegion() r=jrmuizel
When DWM is disabled, each window does not have own back buffer. They would paint directly to a buffer that was to be displayed by the video card. WM_PAINT via SendInvalidRegion() requests necessary re-paint. With it, RenderCompositorANGLE does not need to disable partial present.

Differential Revision: https://phabricator.services.mozilla.com/D77989
2020-06-05 05:03:40 +00:00
Glenn Watson
0cc2ef2ac9 Bug 1641751 - Part 3 - Refactor some texture cache code for future eviction changes. r=Bert,kvark
* Maintain a running total of bytes allocated in both standalone and
  shared cache regions. This is used as a threshold to know when to
  force a mid-frame eviction. Previously, as soon as the currently
  allocated set of shared textures were full, we'd force an eviction.
  This means that in typical use cases, we were forcing an eviction
  as soon as the texture cache is > 16 MB, which is inefficient.

* Separate out picture cache eviction from the normal cache eviction
  path. This will be important in the next patch which will change
  the eviction algorithm for all shared / standalone entries.

* Remove Eviction::Eager as a policy option for shared and standalone
  textures. As part of this, switch render task cache entries to use
  Eviction::Auto. This is a better option anyway, there is no real
  benefit to evicting render tasks as soon as possible - they should
  be expired based on usage, just as for normal cache entries.

Differential Revision: https://phabricator.services.mozilla.com/D77983
2020-06-05 00:53:17 +00:00
Noemi Erli
184f382e28 Backed out changeset 6b49139f2b9d (bug 1641033) for causing assertions in gfxPlatform.cpp CLOSED TREE 2020-06-05 04:31:45 +03:00
Kenny Levinsen
3950a7a3bf Bug 1641033 - Fire vsync observers directly from Wayland frame callback. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D77047
2020-06-04 23:39:30 +00:00
cbrewster
72444deba6 Bug 1642549: Fix incorrect offset scaling when handling mix-blend readback r=gw
When handling mix-blend readbacks, we need to calculate the origin of the source picture in the backdrop's space.
Before this patch, this was done by scaling the source picture origin by the backdrop's device pixel scale.
However, this is the incorrect scaling; We really want the relative scale between source and backdrop instead.
This patch computes the relative scaling from the device pixel scale of both the source and backdrop pictures.

This bug likely went unnoticed because the device pixel scale used to be 1 in most cases, but now we sometimes
increase the device pixel scale for raster roots.

Differential Revision: https://phabricator.services.mozilla.com/D78217
2020-06-04 21:26:38 +00:00
Andrew McCreight
dac77169a3 Bug 1639398 - Only create VRManager in processes where it can be used. r=daoshengmu,kip
This avoids about 77kb of content process overhead.

Differential Revision: https://phabricator.services.mozilla.com/D78054
2020-06-04 21:22:33 +00:00
Bryce Seager van Dyk
f7ea6aff05 Bug 1643143 - Touch up doc comment and diagram for PlanarYCbCrImage. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D78144
2020-06-03 21:43:25 +00:00
Delan Azabani
b00311bc4f Bug 1630935 - Refactor FontFamilyName + FontFamilyList + nsMathMLChar. r=emilio
This patch:

* extracts family name matching logic from FontFamilyList::Contains into FontFamilyName::IsNamedFamily
* simplifies the loop around StretchEnumContext::EnumCallback using a range-based loop with a break
* inverts the meaning of StretchEnumContext::EnumCallback’s return value

These changes were first reviewed in D73833, but we’re separating them to help us investigate some test regressions.

Differential Revision: https://phabricator.services.mozilla.com/D77067
2020-06-04 13:18:21 +00:00
Butkovits Atila
26ec48f853 Backed out changeset a900282391e1 (bug 1641751) for causing bugs 1643310, 1643238, 1643240. CLOSED TREE 2020-06-04 15:41:14 +03:00
Jonathan Kew
26a8e4ceec Bug 1640816 - Record base font-family name in family alias records. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D77909
2020-06-04 11:48:46 +00:00
Glenn Watson
41e42592c4 Bug 1641751 - Part 3 - Refactor some texture cache code for future eviction changes. r=kvark
* Maintain a running total of bytes allocated in both standalone and
  shared cache regions. This is used as a threshold to know when to
  force a mid-frame eviction. Previously, as soon as the currently
  allocated set of shared textures were full, we'd force an eviction.
  This means that in typical use cases, we were forcing an eviction
  as soon as the texture cache is > 16 MB, which is inefficient.

* Separate out picture cache eviction from the normal cache eviction
  path. This will be important in the next patch which will change
  the eviction algorithm for all shared / standalone entries.

* Remove Eviction::Eager as a policy option for shared and standalone
  textures. As part of this, switch render task cache entries to use
  Eviction::Auto. This is a better option anyway, there is no real
  benefit to evicting render tasks as soon as possible - they should
  be expired based on usage, just as for normal cache entries.

Differential Revision: https://phabricator.services.mozilla.com/D77983
2020-06-04 03:17:57 +00:00
cbrewster
89c953e36d Bug 1642072: Add a red line threshold to the render target GC to prevent memory exhaustion r=gw
Differential Revision: https://phabricator.services.mozilla.com/D78072
2020-06-03 22:53:16 +00:00
sotaro
b12a00b03e Bug 1642834 - Add a comment to RenderCompositorANGLE::RequestFullRender() r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D77972
2020-06-03 22:32:10 +00:00
Lee Salzman
45e9e4cbbf Bug 1641951 - let WR font sanitization ride the trains. r=jrmuizel
WR font sanitization appears relatively stable now, and we passed the 79
cutoff, so let WR font sanitization ride the trains.

Differential Revision: https://phabricator.services.mozilla.com/D78147
2020-06-03 22:37:58 +00:00
Bert Peers
e05f202e2b Bug 1641704 - vendor tracy 0.1.1 (gfx/wr, bindings) r=gw
Differential Revision: https://phabricator.services.mozilla.com/D78100
2020-06-03 20:33:05 +00:00
Dorel Luca
9377b3e955 Backed out changeset 02f8daecd98e (bug 1642884) for Mochitest failures in builds/worker/checkouts/gecko/gfx/layers/apz/src/Axis.cpp. CLOSED TREE 2020-06-03 23:11:28 +03:00
Botond Ballo
5eb0a67a4d Bug 1611660 - Accept layout viewport updates from the main thread right away. r=tnikkel
Previously, we would wait until the following frame (for uncertain reasons
that date back to B2G), but this meant the layout and visual viewports would
be out of sync for a frame, causing APZ to misbehave.

Differential Revision: https://phabricator.services.mozilla.com/D61286
2020-06-03 19:03:17 +00:00
Ryan VanderMeulen
d4df232197 Bug 1643005 - Update HarfBuzz to 2.6.7. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D78056
2020-06-03 17:38:40 +00:00
Botond Ballo
4a07cb3fec Bug 1642884 - Ensure calls to Axis::CancelGesture() are protected by the APZC lock. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D78086
2020-06-03 16:56:45 +00:00
Botond Ballo
58f4d468c7 Bug 1642788 - Ensure APZ gtests set mTimeStamp correctly on events where needed. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D77981
2020-06-03 16:39:01 +00:00
Botond Ballo
1d59a8121e Bug 1642788 - Call StartTouch() when pinch locking is activated. r=kats
Activating pinch locking means we are locked into a two-finger pan
(no scaling), which can trigger a fling animation at the end. We
track velocity via UpdateWithTouchAtDevicePoint() while pinch locked.
We need to call StartTouch() when we start tracking velocity.

Differential Revision: https://phabricator.services.mozilla.com/D77980
2020-06-03 16:38:53 +00:00
Botond Ballo
a864440a96 Bug 1642788 - Use mTimeStamp rather than mTime for APZ velocity computations. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D77979
2020-06-03 16:38:38 +00:00
Botond Ballo
1d58b2d108 Bug 1642817 - Avoid accessing sIndirectLayerTreesLock during shutdown. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D77957
2020-06-03 13:25:41 +00:00
Dzmitry Malyshau
f2f948de6c Bug 1570736 - Fix GL capability check for swizzling r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D77896
2020-06-02 21:35:01 +00:00
Glenn Watson
3b4861a5e9 Bug 1641751 - Part 2 - Remove per-document complexity in texture cache. r=nical,Bert
When document splitting was supported, there was some complexity
when texture cache was cleared, where a frame build could be
required to ensure other documents would render correctly.

Since this is no longer used, we can remove the per-document state
here, which will simplify some future changes to how the cache
eviction policy works.

Differential Revision: https://phabricator.services.mozilla.com/D77745
2020-06-02 16:03:21 +00:00
sotaro
33ee2a10f6 Bug 1637497 - Disable partial present dynamically when Dwm is disabled r=jrmuizel
Do full render with WebRender when Dwn is disabled. It could be done by RenderCompositorANGLE::RequestFullRender().

Back out  Bug 1638469. It disables WebRender during starting if Dwm is disabled. But Dwm is enabled/disabled dynamically. And we do not want to disable WebRender in this case.

Differential Revision: https://phabricator.services.mozilla.com/D77221
2020-06-01 18:39:50 +00:00
Razvan Maries
1bc8b34912 Backed out changeset a478e84fec48 (bug 1641704) for WebRender build bustages. CLOSED TREE 2020-06-02 04:02:30 +03:00
Bert Peers
0d4192f312 Bug 1641704 - Investigate update_visibility overhead r=gw
Plot glyph rasterization, evictions, GPU allocs

Differential Revision: https://phabricator.services.mozilla.com/D77520
2020-05-29 21:06:15 +00:00
Cameron McCormack
a7bdc6a410 Bug 1639698 - Ensure that the first text run that triggers a font load has its drawing skipped if needed. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D77578
2020-06-01 10:04:36 +00:00
Glenn Watson
e8043c0222 Bug 1640523 - Fix render quality on pages with very large drop shadows. r=nical,aosmond
The logic for expanding the drop shadow clip rect was calling the
`map_vector` method in the `ScaleOffset` struct.

This method was incorrect (it was mapping the value as a point,
including the offset). This is fixed by modifying the `map_vector`
method to exclude the offset.

However, the text run snapping code was also calling map_vector
but expecting it to treat the value there as a point, so also
introduce a `map_point` method and switch the text run code
to use that.

Differential Revision: https://phabricator.services.mozilla.com/D77397
2020-05-31 21:23:24 +00:00
Glenn Watson
368ca0d02e Bug 1641751 - Part 1 - Remove some texture cache eviction paths r=Bert,kvark
This patch removes two of the existing paths for evicting textures.
One is no longer useful, and the other is over-zealous, and causes
frame stalls.

When the shared texture cache made use of variable layer counts, the
`maybe_reclaim_shared_memory` method would look at the space in free
layers, and if large enough, would clear the entire cache and rely on
it being rebuilt implicitly as new requests occur. However, since we
no longer resize the number of slices, this doesn't serve a useful
purpose (the texture cache already frees any empty texture cache units
at the end of each frame).

The other method applies a conservative, periodic GC that occurs if no
other GCs have run for five seconds. However, this is a very aggressive
eviction that often evicts most of the shared cache, and was being run
whenever the size of the texture cache was > 16 MB. The effect of this
is that if you pause scrolling for a few seconds, and then scroll again,
most of the cache gets evicted. Instead, completely remove this concept,
relying on empty texture cache pages being freed and memory pressure
events, and general cache eviction during frames.

Differential Revision: https://phabricator.services.mozilla.com/D77402
2020-05-31 21:07:44 +00:00
Kashav Madan
2b8ca16f35 Bug 1557407 - Replace DispatchTrustedEvent with DispatchEventOnlyToChrome for various chrome-only events, r=smaug
Adds an |aChromeOnlyDispatch| flag to DispatchCustomEvent to decide whether
to call DispatchTrustEvent or DispatchEventOnlyToChrome.

The following chrome-only events are dispatched with DispatchCustomEvent and now
make use of the flag:

- DOMWindowClose
- fullscreen / willenterfullscreen / willexitfullscreen
- occlusionstatechange
- resolutionchange
- XULAlertClose

and the following were previously dispatched with DispatchTrustedEvent and now
use DispatchEventOnlyToChrome:

- MozBeforeInitialXULLayout
- MozMouseScrollFailed / MozMouseScrollTransactionTimeout
- MozPaintWait / MozPaintWaitFinished
- MozPerformDelayedBlur
- all events fired by APZCCallbackHelper::NotifyMozMouseScrollEvent

Differential Revision: https://phabricator.services.mozilla.com/D76723
2020-06-01 17:11:48 +00:00
Jamie Nicol
57d87985be Bug 1642079 - Only snap animated transforms for zoom reference frames? r=aosmond
Bug 1635406 made it so that webrender snaps the offsets of animated
transforms before accumulating them in to the reference frame
transform. Unfortunately, however, this causes jittery animations. The
original intention was just to snap the visual viewport offset when
scrolling, to avoid excessive picture cache invalidation.

To avoid this, make it so that we only snap for reference frames of
kind ReferenceFrameKind::Zoom. This will mean that most animations are
unaffected. There may however still be some jitter when zooming, but
this is outweighed by the benefit of not invalidating picture cache
tiles every frame when scrolling.

Differential Revision: https://phabricator.services.mozilla.com/D77679
2020-06-01 16:49:10 +00:00
Micah Tigley
2dd990d320 Bug 1621781 - Have APZ ignore mouse events when RDM is active. r=botond
Depends on D77395

Differential Revision: https://phabricator.services.mozilla.com/D77396
2020-06-01 16:10:08 +00:00
Micah Tigley
81f5f0e8d0 Bug 1621781 - Add an "IsRDMTouchSimulationActive" field to ScrollMetadata. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77395
2020-05-30 03:15:22 +00:00
Dzmitry Malyshau
421a94b374 Bug 1637998 - Fix multi-threaded cleanup of wgpu command pools r=groves
Differential Revision: https://phabricator.services.mozilla.com/D77156
2020-05-31 04:14:17 +00:00
Dorel Luca
0c8ff16ba2 Backed out 2 changesets (bug 1621781) for Mochitest failures in gfx/layers/apz/test/mochitest/test_group_mouseevents.html
Backed out changeset a5fe71693070 (bug 1621781)
Backed out changeset 58a9b7f50a4b (bug 1621781)
2020-05-30 06:12:01 +03:00
Micah Tigley
abfa14b698 Bug 1621781 - Have APZ ignore mouse events when RDM is active. r=botond
Depends on D77395

Differential Revision: https://phabricator.services.mozilla.com/D77396
2020-05-29 21:38:07 +00:00
Micah Tigley
62367a9af9 Bug 1621781 - Add an "IsRDMTouchSimulationActive" field to ScrollMetadata. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77395
2020-05-29 21:03:06 +00:00
Jeff Muizelaar
f8a0df6679 Bug 1624366. Support image surfaces with a last row with < stride bytes. r=lsalzman
We create sub images from larger images by using a stride that matches
the original and adjusting the offset. This creates a situation where
the last row will only have stride - offset bytes. This stops us
from lying to CGDataProvider.

Differential Revision: https://phabricator.services.mozilla.com/D77476
2020-05-29 15:17:35 +00:00
Nathan Froyd
54e9de192c Bug 1641640 - move angle d3dcompiler dll installation into moz.build; r=firefox-build-system-reviewers,jgilbert,rstewart
Less Makefiles are more better.

Differential Revision: https://phabricator.services.mozilla.com/D77322
2020-05-29 16:02:16 +00:00
Martin Stransky
30ea024440 Bug 1619882 [Wayland] Use WaylandDMABufSurface global lock instead of VAAPIFrameHolder at WaylandDMABUFSurfaceImage, r=sotaro
VAAPIFrameHolder was moved to FFmpegVideoDecoder class and we use WaylandDMABufSurface global lock to keep
surface reference until it's used.

Differential Revision: https://phabricator.services.mozilla.com/D76691
2020-05-29 15:22:07 +00:00
Martin Stransky
ec6a3bec56 Bug 1619882 [Wayland] Implement dmabuf global ref count, r=jhorak
This patch implements:

- Global surface UID for better tracking/debugging. The UID is passes acros all processes so we can track
  surface usage.
- WaylandAllocateShmMemory() function which uses shm_open() instead of files at tmp for Shm memory creation.
- DMABufRefcount() class based on eventfd() which is used as a global surface reference count.

Differential Revision: https://phabricator.services.mozilla.com/D76689
2020-05-29 15:21:50 +00:00
Lee Salzman
f84ee8c3dc Bug 1604357 - handle divide by zero in bezier inflection approximation range. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D77392
2020-05-29 10:54:28 +00:00
Lee Salzman
4b7890460b Bug 1640247 - silence UBSan recorded font warnings. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D77385
2020-05-29 10:51:07 +00:00
Lee Salzman
17ad4b4e4d Bug 1641671 - move FontInstance bools into FontInstanceFlags. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D77369
2020-05-29 01:49:22 +00:00
Lee Salzman
55cb2756e8 Bug 1641671 - fold device scale back into font size since it is no longer quantized. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D77368
2020-05-29 01:49:05 +00:00