| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 FOR_EACH_OBSERVER(CompositorAnimationObserver, | 319 FOR_EACH_OBSERVER(CompositorAnimationObserver, |
| 320 animation_observer_list_, | 320 animation_observer_list_, |
| 321 OnAnimationStep(args.frame_time)); | 321 OnAnimationStep(args.frame_time)); |
| 322 if (animation_observer_list_.might_have_observers()) | 322 if (animation_observer_list_.might_have_observers()) |
| 323 host_->SetNeedsAnimate(); | 323 host_->SetNeedsAnimate(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void Compositor::BeginMainFrameNotExpectedSoon() { | 326 void Compositor::BeginMainFrameNotExpectedSoon() { |
| 327 } | 327 } |
| 328 | 328 |
| 329 static void SendDamagedRectsRecursive(ui::Layer* layer) { | |
| 330 layer->SendDamagedRects(); | |
| 331 for (auto* child : layer->children()) | |
| 332 SendDamagedRectsRecursive(child); | |
| 333 } | |
| 334 | |
| 335 void Compositor::Layout() { | 329 void Compositor::Layout() { |
| 336 if (!root_layer()) | 330 if (root_layer_) |
| 337 return; | 331 root_layer_->SendDamagedRects(); |
| 338 SendDamagedRectsRecursive(root_layer()); | |
| 339 } | 332 } |
| 340 | 333 |
| 341 void Compositor::RequestNewOutputSurface() { | 334 void Compositor::RequestNewOutputSurface() { |
| 342 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/466870 | 335 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/466870 |
| 343 // is fixed. | 336 // is fixed. |
| 344 tracked_objects::ScopedTracker tracking_profile( | 337 tracked_objects::ScopedTracker tracking_profile( |
| 345 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 338 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 346 "466870 Compositor::RequestNewOutputSurface")); | 339 "466870 Compositor::RequestNewOutputSurface")); |
| 347 | 340 |
| 348 context_factory_->CreateOutputSurface(weak_ptr_factory_.GetWeakPtr()); | 341 context_factory_->CreateOutputSurface(weak_ptr_factory_.GetWeakPtr()); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 observer_list_, | 417 observer_list_, |
| 425 OnCompositingLockStateChanged(this)); | 418 OnCompositingLockStateChanged(this)); |
| 426 } | 419 } |
| 427 | 420 |
| 428 void Compositor::CancelCompositorLock() { | 421 void Compositor::CancelCompositorLock() { |
| 429 if (compositor_lock_) | 422 if (compositor_lock_) |
| 430 compositor_lock_->CancelLock(); | 423 compositor_lock_->CancelLock(); |
| 431 } | 424 } |
| 432 | 425 |
| 433 } // namespace ui | 426 } // namespace ui |
| OLD | NEW |