Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Side by Side Diff: ui/compositor/compositor.cc

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 surface_id_allocator_(context_factory->CreateSurfaceIdAllocator()), 74 surface_id_allocator_(context_factory->CreateSurfaceIdAllocator()),
75 task_runner_(task_runner), 75 task_runner_(task_runner),
76 vsync_manager_(new CompositorVSyncManager()), 76 vsync_manager_(new CompositorVSyncManager()),
77 device_scale_factor_(0.0f), 77 device_scale_factor_(0.0f),
78 last_started_frame_(0), 78 last_started_frame_(0),
79 last_ended_frame_(0), 79 last_ended_frame_(0),
80 locks_will_time_out_(true), 80 locks_will_time_out_(true),
81 compositor_lock_(NULL), 81 compositor_lock_(NULL),
82 layer_animator_collection_(this), 82 layer_animator_collection_(this),
83 weak_ptr_factory_(this) { 83 weak_ptr_factory_(this) {
84 root_web_layer_ = cc::Layer::Create(); 84 root_web_layer_ = cc::Layer::Create(Layer::UILayerSettings());
85 85
86 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 86 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
87 87
88 cc::LayerTreeSettings settings; 88 cc::LayerTreeSettings settings;
89 settings.hud_layer_settings = Layer::UILayerSettings();
90
89 // When impl-side painting is enabled, this will ensure PictureLayers always 91 // When impl-side painting is enabled, this will ensure PictureLayers always
90 // can have LCD text, to match the previous behaviour with ContentLayers, 92 // can have LCD text, to match the previous behaviour with ContentLayers,
91 // where LCD-not-allowed notifications were ignored. 93 // where LCD-not-allowed notifications were ignored.
92 settings.layers_always_allowed_lcd_text = true; 94 settings.layers_always_allowed_lcd_text = true;
93 settings.renderer_settings.refresh_rate = 95 settings.renderer_settings.refresh_rate =
94 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate 96 context_factory_->DoesCreateTestContexts() ? kTestRefreshRate
95 : kDefaultRefreshRate; 97 : kDefaultRefreshRate;
96 settings.main_frame_before_activation_enabled = false; 98 settings.main_frame_before_activation_enabled = false;
97 settings.throttle_frame_production = 99 settings.throttle_frame_production =
98 !command_line->HasSwitch(switches::kDisableGpuVsync); 100 !command_line->HasSwitch(switches::kDisableGpuVsync);
(...skipping 30 matching lines...) Expand all
129 settings.impl_side_painting = IsUIImplSidePaintingEnabled(); 131 settings.impl_side_painting = IsUIImplSidePaintingEnabled();
130 settings.use_display_lists = IsUISlimmingPaintEnabled(); 132 settings.use_display_lists = IsUISlimmingPaintEnabled();
131 settings.use_cached_picture_in_display_list = false; 133 settings.use_cached_picture_in_display_list = false;
132 settings.use_zero_copy = IsUIZeroCopyEnabled(); 134 settings.use_zero_copy = IsUIZeroCopyEnabled();
133 settings.use_one_copy = IsUIOneCopyEnabled(); 135 settings.use_one_copy = IsUIOneCopyEnabled();
134 settings.use_image_texture_target = context_factory_->GetImageTextureTarget(); 136 settings.use_image_texture_target = context_factory_->GetImageTextureTarget();
135 // Note: gathering of pixel refs is only needed when using multiple 137 // Note: gathering of pixel refs is only needed when using multiple
136 // raster threads. 138 // raster threads.
137 settings.gather_pixel_refs = false; 139 settings.gather_pixel_refs = false;
138 140
139 settings.use_compositor_animation_timelines =
140 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines);
141
142 base::TimeTicks before_create = base::TimeTicks::Now(); 141 base::TimeTicks before_create = base::TimeTicks::Now();
143 142
144 cc::LayerTreeHost::InitParams params; 143 cc::LayerTreeHost::InitParams params;
145 params.client = this; 144 params.client = this;
146 params.shared_bitmap_manager = context_factory_->GetSharedBitmapManager(); 145 params.shared_bitmap_manager = context_factory_->GetSharedBitmapManager();
147 params.gpu_memory_buffer_manager = 146 params.gpu_memory_buffer_manager =
148 context_factory_->GetGpuMemoryBufferManager(); 147 context_factory_->GetGpuMemoryBufferManager();
149 params.task_graph_runner = context_factory_->GetTaskGraphRunner(); 148 params.task_graph_runner = context_factory_->GetTaskGraphRunner();
150 params.settings = &settings; 149 params.settings = &settings;
151 params.main_task_runner = task_runner_; 150 params.main_task_runner = task_runner_;
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 observer_list_, 441 observer_list_,
443 OnCompositingLockStateChanged(this)); 442 OnCompositingLockStateChanged(this));
444 } 443 }
445 444
446 void Compositor::CancelCompositorLock() { 445 void Compositor::CancelCompositorLock() {
447 if (compositor_lock_) 446 if (compositor_lock_)
448 compositor_lock_->CancelLock(); 447 compositor_lock_->CancelLock();
449 } 448 }
450 449
451 } // namespace ui 450 } // namespace ui
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698