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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 command_line->HasSwitch(cc::switches::kUIShowSurfaceDamageRects); | 229 command_line->HasSwitch(cc::switches::kUIShowSurfaceDamageRects); |
230 settings.initial_debug_state.show_screen_space_rects = | 230 settings.initial_debug_state.show_screen_space_rects = |
231 command_line->HasSwitch(cc::switches::kUIShowScreenSpaceRects); | 231 command_line->HasSwitch(cc::switches::kUIShowScreenSpaceRects); |
232 settings.initial_debug_state.show_replica_screen_space_rects = | 232 settings.initial_debug_state.show_replica_screen_space_rects = |
233 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); | 233 command_line->HasSwitch(cc::switches::kUIShowReplicaScreenSpaceRects); |
234 settings.initial_debug_state.show_occluding_rects = | 234 settings.initial_debug_state.show_occluding_rects = |
235 command_line->HasSwitch(cc::switches::kUIShowOccludingRects); | 235 command_line->HasSwitch(cc::switches::kUIShowOccludingRects); |
236 settings.initial_debug_state.show_non_occluding_rects = | 236 settings.initial_debug_state.show_non_occluding_rects = |
237 command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects); | 237 command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects); |
238 | 238 |
| 239 settings.initial_debug_state.SetRecordRenderingStats( |
| 240 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
| 241 |
239 base::TimeTicks before_create = base::TimeTicks::Now(); | 242 base::TimeTicks before_create = base::TimeTicks::Now(); |
240 if (!!g_compositor_thread) { | 243 if (!!g_compositor_thread) { |
241 host_ = cc::LayerTreeHost::CreateThreaded( | 244 host_ = cc::LayerTreeHost::CreateThreaded( |
242 this, NULL, settings, g_compositor_thread->message_loop_proxy()); | 245 this, NULL, settings, g_compositor_thread->message_loop_proxy()); |
243 } else { | 246 } else { |
244 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings); | 247 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, this, NULL, settings); |
245 } | 248 } |
246 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", | 249 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", |
247 base::TimeTicks::Now() - before_create); | 250 base::TimeTicks::Now() - before_create); |
248 host_->SetRootLayer(root_web_layer_); | 251 host_->SetRootLayer(root_web_layer_); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 // CompositorObservers to be notified before starting another | 560 // CompositorObservers to be notified before starting another |
558 // draw cycle. | 561 // draw cycle. |
559 ScheduleDraw(); | 562 ScheduleDraw(); |
560 } | 563 } |
561 FOR_EACH_OBSERVER(CompositorObserver, | 564 FOR_EACH_OBSERVER(CompositorObserver, |
562 observer_list_, | 565 observer_list_, |
563 OnCompositingEnded(this)); | 566 OnCompositingEnded(this)); |
564 } | 567 } |
565 | 568 |
566 } // namespace ui | 569 } // namespace ui |
OLD | NEW |