Commit 6e85ccca authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1742358 - Use non-blank paint rather than contentful paint to fix...

Bug 1742358 - Use non-blank paint rather than contentful paint to fix test_drawWindow_widget_layers.html, which relies on transparent clear.

MANUAL PUSH: Orange fix CLOSED TREE
parent 7b301640
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -2590,6 +2590,11 @@ void nsPresContext::NotifyNonBlankPaint() {

    mFirstNonBlankPaintTime = TimeStamp::Now();
  }
  if (IsChrome() && IsRoot()) {
    if (nsCOMPtr<nsIWidget> rootWidget = GetRootWidget()) {
      rootWidget->DidGetNonBlankPaint();
    }
  }
}

void nsPresContext::NotifyContentfulPaint() {
@@ -2606,11 +2611,6 @@ void nsPresContext::NotifyContentfulPaint() {
                              CanBubble::eYes, ChromeOnlyDispatch::eYes))
        ->PostDOMEvent();
#endif
    if (rootPresContext == this && IsChrome()) {
      if (nsCOMPtr<nsIWidget> rootWidget = GetRootWidget()) {
        rootWidget->DidGetContentfulPaint();
      }
    }
  }
  if (!rootPresContext->RefreshDriver()->IsInRefresh()) {
    if (!mHadNonTickContentfulPaint) {
+4 −4
Original line number Diff line number Diff line
@@ -416,7 +416,7 @@ nsWindow::nsWindow()
      mPreferredPopupRectFlushed(false),
      mWaitingForMoveToRectCallback(false),
      mConfiguredClearColor(false),
      mGotContentfulPaint(false) {
      mGotNonBlankPaint(false) {
  mWindowType = eWindowType_child;
  mSizeConstraints.mMaxSize = GetSafeWindowSize(mSizeConstraints.mMaxSize);

@@ -8376,11 +8376,11 @@ nsIWidget::WindowRenderer* nsWindow::GetWindowRenderer() {
  return nsBaseWidget::GetWindowRenderer();
}

void nsWindow::DidGetContentfulPaint() {
  if (mGotContentfulPaint) {
void nsWindow::DidGetNonBlankPaint() {
  if (mGotNonBlankPaint) {
    return;
  }
  mGotContentfulPaint = true;
  mGotNonBlankPaint = true;
  if (!mConfiguredClearColor) {
    // Nothing to do, we hadn't overridden the clear color.
    mConfiguredClearColor = true;
+3 −3
Original line number Diff line number Diff line
@@ -692,9 +692,9 @@ class nsWindow final : public nsBaseWidget {

  // Whether we've configured default clear color already.
  bool mConfiguredClearColor : 1;
  // Whether we've received a contentful paint in which case we can reset the
  // Whether we've received a non-blank paint in which case we can reset the
  // clear color to transparent.
  bool mGotContentfulPaint : 1;
  bool mGotNonBlankPaint : 1;

  // This bitmap tracks which pixels are transparent. We don't support
  // full translucency at this time; each pixel is either fully opaque
@@ -724,7 +724,7 @@ class nsWindow final : public nsBaseWidget {

  // nsBaseWidget
  WindowRenderer* GetWindowRenderer() override;
  void DidGetContentfulPaint() override;
  void DidGetNonBlankPaint() override;

  void SetCompositorWidgetDelegate(CompositorWidgetDelegate* delegate) override;

+2 −2
Original line number Diff line number Diff line
@@ -534,9 +534,9 @@ class nsIWidget : public nsISupports {
  virtual nsIWidgetListener* GetPreviouslyAttachedWidgetListener() = 0;

  /**
   * Notifies the root widget of a contentful paint.
   * Notifies the root widget of a non-blank paint.
   */
  virtual void DidGetContentfulPaint() {}
  virtual void DidGetNonBlankPaint() {}

  /**
   * Accessor functions to get and set the listener which handles various