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

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: Make PowerEventObserver getter cros-specific 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
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 host_->SetNeedsRedraw(); 217 host_->SetNeedsRedraw();
218 host_->SetNeedsCommit(); 218 host_->SetNeedsCommit();
219 } 219 }
220 220
221 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) { 221 void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) {
222 // TODO(enne): Make this not commit. See ScheduleFullRedraw. 222 // TODO(enne): Make this not commit. See ScheduleFullRedraw.
223 host_->SetNeedsRedrawRect(damage_rect); 223 host_->SetNeedsRedrawRect(damage_rect);
224 host_->SetNeedsCommit(); 224 host_->SetNeedsCommit();
225 } 225 }
226 226
227 void Compositor::FinishAllRendering() {
228 host_->FinishAllRendering();
229 }
230
227 void Compositor::DisableSwapUntilResize() { 231 void Compositor::DisableSwapUntilResize() {
228 host_->FinishAllRendering(); 232 host_->FinishAllRendering();
229 context_factory_->ResizeDisplay(this, gfx::Size()); 233 context_factory_->ResizeDisplay(this, gfx::Size());
230 } 234 }
231 235
232 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { 236 void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) {
233 scoped_ptr<cc::SwapPromise> swap_promise( 237 scoped_ptr<cc::SwapPromise> swap_promise(
234 new cc::LatencyInfoSwapPromise(latency_info)); 238 new cc::LatencyInfoSwapPromise(latency_info));
235 host_->QueueSwapPromise(swap_promise.Pass()); 239 host_->QueueSwapPromise(swap_promise.Pass());
236 } 240 }
(...skipping 16 matching lines...) Expand all
253 257
254 void Compositor::SetBackgroundColor(SkColor color) { 258 void Compositor::SetBackgroundColor(SkColor color) {
255 host_->set_background_color(color); 259 host_->set_background_color(color);
256 ScheduleDraw(); 260 ScheduleDraw();
257 } 261 }
258 262
259 void Compositor::SetVisible(bool visible) { 263 void Compositor::SetVisible(bool visible) {
260 host_->SetVisible(visible); 264 host_->SetVisible(visible);
261 } 265 }
262 266
267 bool Compositor::IsVisible() {
268 return host_->visible();
269 }
270
263 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const { 271 scoped_refptr<CompositorVSyncManager> Compositor::vsync_manager() const {
264 return vsync_manager_; 272 return vsync_manager_;
265 } 273 }
266 274
267 void Compositor::AddObserver(CompositorObserver* observer) { 275 void Compositor::AddObserver(CompositorObserver* observer) {
268 observer_list_.AddObserver(observer); 276 observer_list_.AddObserver(observer);
269 } 277 }
270 278
271 void Compositor::RemoveObserver(CompositorObserver* observer) { 279 void Compositor::RemoveObserver(CompositorObserver* observer) {
272 observer_list_.RemoveObserver(observer); 280 observer_list_.RemoveObserver(observer);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 observer_list_, 410 observer_list_,
403 OnCompositingLockStateChanged(this)); 411 OnCompositingLockStateChanged(this));
404 } 412 }
405 413
406 void Compositor::CancelCompositorLock() { 414 void Compositor::CancelCompositorLock() {
407 if (compositor_lock_) 415 if (compositor_lock_)
408 compositor_lock_->CancelLock(); 416 compositor_lock_->CancelLock();
409 } 417 }
410 418
411 } // namespace ui 419 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698