| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 locks_will_time_out_(true), | 78 locks_will_time_out_(true), |
| 79 compositor_lock_(NULL), | 79 compositor_lock_(NULL), |
| 80 layer_animator_collection_(this), | 80 layer_animator_collection_(this), |
| 81 weak_ptr_factory_(this) { | 81 weak_ptr_factory_(this) { |
| 82 root_web_layer_ = cc::Layer::Create(Layer::UILayerSettings()); | 82 root_web_layer_ = cc::Layer::Create(Layer::UILayerSettings()); |
| 83 | 83 |
| 84 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 84 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 85 | 85 |
| 86 cc::LayerTreeSettings settings; | 86 cc::LayerTreeSettings settings; |
| 87 | 87 |
| 88 // When impl-side painting is enabled, this will ensure PictureLayers always | 88 // This will ensure PictureLayers always can have LCD text, to match the |
| 89 // can have LCD text, to match the previous behaviour with ContentLayers, | 89 // previous behaviour with ContentLayers, where LCD-not-allowed notifications |
| 90 // where LCD-not-allowed notifications were ignored. | 90 // were ignored. |
| 91 settings.layers_always_allowed_lcd_text = true; | 91 settings.layers_always_allowed_lcd_text = true; |
| 92 // Use occlusion to allow more overlapping windows to take less memory. |
| 93 settings.use_occlusion_for_tile_prioritization = true; |
| 92 settings.renderer_settings.refresh_rate = | 94 settings.renderer_settings.refresh_rate = |
| 93 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate | 95 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate |
| 94 : kDefaultRefreshRate; | 96 : kDefaultRefreshRate; |
| 95 settings.main_frame_before_activation_enabled = false; | 97 settings.main_frame_before_activation_enabled = false; |
| 96 if (command_line->HasSwitch(switches::kDisableGpuVsync)) { | 98 if (command_line->HasSwitch(switches::kDisableGpuVsync)) { |
| 97 std::string display_vsync_string = | 99 std::string display_vsync_string = |
| 98 command_line->GetSwitchValueASCII(switches::kDisableGpuVsync); | 100 command_line->GetSwitchValueASCII(switches::kDisableGpuVsync); |
| 99 if (display_vsync_string == "gpu") { | 101 if (display_vsync_string == "gpu") { |
| 100 settings.renderer_settings.disable_display_vsync = true; | 102 settings.renderer_settings.disable_display_vsync = true; |
| 101 } else if (display_vsync_string == "beginframe") { | 103 } else if (display_vsync_string == "beginframe") { |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 observer_list_, | 460 observer_list_, |
| 459 OnCompositingLockStateChanged(this)); | 461 OnCompositingLockStateChanged(this)); |
| 460 } | 462 } |
| 461 | 463 |
| 462 void Compositor::CancelCompositorLock() { | 464 void Compositor::CancelCompositorLock() { |
| 463 if (compositor_lock_) | 465 if (compositor_lock_) |
| 464 compositor_lock_->CancelLock(); | 466 compositor_lock_->CancelLock(); |
| 465 } | 467 } |
| 466 | 468 |
| 467 } // namespace ui | 469 } // namespace ui |
| OLD | NEW |