From f3a6b16638acd9950824de0fc734ab93d1bb97b1 Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Thu, 1 Jul 2010 17:45:14 -0400 Subject: [PATCH] Bug 575962 - top window accelerated ENV variable. r=roc --HG-- extra : rebase_source : 53f4400af98bcf06d0c01a13edc814a50f571435 --- xpfe/appshell/src/nsXULWindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 3cd09a9f2f2..311eeb849cb 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -96,6 +96,8 @@ #include "nsWebShellWindow.h" // get rid of this one, too... +#include "prenv.h" + #define SIZEMODE_NORMAL NS_LITERAL_STRING("normal") #define SIZEMODE_MAXIMIZED NS_LITERAL_STRING("maximized") #define SIZEMODE_MINIMIZED NS_LITERAL_STRING("minimized") @@ -1387,7 +1389,13 @@ void nsXULWindow::SyncAttributesToWidget() // "accelerated" attribute PRBool isAccelerated; - rv = windowElement->HasAttribute(NS_LITERAL_STRING("accelerated"), &isAccelerated); + static const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED"); + if (acceleratedEnv && *acceleratedEnv) { + isAccelerated = *acceleratedEnv != '0'; + rv = NS_OK; + } else + rv = windowElement->HasAttribute(NS_LITERAL_STRING("accelerated"), &isAccelerated); + if (NS_SUCCEEDED(rv)) { mWindow->SetAcceleratedRendering(isAccelerated); }