Chromium Code Reviews| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 cc::LayerTreeSettings settings; | 86 cc::LayerTreeSettings settings; |
| 87 | 87 |
| 88 // When impl-side painting is enabled, this will ensure PictureLayers always | 88 // When impl-side painting is enabled, this will ensure PictureLayers always |
| 89 // can have LCD text, to match the previous behaviour with ContentLayers, | 89 // can have LCD text, to match the previous behaviour with ContentLayers, |
| 90 // where LCD-not-allowed notifications were ignored. | 90 // where LCD-not-allowed notifications were ignored. |
| 91 settings.layers_always_allowed_lcd_text = true; | 91 settings.layers_always_allowed_lcd_text = true; |
| 92 settings.renderer_settings.refresh_rate = | 92 settings.renderer_settings.refresh_rate = |
| 93 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate | 93 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate |
| 94 : kDefaultRefreshRate; | 94 : kDefaultRefreshRate; |
| 95 settings.main_frame_before_activation_enabled = false; | 95 settings.main_frame_before_activation_enabled = false; |
| 96 settings.renderer_settings.disable_gpu_vsync = | 96 if (command_line->HasSwitch(switches::kDisableGpuVsync)) { |
| 97 command_line->HasSwitch(switches::kDisableGpuVsync); | 97 std::string displayVsyncStr = |
|
danakj
2015/07/14 19:43:42
display_vsync_string
Jimmy Jo
2015/07/15 00:47:27
Done.
| |
| 98 command_line->GetSwitchValueASCII(switches::kDisableGpuVsync); | |
| 99 settings.renderer_settings.disable_display_vsync = | |
|
brianderson
2015/07/14 01:48:25
Might be easier to read this way:
if (displayVsyn
Jimmy Jo
2015/07/15 00:47:27
Done.
| |
| 100 (displayVsyncStr == "gpu" || displayVsyncStr.empty()); | |
| 101 settings.wait_for_beginframe_interval = | |
| 102 !(displayVsyncStr == "beginframe" || displayVsyncStr.empty()); | |
| 103 } | |
| 98 settings.renderer_settings.partial_swap_enabled = | 104 settings.renderer_settings.partial_swap_enabled = |
| 99 !command_line->HasSwitch(cc::switches::kUIDisablePartialSwap); | 105 !command_line->HasSwitch(cc::switches::kUIDisablePartialSwap); |
| 100 #if defined(OS_WIN) | 106 #if defined(OS_WIN) |
| 101 settings.renderer_settings.finish_rendering_on_resize = true; | 107 settings.renderer_settings.finish_rendering_on_resize = true; |
| 102 #endif | 108 #endif |
| 103 | 109 |
| 104 // These flags should be mirrored by renderer versions in content/renderer/. | 110 // These flags should be mirrored by renderer versions in content/renderer/. |
| 105 settings.initial_debug_state.show_debug_borders = | 111 settings.initial_debug_state.show_debug_borders = |
| 106 command_line->HasSwitch(cc::switches::kUIShowCompositedLayerBorders); | 112 command_line->HasSwitch(cc::switches::kUIShowCompositedLayerBorders); |
| 107 settings.initial_debug_state.show_fps_counter = | 113 settings.initial_debug_state.show_fps_counter = |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 448 observer_list_, | 454 observer_list_, |
| 449 OnCompositingLockStateChanged(this)); | 455 OnCompositingLockStateChanged(this)); |
| 450 } | 456 } |
| 451 | 457 |
| 452 void Compositor::CancelCompositorLock() { | 458 void Compositor::CancelCompositorLock() { |
| 453 if (compositor_lock_) | 459 if (compositor_lock_) |
| 454 compositor_lock_->CancelLock(); | 460 compositor_lock_->CancelLock(); |
| 455 } | 461 } |
| 456 | 462 |
| 457 } // namespace ui | 463 } // namespace ui |
| OLD | NEW |