Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: ui/compositor/compositor.cc

Issue 11186039: Move CC switches to cc/switches.h. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed nits and made ui/ depend on ui/gfx/ Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index dbaac60941cbb24bc7e3e4833b2573b7cc6e5317..4ce14d94fd56c54af5377b4537600a444a9f9de0 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/threading/thread_restrictions.h"
+#include "cc/settings.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSupport.h"
@@ -176,14 +177,14 @@ Compositor::~Compositor() {
}
void Compositor::Initialize(bool use_thread) {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ cc::Settings::setPartialSwapEnabled(
+ command_line.HasSwitch(switches::kUIEnablePartialSwap));
+ cc::Settings::setPerTilePaintingEnabled(
+ command_line.HasSwitch(switches::kUIEnablePerTilePainting));
+
WebKit::WebCompositorSupport* compositor_support =
WebKit::Platform::current()->compositorSupport();
- // These settings must be applied before we initialize the compositor.
- compositor_support->setPartialSwapEnabled(
- command_line->HasSwitch(switches::kUIEnablePartialSwap));
- compositor_support->setPerTilePaintingEnabled(
- command_line->HasSwitch(switches::kUIEnablePerTilePainting));
if (use_thread)
g_compositor_thread = new webkit_glue::WebThreadImpl("Browser Compositor");
compositor_support->initialize(g_compositor_thread);
« ui/DEPS ('K') | « ui/DEPS ('k') | webkit/compositor_bindings/WebCompositorImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698