diff options
author | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-11 14:49:11 +0000 |
---|---|---|
committer | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-11 14:49:11 +0000 |
commit | 302fe42e2fb7659d935ce406a304da8da69a455e (patch) | |
tree | c52eab2b7b2cdd61e30ca61bf9d7887ae3e1070c /ui/compositor/compositor.cc | |
parent | 170279116ec7fb08f2357ef45498583ce90b92f8 (diff) | |
download | chromium_src-302fe42e2fb7659d935ce406a304da8da69a455e.zip chromium_src-302fe42e2fb7659d935ce406a304da8da69a455e.tar.gz chromium_src-302fe42e2fb7659d935ce406a304da8da69a455e.tar.bz2 |
Prepare compositor.cc for global CCSettings
All compositor settings are currently owned by the layer tree hosts. Some of these settings will become globals. This cl prepares for that change.
BUG=131792,129683
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10534017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor/compositor.cc')
-rw-r--r-- | ui/compositor/compositor.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index 5dc991e..fcc7ac6 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -141,12 +141,15 @@ Compositor::Compositor(CompositorDelegate* delegate, command_line->HasSwitch(switches::kUIShowFPSCounter); settings.showPlatformLayerTree = command_line->HasSwitch(switches::kUIShowLayerTree); - settings.refreshRate = test_compositor_enabled ? - kTestRefreshRate : kDefaultRefreshRate; + settings.refreshRate = + test_compositor_enabled ? kTestRefreshRate : kDefaultRefreshRate; + +#if !defined(WEBCOMPOSITOR_OWNS_SETTINGS) settings.partialSwapEnabled = command_line->HasSwitch(switches::kUIEnablePartialSwap); settings.perTilePainting = - command_line->HasSwitch(switches::kUIEnablePerTilePainting); + command_line->HasSwitch(switches::kUIEnablePerTilePainting); +#endif host_.initialize(this, root_web_layer_, settings); root_web_layer_.setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); @@ -166,6 +169,14 @@ Compositor::~Compositor() { } void Compositor::Initialize(bool use_thread) { +#if defined(WEBCOMPOSITOR_OWNS_SETTINGS) + CommandLine* command_line = CommandLine::ForCurrentProcess(); + // These settings must be applied before we initialize the compositor. + WebKit::WebCompositor::setPartialSwapEnabled( + command_line->HasSwitch(switches::kUIEnablePartialSwap)); + WebKit::WebCompositor::setPerTilePaintingEnabled( + command_line->HasSwitch(switches::kUIEnablePerTilePainting)); +#endif if (use_thread) g_compositor_thread = new webkit_glue::WebThreadImpl("Browser Compositor"); WebKit::WebCompositor::initialize(g_compositor_thread); |