mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1821256 [Linux] Don't throttle webrender transactions on unmapped windows r=emilio
Based on patch by Emilio Cobos Álvarez (D172786) Differential Revision: https://phabricator.services.mozilla.com/D173846
This commit is contained in:
parent
169e55791f
commit
b10d18f470
@ -257,8 +257,9 @@ bool WebRenderLayerManager::EndEmptyTransaction(EndTransactionFlags aFlags) {
|
||||
// Since we don't do repeat transactions right now, just set the time
|
||||
mAnimationReadyTime = TimeStamp::Now();
|
||||
|
||||
mLatestTransactionId =
|
||||
mTransactionIdAllocator->GetTransactionId(/*aThrottle*/ true);
|
||||
// Don't block on hidden windows on Linux as it may block all rendering.
|
||||
const bool throttle = mWidget->IsMapped();
|
||||
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId(throttle);
|
||||
|
||||
if (aFlags & EndTransactionFlags::END_NO_COMPOSITE &&
|
||||
!mWebRenderCommandBuilder.NeedsEmptyTransaction()) {
|
||||
@ -406,8 +407,9 @@ void WebRenderLayerManager::EndTransactionWithoutLayer(
|
||||
nsLayoutUtils::NotifyPaintSkipTransaction(update);
|
||||
}
|
||||
|
||||
mLatestTransactionId =
|
||||
mTransactionIdAllocator->GetTransactionId(/*aThrottle*/ true);
|
||||
// Don't block on hidden windows on Linux as it may block all rendering.
|
||||
const bool throttle = mWidget->IsMapped();
|
||||
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId(throttle);
|
||||
|
||||
// Get the time of when the refresh driver start its tick (if available),
|
||||
// otherwise use the time of when LayerManager::BeginTransaction was called.
|
||||
|
@ -809,6 +809,12 @@ void nsWindow::SetModal(bool aModal) {
|
||||
// nsIWidget method, which means IsShown.
|
||||
bool nsWindow::IsVisible() const { return mIsShown; }
|
||||
|
||||
bool nsWindow::IsMapped() const {
|
||||
// TODO: Enable for X11 when Mozilla testsuite is moved to new
|
||||
// testing environment from Ubuntu 18.04 which is broken.
|
||||
return GdkIsWaylandDisplay() ? mIsMapped : true;
|
||||
}
|
||||
|
||||
void nsWindow::RegisterTouchWindow() {
|
||||
mHandleTouchEvent = true;
|
||||
mTouches.Clear();
|
||||
|
@ -155,6 +155,7 @@ class nsWindow final : public nsBaseWidget {
|
||||
void SetParent(nsIWidget* aNewParent) override;
|
||||
void SetModal(bool aModal) override;
|
||||
bool IsVisible() const override;
|
||||
bool IsMapped() const override;
|
||||
void ConstrainPosition(bool aAllowSlop, int32_t* aX, int32_t* aY) override;
|
||||
void SetSizeConstraints(const SizeConstraints& aConstraints) override;
|
||||
void LockAspectRatio(bool aShouldLock) override;
|
||||
@ -281,7 +282,6 @@ class nsWindow final : public nsBaseWidget {
|
||||
nsIFrame* GetFrame() const;
|
||||
nsWindow* GetEffectiveParent();
|
||||
bool IsDestroyed() const { return mIsDestroyed; }
|
||||
bool IsMapped() const { return mIsMapped; }
|
||||
bool IsPopup() const;
|
||||
bool IsWaylandPopup() const;
|
||||
bool IsPIPWindow() const { return mIsPIPWindow; };
|
||||
|
@ -687,6 +687,14 @@ class nsIWidget : public nsISupports {
|
||||
*/
|
||||
virtual bool IsVisible() const = 0;
|
||||
|
||||
/**
|
||||
* Returns whether the window has allocated resources so
|
||||
* we can paint into it.
|
||||
* Recently it's used on Linux/Gtk where we should not paint
|
||||
* to invisible window.
|
||||
*/
|
||||
virtual bool IsMapped() const { return true; }
|
||||
|
||||
/**
|
||||
* Perform platform-dependent sanity check on a potential window position.
|
||||
* This is guaranteed to work only for top-level windows.
|
||||
|
Loading…
Reference in New Issue
Block a user