| 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 scoped_ptr<cc::OutputSurface> Compositor::CreateOutputSurface(bool fallback) { | 344 void Compositor::RequestNewOutputSurface(bool fallback) { |
| 345 return context_factory_->CreateOutputSurface(this, fallback); | 345 host_->SetOutputSurface( |
| 346 context_factory_->CreateOutputSurface(this, fallback)); |
| 346 } | 347 } |
| 347 | 348 |
| 348 void Compositor::DidCommit() { | 349 void Compositor::DidCommit() { |
| 349 DCHECK(!IsLocked()); | 350 DCHECK(!IsLocked()); |
| 350 FOR_EACH_OBSERVER(CompositorObserver, | 351 FOR_EACH_OBSERVER(CompositorObserver, |
| 351 observer_list_, | 352 observer_list_, |
| 352 OnCompositingDidCommit(this)); | 353 OnCompositingDidCommit(this)); |
| 353 } | 354 } |
| 354 | 355 |
| 355 void Compositor::DidCommitAndDrawFrame() { | 356 void Compositor::DidCommitAndDrawFrame() { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // Call ScheduleDraw() instead of Draw() in order to allow other | 444 // Call ScheduleDraw() instead of Draw() in order to allow other |
| 444 // CompositorObservers to be notified before starting another | 445 // CompositorObservers to be notified before starting another |
| 445 // draw cycle. | 446 // draw cycle. |
| 446 ScheduleDraw(); | 447 ScheduleDraw(); |
| 447 } | 448 } |
| 448 FOR_EACH_OBSERVER( | 449 FOR_EACH_OBSERVER( |
| 449 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 450 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
| 450 } | 451 } |
| 451 | 452 |
| 452 } // namespace ui | 453 } // namespace ui |
| OLD | NEW |