| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // This will ensure PictureLayers always can have LCD text, to match the | 80 // This will ensure PictureLayers always can have LCD text, to match the |
| 81 // previous behaviour with ContentLayers, where LCD-not-allowed notifications | 81 // previous behaviour with ContentLayers, where LCD-not-allowed notifications |
| 82 // were ignored. | 82 // were ignored. |
| 83 settings.layers_always_allowed_lcd_text = true; | 83 settings.layers_always_allowed_lcd_text = true; |
| 84 // Use occlusion to allow more overlapping windows to take less memory. | 84 // Use occlusion to allow more overlapping windows to take less memory. |
| 85 settings.use_occlusion_for_tile_prioritization = true; | 85 settings.use_occlusion_for_tile_prioritization = true; |
| 86 refresh_rate_ = settings.renderer_settings.refresh_rate = | 86 refresh_rate_ = settings.renderer_settings.refresh_rate = |
| 87 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate | 87 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate |
| 88 : kDefaultRefreshRate; | 88 : kDefaultRefreshRate; |
| 89 settings.main_frame_before_activation_enabled = false; | 89 settings.main_frame_before_activation_enabled = false; |
| 90 if (command_line->HasSwitch(switches::kDisableGpuVsync)) { | |
| 91 std::string display_vsync_string = | |
| 92 command_line->GetSwitchValueASCII(switches::kDisableGpuVsync); | |
| 93 // See comments in gl_switches about this flag. The browser compositor | |
| 94 // is only unthrottled when "gpu" or no switch value is passed, as it | |
| 95 // is driven directly by the display compositor. | |
| 96 if (display_vsync_string != "beginframe") { | |
| 97 settings.renderer_settings.disable_display_vsync = true; | |
| 98 } | |
| 99 } | |
| 100 settings.renderer_settings.partial_swap_enabled = | 90 settings.renderer_settings.partial_swap_enabled = |
| 101 !command_line->HasSwitch(switches::kUIDisablePartialSwap); | 91 !command_line->HasSwitch(switches::kUIDisablePartialSwap); |
| 102 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
| 103 settings.renderer_settings.finish_rendering_on_resize = true; | 93 settings.renderer_settings.finish_rendering_on_resize = true; |
| 104 #elif defined(OS_MACOSX) | 94 #elif defined(OS_MACOSX) |
| 105 settings.renderer_settings.release_overlay_resources_after_gpu_query = true; | 95 settings.renderer_settings.release_overlay_resources_after_gpu_query = true; |
| 106 #endif | 96 #endif |
| 107 settings.renderer_settings.gl_composited_texture_quad_border = | 97 settings.renderer_settings.gl_composited_texture_quad_border = |
| 108 command_line->HasSwitch(cc::switches::kGlCompositedTextureQuadBorder); | 98 command_line->HasSwitch(cc::switches::kGlCompositedTextureQuadBorder); |
| 109 settings.renderer_settings.show_overdraw_feedback = | 99 settings.renderer_settings.show_overdraw_feedback = |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 void Compositor::TimeoutLocks() { | 586 void Compositor::TimeoutLocks() { |
| 597 // Make a copy, we're going to cause |active_locks_| to become | 587 // Make a copy, we're going to cause |active_locks_| to become |
| 598 // empty. | 588 // empty. |
| 599 std::vector<CompositorLock*> locks = active_locks_; | 589 std::vector<CompositorLock*> locks = active_locks_; |
| 600 for (auto* lock : locks) | 590 for (auto* lock : locks) |
| 601 lock->TimeoutLock(); | 591 lock->TimeoutLock(); |
| 602 DCHECK(active_locks_.empty()); | 592 DCHECK(active_locks_.empty()); |
| 603 } | 593 } |
| 604 | 594 |
| 605 } // namespace ui | 595 } // namespace ui |
| OLD | NEW |