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 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 WebKit::Platform::current()->compositorSupport(); | 298 WebKit::Platform::current()->compositorSupport(); |
299 root_web_layer_.reset(compositor_support->createLayer()); | 299 root_web_layer_.reset(compositor_support->createLayer()); |
300 WebKit::WebLayerTreeView::Settings settings; | 300 WebKit::WebLayerTreeView::Settings settings; |
301 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 301 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
302 settings.showFPSCounter = | 302 settings.showFPSCounter = |
303 command_line->HasSwitch(switches::kUIShowFPSCounter); | 303 command_line->HasSwitch(switches::kUIShowFPSCounter); |
304 settings.showPlatformLayerTree = | 304 settings.showPlatformLayerTree = |
305 command_line->HasSwitch(switches::kUIShowLayerTree); | 305 command_line->HasSwitch(switches::kUIShowLayerTree); |
306 settings.refreshRate = | 306 settings.refreshRate = |
307 test_compositor_enabled ? kTestRefreshRate : kDefaultRefreshRate; | 307 test_compositor_enabled ? kTestRefreshRate : kDefaultRefreshRate; |
| 308 settings.showDebugBorders = |
| 309 command_line->HasSwitch(switches::kUIShowLayerBorders); |
308 | 310 |
309 root_web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); | 311 root_web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); |
310 host_.reset(compositor_support->createLayerTreeView(this, *root_web_layer_, | 312 host_.reset(compositor_support->createLayerTreeView(this, *root_web_layer_, |
311 settings)); | 313 settings)); |
312 host_->setSurfaceReady(); | 314 host_->setSurfaceReady(); |
313 } | 315 } |
314 | 316 |
315 Compositor::~Compositor() { | 317 Compositor::~Compositor() { |
316 CancelCompositorLock(); | 318 CancelCompositorLock(); |
317 DCHECK(!compositor_lock_); | 319 DCHECK(!compositor_lock_); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 | 578 |
577 COMPOSITOR_EXPORT void DisableTestCompositor() { | 579 COMPOSITOR_EXPORT void DisableTestCompositor() { |
578 test_compositor_enabled = false; | 580 test_compositor_enabled = false; |
579 } | 581 } |
580 | 582 |
581 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 583 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
582 return test_compositor_enabled; | 584 return test_compositor_enabled; |
583 } | 585 } |
584 | 586 |
585 } // namespace ui | 587 } // namespace ui |
OLD | NEW |