Bug 868726 - Outparamdel nsViewManager::GetDeviceContext; r=tn

This commit is contained in:
Ms2ger 2013-05-10 09:13:49 +02:00
Родитель 0a31632142
Коммит 9845580de2
4 изменённых файлов: 11 добавлений и 23 удалений

Просмотреть файл

@ -420,8 +420,7 @@ nsObjectFrame::PrepForDrawing(nsIWidget *aWidget)
configuration->mBounds.height = NSAppUnitsToIntPixels(mRect.height, appUnitsPerDevPixel);
parentWidget->ConfigureChildren(configurations);
nsRefPtr<nsDeviceContext> dx;
viewMan->GetDeviceContext(*getter_AddRefs(dx));
nsRefPtr<nsDeviceContext> dx = viewMan->GetDeviceContext();
mInnerView->AttachWidgetEventHandler(mWidget);
#ifdef XP_MACOSX

Просмотреть файл

@ -232,9 +232,11 @@ public:
/**
* Get the device context associated with this manager
* @result device context
*/
void GetDeviceContext(nsDeviceContext *&aContext);
nsDeviceContext* GetDeviceContext() const
{
return mContext;
}
/**
* A stack class for disallowing changes that would enter painting. For

Просмотреть файл

@ -237,8 +237,7 @@ 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;
nsRefPtr<nsDeviceContext> dx;
mViewManager->GetDeviceContext(*getter_AddRefs(dx));
nsRefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();
nsWindowType type;
widget->GetWindowType(type);
@ -519,8 +518,7 @@ nsresult nsView::CreateWidget(nsWidgetInitData *aWidgetInitData,
nsIntRect trect = CalcWidgetBounds(aWidgetInitData->mWindowType);
nsRefPtr<nsDeviceContext> dx;
mViewManager->GetDeviceContext(*getter_AddRefs(dx));
nsRefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();
nsIWidget* parentWidget =
GetParent() ? GetParent()->GetNearestWidget(nullptr) : nullptr;
@ -558,8 +556,7 @@ nsresult nsView::CreateWidgetForParent(nsIWidget* aParentWidget,
nsIntRect trect = CalcWidgetBounds(aWidgetInitData->mWindowType);
nsRefPtr<nsDeviceContext> dx;
mViewManager->GetDeviceContext(*getter_AddRefs(dx));
nsRefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();
mWindow =
aParentWidget->CreateChild(trect, dx, aWidgetInitData).get();
@ -584,8 +581,7 @@ nsresult nsView::CreateWidgetForPopup(nsWidgetInitData *aWidgetInitData,
nsIntRect trect = CalcWidgetBounds(aWidgetInitData->mWindowType);
nsRefPtr<nsDeviceContext> dx;
mViewManager->GetDeviceContext(*getter_AddRefs(dx));
nsRefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();
// XXX/cjones: having these two separate creation cases seems ... um
// ... unnecessary, but it's the way the old code did it. Please
@ -653,8 +649,7 @@ nsresult nsView::AttachToTopLevelWidget(nsIWidget* aWidget)
}
}
nsRefPtr<nsDeviceContext> dx;
mViewManager->GetDeviceContext(*getter_AddRefs(dx));
nsRefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext();
// Note, the previous device context will be released. Detaching
// will not restore the old one.
@ -952,8 +947,7 @@ nsView::WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight)
// window creation
SetForcedRepaint(true);
if (this == mViewManager->GetRootView()) {
nsRefPtr<nsDeviceContext> devContext;
mViewManager->GetDeviceContext(*getter_AddRefs(devContext));
nsRefPtr<nsDeviceContext> devContext = mViewManager->GetDeviceContext();
// ensure DPI is up-to-date, in case of window being opened and sized
// on a non-default-dpi display (bug 829963)
devContext->CheckDPIChange();

Просмотреть файл

@ -1036,13 +1036,6 @@ nsViewManager::SetViewZIndex(nsView *aView, bool aAutoZIndex, int32_t aZIndex, b
}
}
void
nsViewManager::GetDeviceContext(nsDeviceContext *&aContext)
{
aContext = mContext;
NS_IF_ADDREF(aContext);
}
nsViewManager*
nsViewManager::IncrementDisableRefreshCount()
{