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 13 matching lines...) Expand all Loading... |
24 #include "cc/surfaces/surface_id_allocator.h" | 24 #include "cc/surfaces/surface_id_allocator.h" |
25 #include "cc/trees/layer_tree_host.h" | 25 #include "cc/trees/layer_tree_host.h" |
26 #include "third_party/skia/include/core/SkBitmap.h" | 26 #include "third_party/skia/include/core/SkBitmap.h" |
27 #include "ui/compositor/compositor_observer.h" | 27 #include "ui/compositor/compositor_observer.h" |
28 #include "ui/compositor/compositor_switches.h" | 28 #include "ui/compositor/compositor_switches.h" |
29 #include "ui/compositor/compositor_vsync_manager.h" | 29 #include "ui/compositor/compositor_vsync_manager.h" |
30 #include "ui/compositor/dip_util.h" | 30 #include "ui/compositor/dip_util.h" |
31 #include "ui/compositor/layer.h" | 31 #include "ui/compositor/layer.h" |
32 #include "ui/compositor/layer_animator_collection.h" | 32 #include "ui/compositor/layer_animator_collection.h" |
33 #include "ui/gfx/frame_time.h" | 33 #include "ui/gfx/frame_time.h" |
| 34 #include "ui/gfx/hud_font.h" |
34 #include "ui/gl/gl_context.h" | 35 #include "ui/gl/gl_context.h" |
35 #include "ui/gl/gl_switches.h" | 36 #include "ui/gl/gl_switches.h" |
36 | 37 |
37 namespace { | 38 namespace { |
38 | 39 |
39 const double kDefaultRefreshRate = 60.0; | 40 const double kDefaultRefreshRate = 60.0; |
40 const double kTestRefreshRate = 200.0; | 41 const double kTestRefreshRate = 200.0; |
41 | 42 |
42 const int kCompositorLockTimeoutMs = 67; | 43 const int kCompositorLockTimeoutMs = 67; |
43 | 44 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 settings.initial_debug_state.show_occluding_rects = | 131 settings.initial_debug_state.show_occluding_rects = |
131 command_line->HasSwitch(cc::switches::kUIShowOccludingRects); | 132 command_line->HasSwitch(cc::switches::kUIShowOccludingRects); |
132 settings.initial_debug_state.show_non_occluding_rects = | 133 settings.initial_debug_state.show_non_occluding_rects = |
133 command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects); | 134 command_line->HasSwitch(cc::switches::kUIShowNonOccludingRects); |
134 | 135 |
135 settings.initial_debug_state.SetRecordRenderingStats( | 136 settings.initial_debug_state.SetRecordRenderingStats( |
136 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); | 137 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
137 | 138 |
138 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); | 139 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); |
139 settings.use_zero_copy = IsUIZeroCopyEnabled(); | 140 settings.use_zero_copy = IsUIZeroCopyEnabled(); |
| 141 settings.hud_typeface = ui::GetHudTypeface(); |
140 | 142 |
141 base::TimeTicks before_create = base::TimeTicks::Now(); | 143 base::TimeTicks before_create = base::TimeTicks::Now(); |
142 if (compositor_thread_loop_.get()) { | 144 if (compositor_thread_loop_.get()) { |
143 host_ = cc::LayerTreeHost::CreateThreaded( | 145 host_ = cc::LayerTreeHost::CreateThreaded( |
144 this, | 146 this, |
145 context_factory_->GetSharedBitmapManager(), | 147 context_factory_->GetSharedBitmapManager(), |
146 context_factory_->GetGpuMemoryBufferManager(), | 148 context_factory_->GetGpuMemoryBufferManager(), |
147 settings, | 149 settings, |
148 task_runner_, | 150 task_runner_, |
149 compositor_thread_loop_, | 151 compositor_thread_loop_, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 observer_list_, | 403 observer_list_, |
402 OnCompositingLockStateChanged(this)); | 404 OnCompositingLockStateChanged(this)); |
403 } | 405 } |
404 | 406 |
405 void Compositor::CancelCompositorLock() { | 407 void Compositor::CancelCompositorLock() { |
406 if (compositor_lock_) | 408 if (compositor_lock_) |
407 compositor_lock_->CancelLock(); | 409 compositor_lock_->CancelLock(); |
408 } | 410 } |
409 | 411 |
410 } // namespace ui | 412 } // namespace ui |
OLD | NEW |