Commit Graph

14766 Commits

Author SHA1 Message Date
Mihai Alexandru Michis
a75aa1f3ed Backed out 2 changesets (bug 1664047, bug 1664135) for causing dt failures in ScreenshotGrabber.cpp
CLOSED TREE

Backed out changeset d8996fcd3568 (bug 1664047)
Backed out changeset 070815d3ff02 (bug 1664135)
2020-09-15 03:09:08 +03:00
Markus Stange
b2cdbc6d3e Bug 1664047 - Only call UpdateSnapshot when ScreenshotGrabber calls GetWindowContents, which it only does if the profiler is running (and Screenshots are enabled). r=mattwoodrow
This requires passing down the window size down in a different way, because the
NativeLayerRootSnapshotter does not know the window size otherwise.

At the same time, this patch also removes WindowNLRS and makes the NativeLayerRoot
implement the profiler_screenshots::Window interface directly.

Depends on D89863

Differential Revision: https://phabricator.services.mozilla.com/D89864
2020-09-13 21:41:24 +00:00
sotaro
d56cad7ed1 Bug 1664736 - Add error log to AndroidHardwareBuffer::FromFileDescriptor() r=nical
Differential Revision: https://phabricator.services.mozilla.com/D90057
2020-09-14 11:00:22 +00:00
Timothy Nikkel
ad56527f09 Bug 1655130. Handle non-smooth scrolling with desktop zooming scrollbars. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D89408
2020-09-13 08:31:54 +00:00
Kartikaya Gupta
7d82f7fd13 Bug 1658169 - Have smooth-type scroll updates trigger smooth scroll animations. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D89667
2020-09-12 13:07:18 +00:00
Kartikaya Gupta
216859f173 Bug 1658169 - Add a SmoothScrollAnimation that matches the main-thread smooth scroll physics. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D89666
2020-09-12 14:15:47 +00:00
Kartikaya Gupta
6ea98dfe88 Bug 1658169 - Move the origin-based physics computation to APZPublicUtils. r=tnikkel
This is just moving code to make it reusable in APZ. As part of this, I replace
use of Preferences::* with the StaticPrefs::* API, because we can't use
Preferences:: in the GPU process and we'll want to be able to invoke this code
from there.

Differential Revision: https://phabricator.services.mozilla.com/D89665
2020-09-12 14:08:10 +00:00
Kartikaya Gupta
eed974a8a8 Bug 1658169 - Move the SmoothMsdScrollAnimation into its own file. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D89663
2020-09-12 14:14:58 +00:00
Kartikaya Gupta
a1af76def0 Bug 1658169 - Rename the existing smooth scroll on the APZ side to smooth-msd. r=tnikkel
This is used for scrolls of type eSmoothMsd that the main-thread sends over,
and for scroll snapping. For consistent naming let's call this smooth msd.

Differential Revision: https://phabricator.services.mozilla.com/D89662
2020-09-12 13:06:51 +00:00
Kartikaya Gupta
6f6a0fd9b0 Bug 1658169 - Unified compilation fixes. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D89661
2020-09-12 13:06:49 +00:00
Kartikaya Gupta
8b10d15d15 Bug 1662014 - Remove unused fields/APIs. r=botond,tnikkel
These things are all unused now.

Differential Revision: https://phabricator.services.mozilla.com/D88750
2020-09-12 13:06:39 +00:00
Kartikaya Gupta
97dbe7a253 Bug 1662014 - Update some TiledContentClient code to use the ScrollPositionUpdate array. r=botond
This should be mostly equivalent to the old code, and unblocks deletion of
some fields in FrameMetrics.

Differential Revision: https://phabricator.services.mozilla.com/D88749
2020-09-12 13:06:32 +00:00
Kartikaya Gupta
03e7bbc347 Bug 1662014 - Stop using the mSmoothScrollOffset field. r=botond
This is the only place that uses the mSmoothScrollOffset any more, and it
doesn't really need to as a local variable suffices.

Differential Revision: https://phabricator.services.mozilla.com/D88748
2020-09-12 13:06:30 +00:00
Kartikaya Gupta
0863c04a4d Bug 1662013 - Move some function bodies into .cpp files. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D88746
2020-09-12 13:06:20 +00:00
Kartikaya Gupta
c942c614e3 Bug 1662013 - Update NotifyLayersUpdated to use the ScrollPositionUpdates. r=tnikkel,botond
This rewrites a big chunk of the NotifyLayersUpdated code (most of the code that
deals with incoming scroll requests from the main-thread) to instead iterate
through the list of ScrollPositionUpdates on the metadata and apply them in
order. A bunch of the ApplyXXXUpdateFrom functions on FrameMetrics have their
innards deduplicated and boil down to a single line, which is then inlined, so
those functions get removed entirely.

Note that this rewrite doesn't yet handle all the possible types of
ScrollPositionUpdate instances, just the ones that the old code handled. In the
future this support will be fleshed out with tests to exercise the relevant
codepaths.

There is also a change to nsGfxScrollFrame which slightly modifies the semantics
of mApzScrollPos to handle the case where multiple relative scrolls happen in a
single transaction. As the implementation now requires multiple relative
ScrollPositionUpdates rather than a single "unified" relative scroll in the
FrameMetrics, we need to update mApzScrollPos for each relative
ScrollPositionUpdate we generate.

Differential Revision: https://phabricator.services.mozilla.com/D88744
2020-09-12 13:06:10 +00:00
Kartikaya Gupta
f334f15463 Bug 1662013 - Replace ScrollUpdateInfo with ScrollPositionUpdate. r=botond
The existing ScrollUpdateInfo that is used to store a "paint-skipped scroll" for
empty transactions is very similar to the new ScrollPositionUpdate class, so
we can delete the former and use the latter instead.

The important part of this change is that when applying the pending info to
a FrameMetrics, we now also append the ScrollUpdateInfo to the mScrollUpdates
list on the ScrollMetadata. This aligns the code with the previous few patches,
where we duplicate the scroll information in both the regular FrameMetrics
fields and the ScrollMetadata::mScrollUpdates array.

Note that the existing code may have a defect when multiple paint-skip scrolls
occur in a single transaction; only the newest one is kept. In the case where
the last paint-skip is an absolute scroll, this is fine, but a relative scroll
may end up clobbering a previous absolute scroll. This patch explicitly detects
the scenario with multiple paint-skip scrolls and bails out to a full paint
transaction. As a followup it should be possible to relax this restriction by
storing an array of pending ScrollPositionUpdate instances.

Differential Revision: https://phabricator.services.mozilla.com/D88743
2020-09-12 13:06:02 +00:00
Kartikaya Gupta
3040008658 Bug 1662013 - Update gtests to also attach ScrollPositionUpdates to metadata. r=botond
Every time the scroll generation is incremented, we now also attach the
equivalent ScrollPositionUpdate instances to the metadata.

Differential Revision: https://phabricator.services.mozilla.com/D88742
2020-09-12 13:05:55 +00:00
Kartikaya Gupta
378887e276 Bug 1662013 - Introduce a ScrollPositionUpdate and plumb it in. r=tnikkel,botond
This adds a ScrollPositionUpdate class. Code in nsGfxScrollFrame creates
instances of these classes every time the scroll generation is incremented,
and saves them to an array. The array is sent in the scroll metadata to the
compositor as part of a paint transaction.

Currently this data is not used at all on the APZ side, and exists alongside
(independently of) the existing scroll fields, so this patch should not have
any functional effects.

Differential Revision: https://phabricator.services.mozilla.com/D88741
2020-09-12 13:05:53 +00:00
sotaro
872ccfe115 Bug 1649088 - Add SharedSurface support with AHardwareBuffer support on android r=jgilbert
AHardwareBuffer could remove several limitations of android::SurfaceTexture.

File descriptor usage of current implementation is not efficient. It is going to be addressed by Bug 1663381.

Differential Revision: https://phabricator.services.mozilla.com/D89232
2020-09-11 03:11:45 +00:00
Gerald Squelart
a087b2df35 Bug 1663554 - Convert AUTO_PROFILER_TEXT_MARKER_... to new AUTO_PROFILER_MARKER_TEXT - r=gregtatum
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.

The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.

As a bonus, a specific start time can optionally be provided at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D89588
2020-09-11 00:42:51 +00:00
Gerald Squelart
b0bf2c2172 Bug 1663554 - Convert PROFILER_ADD_TEXT_MARKER and friends to PROFILER_MARKER_TEXT - r=gregtatum
Mostly mechanical changes, with some work needed to convert the different payloads (with optional timestamps, inner window id, and/or backtrace) to the equivalent MarkerOptions.

Differential Revision: https://phabricator.services.mozilla.com/D89587
2020-09-11 00:41:27 +00:00
Gerald Squelart
5f9ff13253 Bug 1663543 - Convert PROFILER_ADD_MARKER and 2-arg profiler_add_marker to PROFILER_MARKER_UNTYPED - r=gregtatum
Mostly mechanical change, with some extra work where non-literal names are provided.
Also, when this is the only profiler call in a file, `#include "GeckoProfiler.h"` can be changed to `#include "mozilla/ProfilerMarkers.h"`.

Differential Revision: https://phabricator.services.mozilla.com/D89415
2020-09-10 03:02:36 +00:00
Kartikaya Gupta
69f4be4dfe Bug 1648491 - Add a test. r=botond
Depends on D89303

Differential Revision: https://phabricator.services.mozilla.com/D89304
2020-09-09 20:38:02 +00:00
Kartikaya Gupta
803a237d97 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
APZ can sometimes indicate that it will be consuming touch events, even though
the touch-action properties prohibit it. This can happen if, for example, APZ
is waiting on the main-thread for accurate touch-action information. In such
cases, the main thread has enough information to filter out these false positives.
This patch makes it do that, by plumbing the allowed touch behaviors into
the APZEventState code that triggers the pointercancel event.

Differential Revision: https://phabricator.services.mozilla.com/D89303
2020-09-09 19:57:36 +00:00
Andrew Osmond
221455cf7a Bug 1663923 - Cover more WebRender initialization failure paths with explicit reasons. r=kvark
Differential Revision: https://phabricator.services.mozilla.com/D89596
2020-09-09 15:47:46 +00:00
sotaro
15bba66fef Bug 1663574 - Prevent to send invalid file descriptor by OpDeliverReleaseFence message r=jnicol
When invalid file descriptor is sent via IPC, it causes error log.

Differential Revision: https://phabricator.services.mozilla.com/D89416
2020-09-09 02:02:45 +00:00
sotaro
54ede5160d Bug 1460499 - Use DirectComposition for hardware decoded video on Windows r=nical
Use ID3D11VideoProcessor for video frame rendering.

WebRenderError::VIDEO_OVERLAY does not cause disabling WebRender. It just change gfxVars::UseWebRenderDCompVideoOverlayWin() to false.

Differential Revision: https://phabricator.services.mozilla.com/D88763
2020-09-09 01:04:53 +00:00
sotaro
cec0924a4c Bug 1660750 - Fix timeout handling of AndroidHardwareBufferManager::WaitForBufferOwnership() r=jnicol
Prevent infinite wait at mMonitor.Wait(). And gfxCriticalNote log with shorter wait period.

Differential Revision: https://phabricator.services.mozilla.com/D89412
2020-09-08 13:21:14 +00:00
Andrew Osmond
c45c3ac881 Bug 1662836 - Expose detailed initialization failure reason for WebRender. r=kvark
We don't know why we see initialization failures in the telemetry which
makes it hard to investigate why users aren't getting WebRender and
instead fallback to basic. Let's expose the detailed error message
WebRender already generates and puts in the critical log.

Differential Revision: https://phabricator.services.mozilla.com/D89185
2020-09-08 02:03:26 +00:00
stransky
71fe4bae47 Bug 1460959 [Linux] Clear alpha channel from decoded video on BasicCompositor, r=sotaro
libyuv library used for software decode UYV video formats to RGB produces also alpha for RGBX formats.
As we use OP_OVER in Basic compositor, the alpha channel is copied to final surface which is sent to window manager.
When alpha X11 visual is used, the bogus alpha information is used for blending and the video is transparent,
co we need to clear the alpha information from the video surface.

Differential Revision: https://phabricator.services.mozilla.com/D88558
2020-09-03 12:59:25 +00:00
sotaro
64acea96e5 Bug 1658684 - Add android Fence handling to WebRender r=nical
Release fence is delivered from RenderCompositorEGL to WebRenderImageHost via AsyncImagePipelineManager. And the fence is sent to client side by ImageBridgeParent.

Differential Revision: https://phabricator.services.mozilla.com/D88158
2020-09-02 14:21:36 +00:00
Nathan Froyd
cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Kartikaya Gupta
901ef7b52b Bug 1661897 - Add a test. r=botond
The new promiseMouseDragEvent function is an async promise-returning copy of
the code in dragVerticalScrollbar. Eventually we should just make all this code
using async/promise but that's for another day.

Differential Revision: https://phabricator.services.mozilla.com/D88894
2020-09-01 18:18:09 +00:00
Narcis Beleuzu
b4560d9e94 Backed out 2 changesets (bug 1661897) for mochitest failures on test_group_mouseevents.html . CLOSED TREE
Backed out changeset 34ee0403ab1e (bug 1661897)
Backed out changeset f83db4b41bf6 (bug 1661897)
2020-09-01 07:47:59 +03:00
Kartikaya Gupta
714241d600 Bug 1661897 - Add a test. r=botond
The new promiseMouseDragEvent function is an async promise-returning copy of
the code in dragVerticalScrollbar. Eventually we should just make all this code
using async/promise but that's for another day.

Differential Revision: https://phabricator.services.mozilla.com/D88894
2020-09-01 00:05:31 +00:00
Sylvestre Ledru
9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis
261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru
939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
sotaro
d97a94eb95 Bug 1661189 - Make directly texture bounded buffers are not held by AsyncImagePipelineManager::mTexturesInUseByGPU on Android r=mattwoodrow
For android SurfaceTexture and AndroidHardwareBuffer, GPU/hardware task end could be checked by android fence. Then their TextureHost do not need to be held by AsyncImagePipelineManager::mTexturesInUseByGPU.

Differential Revision: https://phabricator.services.mozilla.com/D88239
2020-08-30 04:41:24 +00:00
Kartikaya Gupta
819129d5a5 Bug 1661755 - Update logging. r=tnikkel
This looks like a holdover from when we added ScrollMetadata as a superobject
of FrameMetrics.

Depends on D88648

Differential Revision: https://phabricator.services.mozilla.com/D88649
2020-08-28 20:43:50 +00:00
Kartikaya Gupta
3fe67ce9e6 Bug 1661492 - Auto-advance migration in the absence of further action. r=jaws,botond
This advances the migration by 25% each release, starting in release 83 and
completing in 86. The migration code can be removed in the 86 nightly cycle
(or anytime after that).

Differential Revision: https://phabricator.services.mozilla.com/D88453
2020-08-28 18:01:33 +00:00
Jeff Gilbert
d5ab1eeedf Bug 1654211 - Hold WeakPtr to PresistentBufferProvider in BorrowedSourceSurface. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D88071
2020-08-25 15:36:11 +00:00
Gerald Squelart
3cbc9b5572 Bug 1659404 - Fix non-MOZ_GECKO_PROFILER build - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D88375
2020-08-27 14:41:46 +00:00
Markus Stange
a7d49adfc1 Bug 1592031 - Add profiler screenshots functionality to NativeLayerSnapshotter. r=mattwoodrow
Depends on D59157

Differential Revision: https://phabricator.services.mozilla.com/D59158
2020-08-27 03:55:53 +00:00
Markus Stange
2407ba66f7 Bug 1592031 - Rename CompositorScreenshotGrabber to ScreenshotGrabber and give it a more generic interface. r=mattwoodrow
There already exist 3 implementations of this stuff and I don't want to add another one for the WR OS compositor path.
(The three implementations are: CompositorScreenshotGrabber, MLGPUScreenshotGrabber and RendererScreenshotGrabber.)
The interface has been designed in such a way that the MLGPU and WR implementations should be able to use it but I
haven't written the code to convert them.

Differential Revision: https://phabricator.services.mozilla.com/D59157
2020-08-27 03:55:33 +00:00
Kartikaya Gupta
a7a45c51db Bug 1652851 - Add some gtests to exercise the fixes. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D88011
2020-08-27 01:32:12 +00:00
Kartikaya Gupta
dad0204729 Bug 1652851 - Force touch blocks in slop to be processed after the long-tap delay. r=botond
If the content response timeout is longer than the long-tap delay (which is
true given the current default pref values), and a touch block waits for the
entire content response timeout period, then the long-tap gesture gets delayed
by the difference in the timeouts. This can happen if the input block remains
in the slop state (and therefore never dispatches a touchmove to content,
thereby preventing the content from producing a content response). This patch
catches this scenario and installs a long-tap timeout in the InputQueue to
force the input block along.

Differential Revision: https://phabricator.services.mozilla.com/D88010
2020-08-27 01:30:03 +00:00
Kartikaya Gupta
99d735db3d Bug 1652851 - Shorten GestureEventListener delayed tasks by the content response wait. r=botond
Touch inputs that go to the GestureEventListener often have to wait in the
InputQueue for some time as well, until the content response arrives. However,
that delay is not accounted for in the GestureEventListener delays. This can
result in the gesture being artificially delayed from a user's perspective.

This patch computes the amount of time the input event already waited in the
input queue, and shortens the delays used in the GestureEventListener
accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D88009
2020-08-27 01:29:59 +00:00
Hiroyuki Ikezoe
3fc3e2d805 Bug 1660089 - Use the nearest scrollable frame as the clip frame if the scrollable frame is overflow:hidden. r=botond
Without this change, the transition in the reftest in this commit has never
been composited because it's misrecognized as __jank__.
(Note that a tricky part to understand the jank is that we expand the pre-render
region based on the transformed frame size [1], in this case it's 400px width,
so that the expanded area will be smaller than the size based on 800px.)

[1] https://searchfox.org/mozilla-central/rev/73a14f1b367948faa571ed2fe5d7eb29460787c1/layout/base/nsLayoutUtils.cpp#10043,10045

Differential Revision: https://phabricator.services.mozilla.com/D88199
2020-08-27 00:09:59 +00:00
Matt Woodrow
6f7c7f28dc Bug 1659760 - Specify correct FOURCC yuv type when converting IOSurfaces to RGB. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D88238
2020-08-26 12:46:37 +00:00