diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-22 22:26:39 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-22 22:26:39 +0000 |
commit | c015c1490c73a5ae060464ddb64219c5c29f814b (patch) | |
tree | 7e1116800179447c7b739493435ce03d96e1b76f | |
parent | 8a4677ed7ace8b86c3b09eae39375210c255c3e6 (diff) | |
download | chromium_src-c015c1490c73a5ae060464ddb64219c5c29f814b.zip chromium_src-c015c1490c73a5ae060464ddb64219c5c29f814b.tar.gz chromium_src-c015c1490c73a5ae060464ddb64219c5c29f814b.tar.bz2 |
Always enable FCM on Windows.
This also re-enables loading the blacklist in tests (and adds a content_browsertest to make sure that the configuration we expect to be testing is indeed the one we are testing).
This is a stepping stone towards getting the waterfall closer to what we actually ship and closer to Aura; I will try to force threaded compositing next provided this goes well.
This CL also cleans up compositor_util.cc which was enforcing the blacklist twice.
Instead of keeping --skip-gpu-data-loading around to avoid regressing issue 190942, introduce a better global solution which involves initializing a fake gpu_info in GpuDataManagerImplPrivate::Initialize instead of querying real gpu_info (slow) when OSMesa is the GL being used (which it is in non-pure GPU tests).
Keeps --skip-gpu-data-loading around temporarily on Mac and Linux, see http://crbug.com/277242 and try failures on patch set 17 for details.
BUG=233830, 267038, 190942, 277242
TBR=jcivelli, piman
Review URL: https://chromiumcodereview.appspot.com/22198004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219132 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gpu/chrome_gpu_util.cc | 12 | ||||
-rw-r--r-- | chrome/test/base/test_launcher_utils.cc | 4 | ||||
-rw-r--r-- | chrome/test/gpu/gpu_feature_browsertest.cc | 6 | ||||
-rw-r--r-- | content/browser/gpu/compositor_util.cc | 45 | ||||
-rw-r--r-- | content/browser/gpu/compositor_util_browsertest.cc | 41 | ||||
-rw-r--r-- | content/browser/gpu/gpu_data_manager_impl_private.cc | 24 | ||||
-rw-r--r-- | content/content_tests.gypi | 3 | ||||
-rw-r--r-- | content/public/common/content_switches.cc | 16 | ||||
-rw-r--r-- | content/public/common/content_switches.h | 5 | ||||
-rw-r--r-- | content/public/test/browser_test_base.cc | 4 | ||||
-rw-r--r-- | content/shell/app/shell_main_delegate.cc | 1 | ||||
-rw-r--r-- | gpu/config/software_rendering_list_json.cc | 20 |
12 files changed, 125 insertions, 56 deletions
diff --git a/chrome/browser/gpu/chrome_gpu_util.cc b/chrome/browser/gpu/chrome_gpu_util.cc index 61da773..4bbd5e5 100644 --- a/chrome/browser/gpu/chrome_gpu_util.cc +++ b/chrome/browser/gpu/chrome_gpu_util.cc @@ -40,18 +40,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) - return false; -#endif - #if defined(OS_MACOSX) // Browser and content shell tests hang on 10.7 when the Apple software // renderer is used. These tests ignore the blacklist (which disables diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc index 1f81ef9..f5bf93c 100644 --- a/chrome/test/base/test_launcher_utils.cc +++ b/chrome/test/base/test_launcher_utils.cc @@ -47,10 +47,6 @@ void PrepareBrowserCommandLineForTests(CommandLine* command_line) { // Don't install default apps. command_line->AppendSwitch(switches::kDisableDefaultApps); - // Don't collect GPU info, load GPU blacklist, or schedule a GPU blacklist - // auto-update. - command_line->AppendSwitch(switches::kSkipGpuDataLoading); - #if defined(USE_AURA) // Disable window animations under Ash as the animations effect the // coordinates returned and result in flake. diff --git a/chrome/test/gpu/gpu_feature_browsertest.cc b/chrome/test/gpu/gpu_feature_browsertest.cc index 8a6af16..9f62077 100644 --- a/chrome/test/gpu/gpu_feature_browsertest.cc +++ b/chrome/test/gpu/gpu_feature_browsertest.cc @@ -187,8 +187,10 @@ IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MAYBE_AcceleratedCompositingAllowed) { class AcceleratedCompositingBlockedTest : public GpuFeatureTest { public: - virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { - GpuFeatureTest::SetUpInProcessBrowserTestFixture(); + // Override the blacklist after browser initialization has completed, just + // before launching the actual test. + virtual void SetUpOnMainThread() OVERRIDE { + GpuFeatureTest::SetUpOnMainThread(); const std::string json_blacklist = "{\n" " \"name\": \"gpu blacklist\",\n" diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc index 77dda3f..fe7ad97 100644 --- a/content/browser/gpu/compositor_util.cc +++ b/content/browser/gpu/compositor_util.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/metrics/field_trial.h" +#include "build/build_config.h" #include "content/public/browser/gpu_data_manager.h" #include "content/public/common/content_constants.h" #include "content/public/common/content_switches.h" @@ -36,11 +37,6 @@ bool CanDoAcceleratedCompositing() { return true; } -bool IsForceCompositingModeBlacklisted() { - return GpuDataManager::GetInstance()->IsFeatureBlacklisted( - gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE); -} - } // namespace bool IsThreadedCompositingEnabled() { @@ -49,14 +45,17 @@ bool IsThreadedCompositingEnabled() { return true; #endif - if (!CanDoAcceleratedCompositing()) - return false; - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); // Command line switches take precedence over blacklist and field trials. if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || - command_line.HasSwitch(switches::kDisableThreadedCompositing)) + command_line.HasSwitch(switches::kDisableThreadedCompositing)) { + return false; + } else if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) { + return true; + } + + if (!CanDoAcceleratedCompositing()) return false; #if defined(OS_CHROMEOS) @@ -65,12 +64,6 @@ bool IsThreadedCompositingEnabled() { return true; #endif - if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) - return true; - - if (IsForceCompositingModeBlacklisted()) - return false; - base::FieldTrial* trial = base::FieldTrialList::Find(kGpuCompositingFieldTrialName); return trial && @@ -83,26 +76,30 @@ bool IsForceCompositingModeEnabled() { return true; #endif - if (!CanDoAcceleratedCompositing()) - return false; - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); // Command line switches take precedence over blacklisting and field trials. if (command_line.HasSwitch(switches::kDisableForceCompositingMode)) return false; + else if (command_line.HasSwitch(switches::kForceCompositingMode)) + return true; + + if (!CanDoAcceleratedCompositing()) + return false; #if defined(OS_CHROMEOS) // We always want compositing ChromeOS unless it's explicitly disabled above. return true; +#elif defined(OS_WIN) + // Windows Vista+ has been shipping with FCM enabled at 100% since M24; skip + // the field trial check to ensure this is always enabled on the try bots. + // TODO(gab): Do the same thing in IsThreadedCompositingEnabled() once this is + // stable. + // TODO(gab): Do the same thing for Mac OS (which has been enabled at 100% + // since M28) as well and get rid of the field trial code. + return true; #endif - if (command_line.HasSwitch(switches::kForceCompositingMode)) - return true; - - if (IsForceCompositingModeBlacklisted()) - return false; - base::FieldTrial* trial = base::FieldTrialList::Find(kGpuCompositingFieldTrialName); diff --git a/content/browser/gpu/compositor_util_browsertest.cc b/content/browser/gpu/compositor_util_browsertest.cc new file mode 100644 index 0000000..64df8f7 --- /dev/null +++ b/content/browser/gpu/compositor_util_browsertest.cc @@ -0,0 +1,41 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/gpu/compositor_util.h" +#include "content/test/content_browser_test.h" + +#if defined(OS_WIN) +#include "base/win/windows_version.h" +#endif + +namespace content { + +typedef ContentBrowserTest CompositorUtilTest; + +// Test that threaded compositing and FCM are in the expected mode on the bots +// for all platforms. +IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) { + enum CompositingMode { + DISABLED, + ENABLED, + THREADED, + } expected_mode = DISABLED; +#if defined(OS_ANDROID) || defined(OS_CHROMEOS) + expected_mode = THREADED; +#elif defined(OS_WIN) +#if defined(USE_AURA) + // WinAura always uses threaded compositing. + expected_mode = THREADED; +#else // defined(USE_AURA) + if (base::win::GetVersion() >= base::win::VERSION_VISTA) + expected_mode = ENABLED; +#endif // defined(USE_AURA) +#endif + + EXPECT_EQ(expected_mode == ENABLED || expected_mode == THREADED, + IsForceCompositingModeEnabled()); + EXPECT_EQ(expected_mode == THREADED, IsThreadedCompositingEnabled()); +} + +} diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index 3ff628a..0a72acb 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -563,13 +563,33 @@ void GpuDataManagerImplPrivate::GetGLStrings(std::string* gl_vendor, void GpuDataManagerImplPrivate::Initialize() { TRACE_EVENT0("startup", "GpuDataManagerImpl::Initialize"); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + const CommandLine* command_line = CommandLine::ForCurrentProcess(); +#if defined(OS_LINUX) || defined(OS_MACOSX) + // TODO(gab): Enable GPU blacklist usage on all the bots + // (http://crbug.com/277242). if (command_line->HasSwitch(switches::kSkipGpuDataLoading) && !command_line->HasSwitch(switches::kUseGpuInTests)) return; +#endif gpu::GPUInfo gpu_info; - { + if (command_line->GetSwitchValueASCII( + switches::kUseGL) == gfx::kGLImplementationOSMesaName) { + // If using the OSMesa GL implementation, use fake vendor and device ids to + // make sure it never gets blacklisted. This is better than simply + // cancelling GPUInfo gathering as it allows us to proceed with loading the + // blacklist below which may have non-device specific entries we want to + // apply anyways (e.g., OS version blacklisting). + gpu_info.gpu.vendor_id = 0xffff; + gpu_info.gpu.device_id = 0xffff; + + // Hardcode these two values otherwise blacklisting rules #12, 55, and 74 in + // kSoftwareRenderingListJson result in a positive match as GpuControlList + // assumes a match (by design) when a property is required for the + // verification yet not present in the GpuInfo. + gpu_info.driver_vendor = gfx::kGLImplementationOSMesaName; + gpu_info.driver_date = "2013.8"; + } else { TRACE_EVENT0("startup", "GpuDataManagerImpl::Initialize:CollectBasicGraphicsInfo"); gpu::CollectBasicGraphicsInfo(&gpu_info); diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 783106d..7343851 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -804,10 +804,11 @@ 'browser/download/mhtml_generation_browsertest.cc', 'browser/download/save_package_browsertest.cc', 'browser/fileapi/file_system_browsertest.cc', + 'browser/gpu/compositor_util_browsertest.cc', 'browser/gpu/gpu_crash_browsertest.cc', + 'browser/gpu/gpu_functional_browsertest.cc', 'browser/gpu/gpu_info_browsertest.cc', 'browser/gpu/gpu_ipc_browsertests.cc', - 'browser/gpu/gpu_functional_browsertest.cc', 'browser/gpu/gpu_memory_test.cc', 'browser/gpu/gpu_pixel_browsertest.cc', 'browser/gpu/webgl_conformance_test.cc', diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 36f707f..9e48525 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -745,12 +745,6 @@ const char kSingleProcess[] = "single-process"; // http://crbug.com/159215. const char kSitePerProcess[] = "site-per-process"; -// Skip gpu info collection, blacklist loading, and blacklist auto-update -// scheduling at browser startup time. -// Therefore, all GPU features are available, and about:gpu page shows empty -// content. The switch is intended only for tests. -const char kSkipGpuDataLoading[] = "skip-gpu-data-loading"; - // Specifies the request key for the continuous speech recognition webservice. const char kSpeechRecognitionWebserviceKey[] = "speech-service-key"; @@ -938,6 +932,16 @@ const char kChildCleanExit[] = "child-clean-exit"; extern const char kTestCompositor[] = "test-compositor"; #endif +#if defined(OS_LINUX) || defined(OS_MACOSX) +// Skip gpu info collection, blacklist loading, and blacklist auto-update +// scheduling at browser startup time. +// Therefore, all GPU features are available, and about:gpu page shows empty +// content. The switch is intended only for tests. +// TODO(gab): Remove this flag entriely and enable GPU blacklist usage on all +// the bots (http://crbug.com/277242). +const char kSkipGpuDataLoading[] = "skip-gpu-data-loading"; +#endif + // Don't dump stuff here, follow the same order as the header. } // namespace switches diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index f2a0829..2acde84 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -215,7 +215,6 @@ extern const char kShowPaintRects[]; CONTENT_EXPORT extern const char kSimulateTouchScreenWithMouse[]; CONTENT_EXPORT extern const char kSingleProcess[]; CONTENT_EXPORT extern const char kSitePerProcess[]; -CONTENT_EXPORT extern const char kSkipGpuDataLoading[]; extern const char kSpeechRecognitionWebserviceKey[]; CONTENT_EXPORT extern const char kStatsCollectionController[]; extern const char kTabCaptureDownscaleQuality[]; @@ -282,6 +281,10 @@ extern const char kChildCleanExit[]; CONTENT_EXPORT extern const char kTestCompositor[]; #endif +#if defined(OS_LINUX) || defined(OS_MACOSX) +CONTENT_EXPORT extern const char kSkipGpuDataLoading[]; +#endif + // DON'T ADD RANDOM STUFF HERE. Put it in the main section above in // alphabetical order, or in one of the ifdefs (also in order in each section). diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc index 9a0f317..03f6c98 100644 --- a/content/public/test/browser_test_base.cc +++ b/content/public/test/browser_test_base.cc @@ -100,7 +100,11 @@ void BrowserTestBase::SetUp() { command_line->AppendSwitch(switches::kDomAutomationController); +#if defined(OS_LINUX) || defined(OS_MACOSX) + // TODO(gab): Enable GPU blacklist usage on all the bots + // (http://crbug.com/277242). command_line->AppendSwitch(switches::kSkipGpuDataLoading); +#endif #if defined(USE_AURA) // Use test contexts for browser tests unless they override and force us to diff --git a/content/shell/app/shell_main_delegate.cc b/content/shell/app/shell_main_delegate.cc index 8e60a32..2ebca21 100644 --- a/content/shell/app/shell_main_delegate.cc +++ b/content/shell/app/shell_main_delegate.cc @@ -123,7 +123,6 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { command_line.AppendSwitchASCII( switches::kUseGL, gfx::kGLImplementationOSMesaName); #endif - command_line.AppendSwitch(switches::kSkipGpuDataLoading); command_line.AppendSwitch(switches::kDisableGpuVsync); command_line.AppendSwitchASCII(switches::kTouchEvents, switches::kTouchEventsEnabled); diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc index b7c5c5398..36e7392 100644 --- a/gpu/config/software_rendering_list_json.cc +++ b/gpu/config/software_rendering_list_json.cc @@ -67,7 +67,7 @@ // "number" is used for all "op" values except "any". "number" and "number2" // are in the format of x, x.x, x.x.x, etc. // Only "driver_version" supports lexical style if the format is major.minor; -// in that case, major is still numerical, but minor is lexical. +// in that case, major is still numerical, but minor is lexical. // // STRING includes "op" and "value". "op" can be any of the following values: // "contains", "beginwith", "endwith", "=". "value" is a string. @@ -89,7 +89,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST( { "name": "software rendering list", // Please update the version number whenever you change this file. - "version": "6.5", + "version": "6.6", "entries": [ { "id": 1, @@ -1160,6 +1160,21 @@ LONG_STRING_CONST( "features": [ "webgl" ] + }, + { + "id": 77, + "description": "Disable force compositing mode on all Windows versions prior to Vista.", + "cr_bugs": [273920], + "os": { + "type": "win", + "version": { + "op": "<", + "number": "6.0" + } + }, + "features": [ + "force_compositing_mode" + ] } ] } @@ -1167,4 +1182,3 @@ LONG_STRING_CONST( ); // LONG_STRING_CONST macro } // namespace gpu - |