2011-05-04 Justin Novosad <junov@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2011 19:20:49 +0000 (19:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2011 19:20:49 +0000 (19:20 +0000)
        Reviewed by Kenneth Russell.

        [Chromium] Add gpu acceleration flags to DumpRenderTree
        https://bugs.webkit.org/show_bug.cgi?id=60168
        Adding support for command line flags
        enable-accelerated-2d-canvas an
        enable-accelerated-drawing in DumpRenderTree.

        * DumpRenderTree/chromium/DumpRenderTree.cpp:
        (main):
        * DumpRenderTree/chromium/TestShell.cpp:
        (TestShell::TestShell):
        (TestShell::resetWebSettings):
        * DumpRenderTree/chromium/TestShell.h:
        (TestShell::setLegacyAccelerated2dCanvasEnabled):
        (TestShell::setAcceleratedDrawingEnabled):
        * DumpRenderTree/chromium/WebPreferences.cpp:
        (WebPreferences::reset):
        (WebPreferences::applyTo):
        * DumpRenderTree/chromium/WebPreferences.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
Tools/DumpRenderTree/chromium/TestShell.cpp
Tools/DumpRenderTree/chromium/TestShell.h
Tools/DumpRenderTree/chromium/WebPreferences.cpp
Tools/DumpRenderTree/chromium/WebPreferences.h

index f84af85..8d8a3c4 100644 (file)
@@ -1,3 +1,26 @@
+2011-05-04  Justin Novosad  <junov@chromium.org>
+
+        Reviewed by Kenneth Russell.
+
+        [Chromium] Add gpu acceleration flags to DumpRenderTree
+        https://bugs.webkit.org/show_bug.cgi?id=60168
+        Adding support for command line flags 
+        enable-accelerated-2d-canvas an
+        enable-accelerated-drawing in DumpRenderTree.
+
+        * DumpRenderTree/chromium/DumpRenderTree.cpp:
+        (main):
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::TestShell):
+        (TestShell::resetWebSettings):
+        * DumpRenderTree/chromium/TestShell.h:
+        (TestShell::setLegacyAccelerated2dCanvasEnabled):
+        (TestShell::setAcceleratedDrawingEnabled):
+        * DumpRenderTree/chromium/WebPreferences.cpp:
+        (WebPreferences::reset):
+        (WebPreferences::applyTo):
+        * DumpRenderTree/chromium/WebPreferences.h:
+
 2011-05-04  Ademar de Souza Reis Jr.  <ademar.reis@openbossa.org>
 
         Reviewed by Csaba Osztrogon√°c.
index c9d3875..4206275 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -56,6 +56,8 @@ static const char optionHardwareAcceleratedGL[] = "--enable-hardware-gpu";
 static const char optionEnableAcceleratedCompositing[] = "--enable-accelerated-compositing";
 static const char optionForceCompositingMode[] = "--force-compositing-mode";
 static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas";
+static const char optionEnableLegacyAccelerated2DCanvas[] = "--enable-legacy-accelerated-2d-canvas";
+static const char optionEnableAcceleratedDrawing[] = "--enable-accelerated-drawing";
 static const char optionEnableCompositeToTexture[] = "--enable-composite-to-texture";
 
 static const char optionStressOpt[] = "--stress-opt";
@@ -137,6 +139,8 @@ int main(int argc, char* argv[])
     bool compositeToTexture = false;
     bool forceCompositingMode = false;
     bool accelerated2DCanvasEnabled = false;
+    bool legacyAccelerated2DCanvasEnabled = false;
+    bool acceleratedDrawingEnabled = false;
     bool stressOpt = false;
     bool stressDeopt = false;
     bool hardwareAcceleratedGL = false;
@@ -176,6 +180,10 @@ int main(int argc, char* argv[])
             forceCompositingMode = true;
         else if (argument == optionEnableAccelerated2DCanvas)
             accelerated2DCanvasEnabled = true;
+        else if (argument == optionEnableLegacyAccelerated2DCanvas)
+            legacyAccelerated2DCanvasEnabled = true;
+        else if (argument == optionEnableAcceleratedDrawing)
+            acceleratedDrawingEnabled = true;
         else if (argument == optionStressOpt)
             stressOpt = true;
         else if (argument == optionStressDeopt)
@@ -210,6 +218,8 @@ int main(int argc, char* argv[])
         shell.setCompositeToTexture(compositeToTexture);
         shell.setForceCompositingMode(forceCompositingMode);
         shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled);
+        shell.setLegacyAccelerated2dCanvasEnabled(legacyAccelerated2DCanvasEnabled);
+        shell.setAcceleratedDrawingEnabled(acceleratedDrawingEnabled);
         shell.setJavaScriptFlags(javaScriptFlags);
         shell.setStressOpt(stressOpt);
         shell.setStressDeopt(stressDeopt);
index 36575a6..41afa10 100644 (file)
@@ -102,6 +102,8 @@ TestShell::TestShell(bool testShellMode)
     , m_compositeToTexture(false)
     , m_forceCompositingMode(false)
     , m_accelerated2dCanvasEnabled(false)
+    , m_legacyAccelerated2dCanvasEnabled(false)
+    , m_acceleratedDrawingEnabled(false)
     , m_stressOpt(false)
     , m_stressDeopt(false)
     , m_dumpWhenFinished(true)
@@ -182,6 +184,8 @@ void TestShell::resetWebSettings(WebView& webView)
     m_prefs.compositeToTexture = m_compositeToTexture;
     m_prefs.forceCompositingMode = m_forceCompositingMode;
     m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled;
+    m_prefs.legacyAccelerated2dCanvasEnabled = m_legacyAccelerated2dCanvasEnabled;
+    m_prefs.acceleratedDrawingEnabled = m_acceleratedDrawingEnabled;
     m_prefs.applyTo(&webView);
 }
 
index 7e99a4c..2a68b24 100644 (file)
@@ -129,7 +129,8 @@ public:
     void setCompositeToTexture(bool enabled) { m_compositeToTexture = enabled; }
     void setForceCompositingMode(bool enabled) { m_forceCompositingMode = enabled; }
     void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; }
-
+    void setLegacyAccelerated2dCanvasEnabled(bool enabled) { m_legacyAccelerated2dCanvasEnabled = enabled; }
+    void setAcceleratedDrawingEnabled(bool enabled) { m_acceleratedDrawingEnabled = enabled; }
 #if defined(OS_WIN)
     // Access to the finished event.  Used by the static WatchDog thread.
     HANDLE finishedEvent() { return m_finishedEvent; }
@@ -206,6 +207,8 @@ private:
     bool m_compositeToTexture;
     bool m_forceCompositingMode;
     bool m_accelerated2dCanvasEnabled;
+    bool m_legacyAccelerated2dCanvasEnabled;
+    bool m_acceleratedDrawingEnabled;
     WebPreferences m_prefs;
     bool m_stressOpt;
     bool m_stressDeopt;
index f5556f4..702d3da 100644 (file)
@@ -105,6 +105,8 @@ void WebPreferences::reset()
     acceleratedCompositingEnabled = false;
     compositeToTexture = false;
     accelerated2dCanvasEnabled = false;
+    legacyAccelerated2dCanvasEnabled = false;
+    acceleratedDrawingEnabled = false;
     forceCompositingMode = false;
 }
 
@@ -154,6 +156,8 @@ void WebPreferences::applyTo(WebView* webView)
     settings->setCompositeToTextureEnabled(compositeToTexture);
     settings->setForceCompositingMode(forceCompositingMode);
     settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled);
+    settings->setLegacyAccelerated2dCanvasEnabled(legacyAccelerated2dCanvasEnabled);
+    settings->setAcceleratedDrawingEnabled(acceleratedDrawingEnabled);
 
     // Fixed values.
     settings->setShouldPaintCustomScrollbars(true);
index c85a487..cc294e7 100644 (file)
@@ -81,6 +81,8 @@ struct WebPreferences {
     bool compositeToTexture;
     bool forceCompositingMode;
     bool accelerated2dCanvasEnabled;
+    bool legacyAccelerated2dCanvasEnabled;
+    bool acceleratedDrawingEnabled;
 
     WebPreferences() { reset(); }
     void reset();