summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-26 01:55:19 +0000
committercsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-26 01:55:19 +0000
commit75bbff73453b7c9bf4cff45b9cbc6f1984dafaba (patch)
tree833fd26ed27f6fd1bd465b6c50b2f60405cd51f7
parenta3f54af62821758cd2edb3d031872c0b0c8bae4b (diff)
downloadchromium_src-75bbff73453b7c9bf4cff45b9cbc6f1984dafaba.zip
chromium_src-75bbff73453b7c9bf4cff45b9cbc6f1984dafaba.tar.gz
chromium_src-75bbff73453b7c9bf4cff45b9cbc6f1984dafaba.tar.bz2
Revert 158707 - Enable by default:
1. threaded compositing on windows (except XP) 2. force compositing mode on mac On linux we switch to a 1/3 1/3 fcm and thread experiments . This patch also gives priority to the command line switches so that both threaded and force compositing mode can be turned off via the about:flags page or command line. In the near future, we will use the Finch framework to tweak the experiment percentages. Note: This patch has a dependency on: https://bugs.webkit.org/show_bug.cgi?id=96871 It also disables ExtensionApiTest.CaptureVisibleTabJPeg as it triggers flakiness on it. chrome.tabs.captureVisibleTab is inherently racy as there is no way to guarantee that the tab has been painted at least once when that call is made. Note how the other variants of CaptureVisibleTab tests have already been disabled for similar reasons. BUG=143809,128387,146861 Review URL: https://chromiumcodereview.appspot.com/10914247 Reverted due to failures on Mac bots: http://build.chromium.org/p/chromium.mac/builders/Mac10.6%20Tests%20%281%29/builds/29446/steps/interactive_ui_tests/logs/AutoResize http://build.chromium.org/p/chromium.mac/builders/Mac10.7%20Tests%20%281%29/builds/2143/steps/interactive_ui_tests/logs/TightAutosizeAroundSingleLine http://build.chromium.org/p/chromium.mac/builders/Mac%2010.6%20Tests%20%28dbg%29%283%29/builds/26358/steps/interactive_ui_tests/logs/TightAutosizeAroundSingleLine http://build.chromium.org/p/chromium.mac/builders/Mac%2010.7%20Tests%20%28dbg%29%283%29/builds/1804/steps/interactive_ui_tests/logs/TightAutosizeAroundSingleLine TBR=vangelis@chromium.org Review URL: https://codereview.chromium.org/10991032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158711 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_gpu_util.cc52
-rw-r--r--chrome/browser/extensions/extension_tabs_apitest.cc2
-rw-r--r--chrome/browser/task_manager/task_manager_browsertest.cc8
-rw-r--r--chrome/test/gpu/gpu_feature_browsertest.cc69
-rw-r--r--content/common/compositor_util.cc17
5 files changed, 59 insertions, 89 deletions
diff --git a/chrome/browser/chrome_gpu_util.cc b/chrome/browser/chrome_gpu_util.cc
index 9f9a25d..b4221ec 100644
--- a/chrome/browser/chrome_gpu_util.cc
+++ b/chrome/browser/chrome_gpu_util.cc
@@ -71,12 +71,6 @@ bool ShouldRunCompositingFieldTrial() {
return false;
#endif
-// Necessary for linux_chromeos build since it defines both OS_LINUX
-// and OS_CHROMEOS .
-#if defined(OS_CHROMEOS)
- return false;
-#endif
-
#if defined(OS_WIN)
// Don't run the trial on Windows XP.
if (base::win::GetVersion() < base::win::VERSION_VISTA)
@@ -112,44 +106,42 @@ void InitializeCompositingFieldTrial() {
}
const base::FieldTrial::Probability kDivisor = 3;
- // Note: This field trial should be removed once we're comfortable with
- // turning force compositing mode and threaded compositing on all relevant
- // platforms (see crbug.com/149991).
scoped_refptr<base::FieldTrial> trial(
base::FieldTrialList::FactoryGetFieldTrial(
content::kGpuCompositingFieldTrialName, kDivisor,
- "disable", 2013, 12, 31, NULL));
+ "disable", 2012, 12, 31, NULL));
// Produce the same result on every run of this client.
trial->UseOneTimeRandomization();
- // Note: The static field trial probabilities set here can be overwritten
- // at runtime by Finch. Changing these static values won't have an effect
- // if a Finch study is active.
base::FieldTrial::Probability force_compositing_mode_probability = 0;
base::FieldTrial::Probability threaded_compositing_probability = 0;
- // Threaded compositing mode isn't feature complete on mac or linux yet:
- // http://crbug.com/133602 for mac
- // http://crbug.com/140866 for linux
-
-#if defined(OS_WIN)
- // threaded-compositing turned on by default on Windows.
- // (Windows XP is excluded explicitly in ShouldRunCompositingFieldTrial)
- threaded_compositing_probability = 3;
-#elif defined(OS_MACOSX)
- // force-compositing-mode turned on by default on mac.
- force_compositing_mode_probability = 3;
-#elif defined(OS_LINUX)
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
- if (channel != chrome::VersionInfo::CHANNEL_STABLE &&
- channel != chrome::VersionInfo::CHANNEL_BETA) {
- // On channels < beta, force-compositing-mode and
+ if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
+ channel == chrome::VersionInfo::CHANNEL_BETA) {
+ // Stable and Beta channels: Non-threaded force-compositing-mode on by
+ // default (mac and windows only).
+#if defined(OS_WIN) || defined(OS_MACOSX)
+ force_compositing_mode_probability = 3;
+#endif
+ } else if (channel == chrome::VersionInfo::CHANNEL_DEV ||
+ channel == chrome::VersionInfo::CHANNEL_CANARY) {
+ // Dev and Canary channels: force-compositing-mode and
// threaded-compositing on with 1/3 probability each.
force_compositing_mode_probability = 1;
- threaded_compositing_probability = 1;
- }
+
+#if defined(OS_MACOSX) || defined(OS_LINUX)
+ // Threaded compositing mode isn't feature complete on mac or linux yet:
+ // http://crbug.com/133602 for mac
+ // http://crbug.com/140866 for linux
+ threaded_compositing_probability = 0;
+#else
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableThreadedCompositing))
+ threaded_compositing_probability = 1;
#endif
+ }
int force_compositing_group = trial->AppendGroup(
content::kGpuCompositingFieldTrialForceCompositingEnabledName,
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc
index 8056f9b..48e7607 100644
--- a/chrome/browser/extensions/extension_tabs_apitest.cc
+++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -143,7 +143,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_TabReload) {
ASSERT_TRUE(RunExtensionTest("tabs/reload")) << message_;
}
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_CaptureVisibleTabJpeg) {
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, CaptureVisibleTabJpeg) {
host_resolver()->AddRule("a.com", "127.0.0.1");
host_resolver()->AddRule("b.com", "127.0.0.1");
ASSERT_TRUE(StartTestServer());
diff --git a/chrome/browser/task_manager/task_manager_browsertest.cc b/chrome/browser/task_manager/task_manager_browsertest.cc
index bf9ca8c..68f2600 100644
--- a/chrome/browser/task_manager/task_manager_browsertest.cc
+++ b/chrome/browser/task_manager/task_manager_browsertest.cc
@@ -67,12 +67,10 @@ class TaskManagerBrowserTest : public ExtensionBrowserTest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
ExtensionBrowserTest::SetUpCommandLine(command_line);
- // Do not prelaunch the GPU process and disable accelerated compositing
- // for these tests as the GPU process will show up in task manager but
- // whether it appears before or after the new tab renderer process is not
- // well defined.
+ // Do not prelaunch the GPU process for these tests because it will show
+ // up in task manager but whether it appears before or after the new tab
+ // renderer process is not well defined.
command_line->AppendSwitch(switches::kDisableGpuProcessPrelaunch);
- command_line->AppendSwitch(switches::kDisableAcceleratedCompositing);
}
};
diff --git a/chrome/test/gpu/gpu_feature_browsertest.cc b/chrome/test/gpu/gpu_feature_browsertest.cc
index 05f45cd..78da1a258 100644
--- a/chrome/test/gpu/gpu_feature_browsertest.cc
+++ b/chrome/test/gpu/gpu_feature_browsertest.cc
@@ -41,15 +41,16 @@ using trace_analyzer::TraceEventVector;
namespace {
-const char kSwapBuffersEvent[] = "SwapBuffers";
-const char kAcceleratedCanvasCreationEvent[] = "Canvas2DLayerBridgeCreation";
-const char kWebGLCreationEvent[] = "DrawingBufferCreation";
+typedef uint32 GpuResultFlags;
+#define EXPECT_NO_GPU_SWAP_BUFFERS GpuResultFlags(1<<0)
+// Expect a SwapBuffers to occur (see gles2_cmd_decoder.cc).
+#define EXPECT_GPU_SWAP_BUFFERS GpuResultFlags(1<<1)
class GpuFeatureTest : public InProcessBrowserTest {
public:
GpuFeatureTest() : trace_categories_("test_gpu"), gpu_enabled_(false) {}
- virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
+ virtual void SetUpInProcessBrowserTestFixture() {
FilePath test_dir;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir));
gpu_test_dir_ = test_dir.AppendASCII("gpu");
@@ -109,10 +110,7 @@ class GpuFeatureTest : public InProcessBrowserTest {
EXPECT_STREQ(expected_reply, result.c_str());
}
- // Open the URL and check the trace stream for the given event.
- void RunEventTest(const FilePath& url,
- const char* event_name = NULL,
- bool event_expected = false) {
+ void RunTest(const FilePath& url, GpuResultFlags expectations) {
#if defined(OS_LINUX) && !defined(NDEBUG)
// Bypass tests on GPU Linux Debug bots.
if (gpu_enabled_)
@@ -135,16 +133,16 @@ class GpuFeatureTest : public InProcessBrowserTest {
analyzer_->AssociateBeginEndEvents();
TraceEventVector events;
- if (!event_name)
- return;
-
- size_t event_count =
- analyzer_->FindEvents(Query::EventNameIs(event_name), &events);
+ if (expectations & EXPECT_NO_GPU_SWAP_BUFFERS) {
+ EXPECT_EQ(analyzer_->FindEvents(Query::EventNameIs("SwapBuffers"),
+ &events), size_t(0));
+ }
- if (event_expected)
- EXPECT_GT(event_count, 0U);
- else
- EXPECT_EQ(event_count, 0U);
+ // Check for swap buffers if expected:
+ if (expectations & EXPECT_GPU_SWAP_BUFFERS) {
+ EXPECT_GT(analyzer_->FindEvents(Query::EventNameIs("SwapBuffers"),
+ &events), size_t(0));
+ }
}
// Trigger a resize of the chrome window, and use tracing to wait for the
@@ -180,7 +178,7 @@ IN_PROC_BROWSER_TEST_F(GpuFeatureTest, AcceleratedCompositingAllowed) {
EXPECT_EQ(type, 0);
const FilePath url(FILE_PATH_LITERAL("feature_compositing.html"));
- RunEventTest(url, kSwapBuffersEvent, true);
+ RunTest(url, EXPECT_GPU_SWAP_BUFFERS);
}
// Flash Stage3D may be blacklisted for other reasons on XP, so ignore it.
@@ -193,11 +191,8 @@ GpuFeatureType IgnoreGpuFeatures(GpuFeatureType type) {
return type;
}
-class AcceleratedCompositingBlockedTest : public GpuFeatureTest {
- public:
- virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
- GpuFeatureTest::SetUpInProcessBrowserTestFixture();
- const std::string json_blacklist =
+IN_PROC_BROWSER_TEST_F(GpuFeatureTest, AcceleratedCompositingBlocked) {
+ const std::string json_blacklist =
"{\n"
" \"name\": \"gpu blacklist\",\n"
" \"version\": \"1.0\",\n"
@@ -210,20 +205,14 @@ class AcceleratedCompositingBlockedTest : public GpuFeatureTest {
" }\n"
" ]\n"
"}";
- SetupBlacklist(json_blacklist);
- }
-};
-
-IN_PROC_BROWSER_TEST_F(AcceleratedCompositingBlockedTest,
- AcceleratedCompositingBlocked) {
+ SetupBlacklist(json_blacklist);
GpuFeatureType type =
GpuDataManager::GetInstance()->GetBlacklistedFeatures();
type = IgnoreGpuFeatures(type);
-
EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING);
const FilePath url(FILE_PATH_LITERAL("feature_compositing.html"));
- RunEventTest(url, kSwapBuffersEvent, false);
+ RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS);
}
class AcceleratedCompositingTest : public GpuFeatureTest {
@@ -237,7 +226,7 @@ class AcceleratedCompositingTest : public GpuFeatureTest {
IN_PROC_BROWSER_TEST_F(AcceleratedCompositingTest,
AcceleratedCompositingDisabled) {
const FilePath url(FILE_PATH_LITERAL("feature_compositing.html"));
- RunEventTest(url, kSwapBuffersEvent, false);
+ RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS);
}
IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLAllowed) {
@@ -246,7 +235,7 @@ IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLAllowed) {
EXPECT_EQ(type, 0);
const FilePath url(FILE_PATH_LITERAL("feature_webgl.html"));
- RunEventTest(url, kWebGLCreationEvent, true);
+ RunTest(url, EXPECT_GPU_SWAP_BUFFERS);
}
IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLBlocked) {
@@ -270,7 +259,7 @@ IN_PROC_BROWSER_TEST_F(GpuFeatureTest, WebGLBlocked) {
EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL);
const FilePath url(FILE_PATH_LITERAL("feature_webgl.html"));
- RunEventTest(url, kWebGLCreationEvent, false);
+ RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS);
}
class WebGLTest : public GpuFeatureTest {
@@ -286,7 +275,7 @@ class WebGLTest : public GpuFeatureTest {
IN_PROC_BROWSER_TEST_F(WebGLTest, WebGLDisabled) {
const FilePath url(FILE_PATH_LITERAL("feature_webgl.html"));
- RunEventTest(url, kWebGLCreationEvent, false);
+ RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS);
}
IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MultisamplingAllowed) {
@@ -367,7 +356,7 @@ IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DAllowed) {
EXPECT_EQ(type, 0);
const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html"));
- RunEventTest(url, kAcceleratedCanvasCreationEvent, true);
+ RunTest(url, EXPECT_GPU_SWAP_BUFFERS);
}
IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DBlocked) {
@@ -391,7 +380,7 @@ IN_PROC_BROWSER_TEST_F(GpuFeatureTest, Canvas2DBlocked) {
EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS);
const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html"));
- RunEventTest(url, kAcceleratedCanvasCreationEvent, false);
+ RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS);
}
class Canvas2DDisabledTest : public GpuFeatureTest {
@@ -404,7 +393,7 @@ class Canvas2DDisabledTest : public GpuFeatureTest {
IN_PROC_BROWSER_TEST_F(Canvas2DDisabledTest, Canvas2DDisabled) {
const FilePath url(FILE_PATH_LITERAL("feature_canvas2d.html"));
- RunEventTest(url, kAcceleratedCanvasCreationEvent, false);
+ RunTest(url, EXPECT_NO_GPU_SWAP_BUFFERS);
}
IN_PROC_BROWSER_TEST_F(GpuFeatureTest,
@@ -429,13 +418,13 @@ class ThreadedCompositorTest : public GpuFeatureTest {
// disabled in http://crbug.com/123503
IN_PROC_BROWSER_TEST_F(ThreadedCompositorTest, ThreadedCompositor) {
const FilePath url(FILE_PATH_LITERAL("feature_compositing.html"));
- RunEventTest(url, kSwapBuffersEvent, true);
+ RunTest(url, EXPECT_GPU_SWAP_BUFFERS);
}
IN_PROC_BROWSER_TEST_F(GpuFeatureTest, RafNoDamage) {
trace_categories_ = "-test_*";
const FilePath url(FILE_PATH_LITERAL("feature_raf_no_damage.html"));
- RunEventTest(url);
+ RunTest(url, GpuResultFlags(0));
if (!analyzer_.get())
return;
diff --git a/content/common/compositor_util.cc b/content/common/compositor_util.cc
index 3f36f11..dc16938 100644
--- a/content/common/compositor_util.cc
+++ b/content/common/compositor_util.cc
@@ -18,13 +18,8 @@ bool IsThreadedCompositingEnabled() {
#endif
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
- // Command line switches take precedence over field trials.
- if (command_line.HasSwitch(switches::kDisableForceCompositingMode) ||
- command_line.HasSwitch(switches::kDisableThreadedCompositing))
- return false;
-
- if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
+ if (command_line.HasSwitch(switches::kEnableThreadedCompositing) &&
+ !command_line.HasSwitch(switches::kDisableThreadedCompositing))
return true;
base::FieldTrial* trial =
@@ -41,12 +36,8 @@ bool IsForceCompositingModeEnabled() {
#endif
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
- // Command line switches take precedence over field trials.
- if (command_line.HasSwitch(switches::kDisableForceCompositingMode))
- return false;
-
- if (command_line.HasSwitch(switches::kForceCompositingMode))
+ if (command_line.HasSwitch(switches::kForceCompositingMode) &&
+ !command_line.HasSwitch(switches::kDisableForceCompositingMode))
return true;
base::FieldTrial* trial =