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

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

Issue 910393002: Disable rendering when suspending on chrome os (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up Created 5 years, 10 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
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 host_->SetNeedsRedraw(); 221 host_->SetNeedsRedraw();
222 host_->SetNeedsCommit(); 222 host_->SetNeedsCommit();
223 } 223 }
224 224
225 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) { 225 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) {
226 // TODO(enne): Make this not commit. See ScheduleFullRedraw. 226 // TODO(enne): Make this not commit. See ScheduleFullRedraw.
227 host_->SetNeedsRedrawRect(damage_rect); 227 host_->SetNeedsRedrawRect(damage_rect);
228 host_->SetNeedsCommit(); 228 host_->SetNeedsCommit();
229 } 229 }
230 230
231 void Compositor::DisableSwap() {
piman 2015/02/11 02:48:22 I'd prefer calling it FinishAllRendering(). It doe
Chirantan Ekbote 2015/02/18 02:47:13 Done.
232 host_->FinishAllRendering();
233 }
234
231 void Compositor::DisableSwapUntilResize() { 235 void Compositor::DisableSwapUntilResize() {
232 host_->FinishAllRendering(); 236 host_->FinishAllRendering();
233 context_factory_->ResizeDisplay(this, gfx::Size()); 237 context_factory_->ResizeDisplay(this, gfx::Size());
234 } 238 }
235 239
236 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { 240 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) {
237 scoped_ptr<cc::SwapPromise> swap_promise( 241 scoped_ptr<cc::SwapPromise> swap_promise(
238 new cc::LatencyInfoSwapPromise(latency_info)); 242 new cc::LatencyInfoSwapPromise(latency_info));
239 host_->QueueSwapPromise(swap_promise.Pass()); 243 host_->QueueSwapPromise(swap_promise.Pass());
240 } 244 }
(...skipping 16 matching lines...) Expand all
257 261
258 void Compositor::SetBackgroundColor(SkColor color) { 262 void Compositor::SetBackgroundColor(SkColor color) {
259 host_->set_background_color(color); 263 host_->set_background_color(color);
260 ScheduleDraw(); 264 ScheduleDraw();
261 } 265 }
262 266
263 void Compositor::SetVisible(bool visible) { 267 void Compositor::SetVisible(bool visible) {
264 host_->SetVisible(visible); 268 host_->SetVisible(visible);
265 } 269 }
266 270
271 bool Compositor::IsVisible() {
272 return host_->visible();
273 }
274
267 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { 275 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const {
268 return vsync_manager_; 276 return vsync_manager_;
269 } 277 }
270 278
271 void Compositor::AddObserver(CompositorObserver* observer) { 279 void Compositor::AddObserver(CompositorObserver* observer) {
272 observer_list_.AddObserver(observer); 280 observer_list_.AddObserver(observer);
273 } 281 }
274 282
275 void Compositor::RemoveObserver(CompositorObserver* observer) { 283 void Compositor::RemoveObserver(CompositorObserver* observer) {
276 observer_list_.RemoveObserver(observer); 284 observer_list_.RemoveObserver(observer);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 observer_list_, 411 observer_list_,
404 OnCompositingLockStateChanged(this)); 412 OnCompositingLockStateChanged(this));
405 } 413 }
406 414
407 void Compositor::CancelCompositorLock() { 415 void Compositor::CancelCompositorLock() {
408 if (compositor_lock_) 416 if (compositor_lock_)
409 compositor_lock_->CancelLock(); 417 compositor_lock_->CancelLock();
410 } 418 }
411 419
412 } // namespace ui 420 } // namespace ui
OLDNEW
« ash/system/chromeos/power/power_event_observer_unittest.cc ('K') | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698