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()) | |
sky
2015/04/23 15:53:25
Why are you moving the recursion here?
danakj
2015/04/23 16:02:56
To make the Layer function a simpler method. The C
| |
332 SendDamagedRectsRecursive(child); | |
333 } | |
334 | |
329 void Compositor::Layout() { | 335 void Compositor::Layout() { |
330 if (root_layer_) | 336 if (!root_layer()) |
331 root_layer_->SendDamagedRects(); | 337 return; |
338 SendDamagedRectsRecursive(root_layer()); | |
332 } | 339 } |
333 | 340 |
334 void Compositor::RequestNewOutputSurface() { | 341 void Compositor::RequestNewOutputSurface() { |
335 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/466870 | 342 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/466870 |
336 // is fixed. | 343 // is fixed. |
337 tracked_objects::ScopedTracker tracking_profile( | 344 tracked_objects::ScopedTracker tracking_profile( |
338 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 345 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
339 "466870 Compositor::RequestNewOutputSurface")); | 346 "466870 Compositor::RequestNewOutputSurface")); |
340 | 347 |
341 context_factory_->CreateOutputSurface(weak_ptr_factory_.GetWeakPtr()); | 348 context_factory_->CreateOutputSurface(weak_ptr_factory_.GetWeakPtr()); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 observer_list_, | 424 observer_list_, |
418 OnCompositingLockStateChanged(this)); | 425 OnCompositingLockStateChanged(this)); |
419 } | 426 } |
420 | 427 |
421 void Compositor::CancelCompositorLock() { | 428 void Compositor::CancelCompositorLock() { |
422 if (compositor_lock_) | 429 if (compositor_lock_) |
423 compositor_lock_->CancelLock(); | 430 compositor_lock_->CancelLock(); |
424 } | 431 } |
425 | 432 |
426 } // namespace ui | 433 } // namespace ui |
OLD | NEW |