From b57d6a338b03f4b5761ab990a92542fe757d289e Mon Sep 17 00:00:00 2001 From: Ali Juma Date: Wed, 13 Jun 2012 15:53:11 -0400 Subject: [PATCH] Bug 703484 - Part 1b: Disable Basic Layers OMTC on OS X because it crashes. r=bgirard --- widget/cocoa/nsChildView.h | 1 + widget/cocoa/nsChildView.mm | 8 ++++++++ widget/xpwidgets/nsBaseWidget.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index e478c638763..c3a4100e3e3 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -416,6 +416,7 @@ public: NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus); virtual bool GetShouldAccelerate(); + virtual bool UseOffMainThreadCompositing(); NS_IMETHOD SetCursor(nsCursor aCursor); NS_IMETHOD SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY); diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index b250d2bb6f9..6f62c5bd36b 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -1399,6 +1399,14 @@ nsChildView::GetShouldAccelerate() return nsBaseWidget::GetShouldAccelerate(); } +bool +nsChildView::UseOffMainThreadCompositing() +{ + // OMTC doesn't work with Basic Layers on OS X right now. Once it works, we'll + // still want to disable it for certain kinds of windows (e.g. popups). + return nsBaseWidget::UseOffMainThreadCompositing() && GetShouldAccelerate(); +} + inline PRUint16 COLOR8TOCOLOR16(PRUint8 color8) { // return (color8 == 0xFF ? 0xFFFF : (color8 << 8)); diff --git a/widget/xpwidgets/nsBaseWidget.h b/widget/xpwidgets/nsBaseWidget.h index e1f55ed9586..b5948967f31 100644 --- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -209,7 +209,7 @@ public: nsWindowType GetWindowType() { return mWindowType; } - static bool UseOffMainThreadCompositing(); + virtual bool UseOffMainThreadCompositing(); protected: virtual void ResolveIconName(const nsAString &aIconName,