Commit c3e063e1 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez Committed by ealvarez@mozilla.com
Browse files

Bug 1967530 - Remove AssumeThemePartAndStateAreTransparent. r=win-reviewers,handyman

We no longer draw native menus.

Differential Revision: https://phabricator.services.mozilla.com/D250288
parent 4813a0eb
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -781,15 +781,6 @@ nsresult nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame,
  }
}

static bool AssumeThemePartAndStateAreTransparent(int32_t aPart,
                                                  int32_t aState) {
  if (!LookAndFeel::GetInt(LookAndFeel::IntID::UseAccessibilityTheme) &&
      aPart == MENU_POPUPITEM && aState == MBI_NORMAL) {
    return true;
  }
  return false;
}

// When running with per-monitor DPI (on Win8.1+), and rendering on a display
// with a different DPI setting from the system's default scaling, we need to
// apply scaling to native-themed elements as the Windows theme APIs assume
@@ -832,10 +823,6 @@ void nsNativeThemeWin::DrawWidgetBackground(
    return;
  }

  if (AssumeThemePartAndStateAreTransparent(part, state)) {
    return;
  }

  gfxContextMatrixAutoSaveRestore save(aContext);

  double themeScale = GetThemeDpiScaleFactor(aFrame);
@@ -1628,10 +1615,6 @@ nsresult nsNativeThemeWin::ClassicDrawWidgetBackground(
  MOZ_TRY(
      ClassicGetThemePartAndState(aFrame, aAppearance, part, state, focused));

  if (AssumeThemePartAndStateAreTransparent(part, state)) {
    return NS_OK;
  }

  gfxFloat p2a = gfxFloat(aFrame->PresContext()->AppUnitsPerDevPixel());
  RECT widgetRect;
  gfxRect tr(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height()),