Backed out changeset 9fbc16390ef7 (bug 1299860) for bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2016-10-06 17:04:40 +02:00
Родитель f10342b425
Коммит 2a026d93ba
9 изменённых файлов: 25 добавлений и 26 удалений

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

@ -356,7 +356,7 @@ public:
NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
nsEventStatus& aStatus) override;
virtual bool WidgetTypeSupportsAcceleration() override;
virtual bool ComputeShouldAccelerate() override;
virtual bool ShouldUseOffMainThreadCompositing() override;
NS_IMETHOD SetCursor(nsCursor aCursor) override;

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

@ -1368,11 +1368,14 @@ NS_IMETHODIMP nsChildView::Invalidate(const LayoutDeviceIntRect& aRect)
}
bool
nsChildView::WidgetTypeSupportsAcceleration()
nsChildView::ComputeShouldAccelerate()
{
// Don't use OpenGL for transparent windows or for popup windows.
return mView && [[mView window] isOpaque] &&
![[mView window] isKindOfClass:[PopupWindow class]]
if (!mView || ![[mView window] isOpaque] ||
[[mView window] isKindOfClass:[PopupWindow class]])
return false;
return nsBaseWidget::ComputeShouldAccelerate();
}
bool

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

@ -479,7 +479,7 @@ nsresult nsCocoaWindow::CreateNativeWindow(const NSRect &aRect,
[mWindow setOpaque:NO];
} else {
// Make sure that regular windows are opaque from the start, so that
// nsChildView::WidgetTypeSupportsAcceleration returns true for them.
// nsChildView::ComputeShouldAccelerate returns true for them.
[mWindow setOpaque:YES];
}

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

@ -871,12 +871,6 @@ nsWindow::SetParent(nsIWidget *aNewParent)
return NS_OK;
}
bool
nsWindow::WidgetTypeSupportsAcceleration()
{
return !IsSmallPopup();
}
void
nsWindow::ReparentNativeWidget(nsIWidget* aNewParent)
{

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

@ -363,7 +363,6 @@ public:
LayoutDeviceIntPoint GdkEventCoordsToDevicePixels(gdouble x, gdouble y);
LayoutDeviceIntRect GdkRectToDevicePixels(GdkRectangle rect);
virtual bool WidgetTypeSupportsAcceleration() override;
protected:
virtual ~nsWindow();

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

@ -936,8 +936,12 @@ bool nsBaseWidget::IsSmallPopup() const
bool
nsBaseWidget::ComputeShouldAccelerate()
{
return gfx::gfxConfig::IsEnabled(gfx::Feature::HW_COMPOSITING) &&
WidgetTypeSupportsAcceleration();
bool enabled = gfx::gfxConfig::IsEnabled(gfx::Feature::HW_COMPOSITING);
#ifdef MOZ_WIDGET_GTK
return enabled && !IsSmallPopup();
#else
return enabled;
#endif
}
bool
@ -1355,12 +1359,8 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
lf->SetShadowManager(shadowManager);
lm->UpdateTextureFactoryIdentifier(textureFactoryIdentifier);
// Some popup or transparent widgets may use a different backend than the
// compositors used with ImageBridge and VR (and more generally web content).
if (WidgetTypeSupportsAcceleration()) {
ImageBridgeChild::IdentifyCompositorTextureHost(textureFactoryIdentifier);
gfx::VRManagerChild::IdentifyTextureHost(textureFactoryIdentifier);
}
ImageBridgeChild::IdentifyCompositorTextureHost(textureFactoryIdentifier);
gfx::VRManagerChild::IdentifyTextureHost(textureFactoryIdentifier);
WindowUsesOMTC();
mLayerManager = lm.forget();

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

@ -272,8 +272,7 @@ public:
const mozilla::WidgetKeyboardEvent& aEvent,
DoCommandCallback aCallback,
void* aCallbackData) override { return false; }
bool ComputeShouldAccelerate();
virtual bool WidgetTypeSupportsAcceleration() { return true; }
virtual bool ComputeShouldAccelerate();
virtual nsIMEUpdatePreference GetIMEUpdatePreference() override { return nsIMEUpdatePreference(); }
NS_IMETHOD OnDefaultButtonLoaded(const LayoutDeviceIntRect& aButtonRect) override { return NS_ERROR_NOT_IMPLEMENTED; }
virtual already_AddRefed<nsIWidget>

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

@ -7796,7 +7796,7 @@ void nsWindow::PickerClosed()
}
bool
nsWindow::WidgetTypeSupportsAcceleration()
nsWindow::ComputeShouldAccelerate()
{
// We don't currently support using an accelerated layer manager with
// transparent windows so don't even try. I'm also not sure if we even
@ -7805,8 +7805,12 @@ nsWindow::WidgetTypeSupportsAcceleration()
// Also see bug 1150376, D3D11 composition can cause issues on some devices
// on Windows 7 where presentation fails randomly for windows with drop
// shadows.
return mTransparencyMode != eTransparencyTransparent &&
!(IsPopup() && DeviceManagerDx::Get()->IsWARP());
if (mTransparencyMode == eTransparencyTransparent ||
(IsPopup() && DeviceManagerDx::Get()->IsWARP()))
{
return false;
}
return nsBaseWidget::ComputeShouldAccelerate();
}
void

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

@ -261,7 +261,7 @@ public:
* Misc.
*/
virtual bool AutoErase(HDC dc);
bool WidgetTypeSupportsAcceleration() override;
bool ComputeShouldAccelerate() override;
void ForcePresent();