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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 void Compositor::Layout() { | 335 void Compositor::Layout() { |
336 // We're sending damage that will be addressed during this composite | 336 // We're sending damage that will be addressed during this composite |
337 // cycle, so we don't need to schedule another composite to address it. | 337 // cycle, so we don't need to schedule another composite to address it. |
338 disable_schedule_composite_ = true; | 338 disable_schedule_composite_ = true; |
339 if (root_layer_) | 339 if (root_layer_) |
340 root_layer_->SendDamagedRects(); | 340 root_layer_->SendDamagedRects(); |
341 disable_schedule_composite_ = false; | 341 disable_schedule_composite_ = false; |
342 } | 342 } |
343 | 343 |
344 void Compositor::RequestNewOutputSurface(bool fallback) { | 344 scoped_ptr<cc::OutputSurface> Compositor::CreateOutputSurface(bool fallback) { |
345 host_->SetOutputSurface( | 345 return context_factory_->CreateOutputSurface(this, fallback); |
346 context_factory_->CreateOutputSurface(this, fallback)); | |
347 } | 346 } |
348 | 347 |
349 void Compositor::DidCommit() { | 348 void Compositor::DidCommit() { |
350 DCHECK(!IsLocked()); | 349 DCHECK(!IsLocked()); |
351 FOR_EACH_OBSERVER(CompositorObserver, | 350 FOR_EACH_OBSERVER(CompositorObserver, |
352 observer_list_, | 351 observer_list_, |
353 OnCompositingDidCommit(this)); | 352 OnCompositingDidCommit(this)); |
354 } | 353 } |
355 | 354 |
356 void Compositor::DidCommitAndDrawFrame() { | 355 void Compositor::DidCommitAndDrawFrame() { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 // Call ScheduleDraw() instead of Draw() in order to allow other | 443 // Call ScheduleDraw() instead of Draw() in order to allow other |
445 // CompositorObservers to be notified before starting another | 444 // CompositorObservers to be notified before starting another |
446 // draw cycle. | 445 // draw cycle. |
447 ScheduleDraw(); | 446 ScheduleDraw(); |
448 } | 447 } |
449 FOR_EACH_OBSERVER( | 448 FOR_EACH_OBSERVER( |
450 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 449 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
451 } | 450 } |
452 | 451 |
453 } // namespace ui | 452 } // namespace ui |
OLD | NEW |