Skip to content

Commit

Permalink
Bug 1228125 (part 3) - Remove nsIWidget::GetClientBoundsUntyped(). r=…
Browse files Browse the repository at this point in the history
…botond.

--HG--
extra : rebase_source : 5e8cb05213c33983d7deebe0a36f2a4f6ac66375
  • Loading branch information
nnethercote committed Nov 26, 2015
1 parent d6e3e8a commit af08555
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
6 changes: 3 additions & 3 deletions gfx/layers/d3d11/CompositorD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,10 +1205,10 @@ CompositorD3D11::PrepareViewport(const gfx::IntSize& aSize,
void
CompositorD3D11::EnsureSize()
{
IntRect rect;
mWidget->GetClientBoundsUntyped(rect);
LayoutDeviceIntRect rect;
mWidget->GetClientBounds(rect);

mSize = rect.Size();
mSize = rect.Size().ToUnknownSize();
}

bool
Expand Down
6 changes: 3 additions & 3 deletions gfx/layers/d3d9/CompositorD3D9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,10 @@ CompositorD3D9::PrepareViewport(const gfx::IntSize& aSize)
void
CompositorD3D9::EnsureSize()
{
IntRect rect;
mWidget->GetClientBoundsUntyped(rect);
LayoutDeviceIntRect rect;
mWidget->GetClientBounds(rect);

mSize = rect.Size();
mSize = rect.Size().ToUnknownSize();
}

void
Expand Down
8 changes: 4 additions & 4 deletions view/nsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,21 +298,21 @@ void nsView::DoResetWidgetBounds(bool aMoveOnly,

// Stash a copy of these and use them so we can handle this being deleted (say
// from sync painting/flushing from Show/Move/Resize on the widget).
nsIntRect newBounds;
LayoutDeviceIntRect newBounds;
RefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();

nsWindowType type = widget->WindowType();

nsIntRect curBounds;
widget->GetClientBoundsUntyped(curBounds);
LayoutDeviceIntRect curBounds;
widget->GetClientBounds(curBounds);
bool invisiblePopup = type == eWindowType_popup &&
((curBounds.IsEmpty() && mDimBounds.IsEmpty()) ||
mVis == nsViewVisibility_kHide);

if (invisiblePopup) {
// We're going to hit the early exit below, avoid calling CalcWidgetBounds.
} else {
newBounds = CalcWidgetBounds(type);
newBounds = LayoutDeviceIntRect::FromUnknownRect(CalcWidgetBounds(type));
}

bool curVisibility = widget->IsVisible();
Expand Down
9 changes: 0 additions & 9 deletions widget/nsIWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,19 +850,10 @@ class nsIWidget : public nsISupports {
* position of the client area relative to the client area of the parent
* widget (for root widgets and popup widgets it is in screen coordinates).
*
* The untyped version exists temporarily to ease conversion to typed
* coordinates.
*
* @param aRect On return it holds the x. y, width and height of
* the client area of this widget.
*/
NS_IMETHOD GetClientBounds(mozilla::LayoutDeviceIntRect& aRect) = 0;
NS_IMETHOD GetClientBoundsUntyped(nsIntRect& aRect) {
LayoutDeviceIntRect tmp;
nsresult rv = GetClientBounds(tmp);
aRect = tmp.ToUnknownRect();
return rv;
}

/**
* Get the non-client area dimensions of the window.
Expand Down
8 changes: 4 additions & 4 deletions xpfe/appshell/nsWebShellWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,

// XXX: need to get the default window size from prefs...
// Doesn't come from prefs... will come from CSS/XUL/RDF
nsIntRect r(initialX, initialY, aInitialWidth, aInitialHeight);
LayoutDeviceIntRect r(initialX, initialY, aInitialWidth, aInitialHeight);

// Create top level window
mWindow = do_CreateInstance(kWindowCID, &rv);
if (NS_OK != rv) {
Expand All @@ -173,9 +173,9 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
mWindow->SetWidgetListener(this);
mWindow->Create((nsIWidget *)parentWidget, // Parent nsIWidget
nullptr, // Native parent widget
r, // Widget dimensions
r.ToUnknownRect(), // Widget dimensions
&widgetInitData); // Widget initialization data
mWindow->GetClientBoundsUntyped(r);
mWindow->GetClientBounds(r);
// Match the default background color of content. Important on windows
// since we no longer use content child widgets.
mWindow->SetBackgroundColor(NS_RGB(255,255,255));
Expand Down

0 comments on commit af08555

Please sign in to comment.