| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 void Compositor::Initialize(bool use_thread) { | 180 void Compositor::Initialize(bool use_thread) { |
| 181 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 181 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 182 WebKit::WebCompositorSupport* compositor_support = | 182 WebKit::WebCompositorSupport* compositor_support = |
| 183 WebKit::Platform::current()->compositorSupport(); | 183 WebKit::Platform::current()->compositorSupport(); |
| 184 // These settings must be applied before we initialize the compositor. | 184 // These settings must be applied before we initialize the compositor. |
| 185 compositor_support->setPartialSwapEnabled( | 185 compositor_support->setPartialSwapEnabled( |
| 186 command_line->HasSwitch(switches::kUIEnablePartialSwap)); | 186 command_line->HasSwitch(switches::kUIEnablePartialSwap)); |
| 187 compositor_support->setPerTilePaintingEnabled( | 187 compositor_support->setPerTilePaintingEnabled( |
| 188 command_line->HasSwitch(switches::kUIEnablePerTilePainting)); | 188 command_line->HasSwitch(switches::kUIEnablePerTilePainting)); |
| 189 compositor_support->setPageScalePinchZoomEnabled( |
| 190 command_line->HasSwitch(switches::kEnablePinchInCompositor)); |
| 189 if (use_thread) | 191 if (use_thread) |
| 190 g_compositor_thread = new webkit_glue::WebThreadImpl("Browser Compositor"); | 192 g_compositor_thread = new webkit_glue::WebThreadImpl("Browser Compositor"); |
| 191 compositor_support->initialize(g_compositor_thread); | 193 compositor_support->initialize(g_compositor_thread); |
| 192 } | 194 } |
| 193 | 195 |
| 194 void Compositor::Terminate() { | 196 void Compositor::Terminate() { |
| 195 WebKit::Platform::current()->compositorSupport()->shutdown(); | 197 WebKit::Platform::current()->compositorSupport()->shutdown(); |
| 196 if (g_compositor_thread) { | 198 if (g_compositor_thread) { |
| 197 delete g_compositor_thread; | 199 delete g_compositor_thread; |
| 198 g_compositor_thread = NULL; | 200 g_compositor_thread = NULL; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 435 |
| 434 COMPOSITOR_EXPORT void DisableTestCompositor() { | 436 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 435 test_compositor_enabled = false; | 437 test_compositor_enabled = false; |
| 436 } | 438 } |
| 437 | 439 |
| 438 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 440 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
| 439 return test_compositor_enabled; | 441 return test_compositor_enabled; |
| 440 } | 442 } |
| 441 | 443 |
| 442 } // namespace ui | 444 } // namespace ui |
| OLD | NEW |