| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 ui::ContextFactory* context_factory, | 76 ui::ContextFactory* context_factory, |
| 77 ui::ContextFactoryPrivate* context_factory_private, | 77 ui::ContextFactoryPrivate* context_factory_private, |
| 78 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | 78 scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
| 79 : context_factory_(context_factory), | 79 : context_factory_(context_factory), |
| 80 context_factory_private_(context_factory_private), | 80 context_factory_private_(context_factory_private), |
| 81 root_layer_(NULL), | 81 root_layer_(NULL), |
| 82 widget_(gfx::kNullAcceleratedWidget), | 82 widget_(gfx::kNullAcceleratedWidget), |
| 83 #if defined(USE_AURA) | 83 #if defined(USE_AURA) |
| 84 window_(nullptr), | 84 window_(nullptr), |
| 85 #endif | 85 #endif |
| 86 submitted_frame_number_(0), |
| 86 widget_valid_(false), | 87 widget_valid_(false), |
| 87 compositor_frame_sink_requested_(false), | 88 compositor_frame_sink_requested_(false), |
| 88 frame_sink_id_(frame_sink_id), | 89 frame_sink_id_(frame_sink_id), |
| 89 task_runner_(task_runner), | 90 task_runner_(task_runner), |
| 90 vsync_manager_(new CompositorVSyncManager()), | 91 vsync_manager_(new CompositorVSyncManager()), |
| 91 device_scale_factor_(0.0f), | 92 device_scale_factor_(0.0f), |
| 92 locks_will_time_out_(true), | 93 locks_will_time_out_(true), |
| 93 compositor_lock_(NULL), | 94 compositor_lock_(NULL), |
| 94 layer_animator_collection_(this), | 95 layer_animator_collection_(this), |
| 95 weak_ptr_factory_(this) { | 96 weak_ptr_factory_(this) { |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 for (auto& observer : observer_list_) | 516 for (auto& observer : observer_list_) |
| 516 observer.OnCompositingDidCommit(this); | 517 observer.OnCompositingDidCommit(this); |
| 517 } | 518 } |
| 518 | 519 |
| 519 void Compositor::DidReceiveCompositorFrameAck() { | 520 void Compositor::DidReceiveCompositorFrameAck() { |
| 520 for (auto& observer : observer_list_) | 521 for (auto& observer : observer_list_) |
| 521 observer.OnCompositingEnded(this); | 522 observer.OnCompositingEnded(this); |
| 522 } | 523 } |
| 523 | 524 |
| 524 void Compositor::DidSubmitCompositorFrame() { | 525 void Compositor::DidSubmitCompositorFrame() { |
| 526 ++submitted_frame_number_; |
| 525 base::TimeTicks start_time = base::TimeTicks::Now(); | 527 base::TimeTicks start_time = base::TimeTicks::Now(); |
| 526 for (auto& observer : observer_list_) | 528 for (auto& observer : observer_list_) |
| 527 observer.OnCompositingStarted(this, start_time); | 529 observer.OnCompositingStarted(this, start_time); |
| 528 } | 530 } |
| 529 | 531 |
| 530 void Compositor::SetOutputIsSecure(bool output_is_secure) { | 532 void Compositor::SetOutputIsSecure(bool output_is_secure) { |
| 531 if (context_factory_private_) | 533 if (context_factory_private_) |
| 532 context_factory_private_->SetOutputIsSecure(this, output_is_secure); | 534 context_factory_private_->SetOutputIsSecure(this, output_is_secure); |
| 533 } | 535 } |
| 534 | 536 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 562 for (auto& observer : observer_list_) | 564 for (auto& observer : observer_list_) |
| 563 observer.OnCompositingLockStateChanged(this); | 565 observer.OnCompositingLockStateChanged(this); |
| 564 } | 566 } |
| 565 | 567 |
| 566 void Compositor::CancelCompositorLock() { | 568 void Compositor::CancelCompositorLock() { |
| 567 if (compositor_lock_) | 569 if (compositor_lock_) |
| 568 compositor_lock_->CancelLock(); | 570 compositor_lock_->CancelLock(); |
| 569 } | 571 } |
| 570 | 572 |
| 571 } // namespace ui | 573 } // namespace ui |
| OLD | NEW |