From 8a4d84a51a42d45ce799525a0970d096bd650ba5 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 24 Nov 2015 16:09:04 +0530 Subject: [PATCH] Bug 1059014 (part 3) - Remove support for pausing and resuming painting. r=dbaron. This reverts much of part 2 of bug 878935, except for the Android browser.js changes which have already been reverted elsewhere. The revert caused mass b2g Gij test bustages --- docshell/base/nsIContentViewer.idl | 14 +---------- layout/base/nsDocumentViewer.cpp | 39 ------------------------------ layout/base/nsIPresShell.h | 21 +++------------- layout/base/nsPresShell.cpp | 28 --------------------- layout/base/nsPresShell.h | 3 --- 5 files changed, 4 insertions(+), 101 deletions(-) diff --git a/docshell/base/nsIContentViewer.idl b/docshell/base/nsIContentViewer.idl index 6dacc421532e..6484b0a60d6f 100644 --- a/docshell/base/nsIContentViewer.idl +++ b/docshell/base/nsIContentViewer.idl @@ -31,7 +31,7 @@ class nsDOMNavigationTiming; [ptr] native nsDOMNavigationTimingPtr(nsDOMNavigationTiming); [ref] native nsIContentViewerTArray(nsTArray >); -[scriptable, builtinclass, uuid(2da17016-7851-4a45-a7a8-00b360e01595)] +[scriptable, builtinclass, uuid(91b6c1f3-fc5f-43a9-88f4-9286bd19387f)] interface nsIContentViewer : nsISupports { [noscript] void init(in nsIWidgetPtr aParentWidget, @@ -229,18 +229,6 @@ interface nsIContentViewer : nsISupports */ [noscript] void appendSubtree(in nsIContentViewerTArray array); - /** - * Instruct the refresh driver to discontinue painting until further - * notice. - */ - void pausePainting(); - - /** - * Instruct the refresh driver to resume painting after a previous call to - * pausePainting(). - */ - void resumePainting(); - /* * Render the document as if being viewed on a device with the specified * media type. This will cause a reflow. diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 004b3c1ce370..dc177d85a13c 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2774,17 +2774,6 @@ nsDocumentViewer::CallChildren(CallChildFunc aFunc, void* aClosure) } } -static void -ChangeChildPaintingEnabled(nsIContentViewer* aChild, void* aClosure) -{ - bool* enablePainting = (bool*) aClosure; - if (*enablePainting) { - aChild->ResumePainting(); - } else { - aChild->PausePainting(); - } -} - struct ZoomInfo { float mZoom; @@ -3214,34 +3203,6 @@ NS_IMETHODIMP nsDocumentViewer::AppendSubtree(nsTArrayPausePainting(); - } - - return NS_OK; -} - -NS_IMETHODIMP -nsDocumentViewer::ResumePainting() -{ - bool enablePaint = true; - CallChildren(ChangeChildPaintingEnabled, &enablePaint); - - nsIPresShell* presShell = GetPresShell(); - if (presShell) { - presShell->ResumePainting(); - } - - return NS_OK; -} - NS_IMETHODIMP nsDocumentViewer::GetContentSize(int32_t* aWidth, int32_t* aHeight) { diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index e1a4c9616033..e69c1c5488ae 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -140,10 +140,10 @@ typedef struct CapturingContentInfo { mozilla::StaticRefPtr mContent; } CapturingContentInfo; -// e3042b8d-0cc0-4ee6-baca-fec1ba89ee97 +// 327d78a0-0680-4709-b209-1cf9578720e6 #define NS_IPRESSHELL_IID \ -{ 0xe3042b8d, 0x0cc0, 0x4ee6, \ - { 0xba, 0xca, 0xfe, 0xc1, 0xba, 0x89, 0xee, 0x97 } } +{ 0x327d78a0, 0x0680, 0x4709, \ + { 0xb2, 0x09, 0x1c, 0xf9, 0x57, 0x87, 0x20, 0xe6 } } // debug VerifyReflow flags #define VERIFY_REFLOW_ON 0x01 @@ -936,20 +936,6 @@ public: */ bool IsPaintingSuppressed() const { return mPaintingSuppressed; } - /** - * Pause painting by freezing the refresh driver of this and all parent - * presentations. This may not have the desired effect if this pres shell - * has its own refresh driver. - */ - virtual void PausePainting() = 0; - - /** - * Resume painting by thawing the refresh driver of this and all parent - * presentations. This may not have the desired effect if this pres shell - * has its own refresh driver. - */ - virtual void ResumePainting() = 0; - /** * Unsuppress painting. */ @@ -1813,7 +1799,6 @@ protected: bool mFontSizeInflationForceEnabled; bool mFontSizeInflationDisabledInMasterProcess; bool mFontSizeInflationEnabled; - bool mPaintingIsFrozen; // Dirty bit indicating that mFontSizeInflationEnabled needs to be recomputed. bool mFontSizeInflationEnabledIsDirty; diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 4ff0e57a4117..9516f525bdf6 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -799,7 +799,6 @@ PresShell::PresShell() addedPointerEventEnabled = true; } - mPaintingIsFrozen = false; mHasCSSBackgroundColor = true; mIsLastChromeOnlyEscapeKeyConsumed = false; mHasReceivedPaintMessage = false; @@ -823,13 +822,6 @@ PresShell::~PresShell() mLastCallbackEventRequest == nullptr, "post-reflow queues not empty. This means we're leaking"); - // Verify that if painting was frozen, but we're being removed from the tree, - // that we now re-enable painting on our refresh driver, since it may need to - // be re-used by another presentation. - if (mPaintingIsFrozen) { - mPresContext->RefreshDriver()->Thaw(); - } - #ifdef DEBUG MOZ_ASSERT(mPresArenaAllocCount == 0, "Some pres arena objects were not freed"); @@ -10851,26 +10843,6 @@ nsIPresShell::FontSizeInflationEnabled() return mFontSizeInflationEnabled; } -void -PresShell::PausePainting() -{ - if (GetPresContext()->RefreshDriver()->PresContext() != GetPresContext()) - return; - - mPaintingIsFrozen = true; - GetPresContext()->RefreshDriver()->Freeze(); -} - -void -PresShell::ResumePainting() -{ - if (GetPresContext()->RefreshDriver()->PresContext() != GetPresContext()) - return; - - mPaintingIsFrozen = false; - GetPresContext()->RefreshDriver()->Thaw(); -} - void nsIPresShell::SyncWindowProperties(nsView* aView) { diff --git a/layout/base/nsPresShell.h b/layout/base/nsPresShell.h index 3eaf6a70d9cf..dcd8402b3450 100644 --- a/layout/base/nsPresShell.h +++ b/layout/base/nsPresShell.h @@ -738,9 +738,6 @@ protected: virtual void ThemeChanged() override { mPresContext->ThemeChanged(); } virtual void BackingScaleFactorChanged() override { mPresContext->UIResolutionChanged(); } - virtual void PausePainting() override; - virtual void ResumePainting() override; - void UpdateImageVisibility(); void UpdateActivePointerState(mozilla::WidgetGUIEvent* aEvent);