Bug 596493 - Disable acceleration on all transparent windows on OS X. r=mstange a=b

This commit is contained in:
Joe Drew 2010-09-29 14:38:39 -04:00
parent e0ceecd56e
commit 2945acde21
2 changed files with 11 additions and 0 deletions

View File

@ -325,6 +325,7 @@ public:
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
NS_IMETHOD Update();
virtual PRBool GetShouldAccelerate();
NS_IMETHOD SetCursor(nsCursor aCursor);
NS_IMETHOD SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY);

View File

@ -1689,6 +1689,16 @@ NS_IMETHODIMP nsChildView::Invalidate(const nsIntRect &aRect, PRBool aIsSynchron
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
PRBool
nsChildView::GetShouldAccelerate()
{
// Don't use OpenGL for transparent windows.
if (!mView || ![[mView window] isOpaque])
return PR_FALSE;
return nsBaseWidget::GetShouldAccelerate();
}
inline PRUint16 COLOR8TOCOLOR16(PRUint8 color8)
{
// return (color8 == 0xFF ? 0xFFFF : (color8 << 8));