OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/compositor/delegated_frame_host.h" | 5 #include "content/browser/compositor/delegated_frame_host.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 // We may have had a resize while we had the lock (e.g. if the lock expired, | 744 // We may have had a resize while we had the lock (e.g. if the lock expired, |
745 // or if the UI still gave us some resizes), so make sure we grab a new lock | 745 // or if the UI still gave us some resizes), so make sure we grab a new lock |
746 // if necessary. | 746 // if necessary. |
747 MaybeCreateResizeLock(); | 747 MaybeCreateResizeLock(); |
748 } | 748 } |
749 } | 749 } |
750 | 750 |
751 void DelegatedFrameHost::OnCompositingStarted( | 751 void DelegatedFrameHost::OnCompositingStarted( |
752 ui::Compositor* compositor, base::TimeTicks start_time) { | 752 ui::Compositor* compositor, base::TimeTicks start_time) { |
753 last_draw_ended_ = start_time; | 753 last_draw_ended_ = start_time; |
754 client_->DelegatedCompositorDidSwapBuffers(); | |
755 } | 754 } |
756 | 755 |
757 void DelegatedFrameHost::OnCompositingEnded( | 756 void DelegatedFrameHost::OnCompositingEnded( |
758 ui::Compositor* compositor) { | 757 ui::Compositor* compositor) { |
759 } | 758 } |
760 | 759 |
761 void DelegatedFrameHost::OnCompositingAborted(ui::Compositor* compositor) { | 760 void DelegatedFrameHost::OnCompositingAborted(ui::Compositor* compositor) { |
762 client_->DelegatedCompositorAbortedSwapBuffers(); | |
763 } | 761 } |
764 | 762 |
765 void DelegatedFrameHost::OnCompositingLockStateChanged( | 763 void DelegatedFrameHost::OnCompositingLockStateChanged( |
766 ui::Compositor* compositor) { | 764 ui::Compositor* compositor) { |
767 // A compositor lock that is part of a resize lock timed out. We | 765 // A compositor lock that is part of a resize lock timed out. We |
768 // should display a renderer frame. | 766 // should display a renderer frame. |
769 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { | 767 if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { |
770 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; | 768 can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; |
771 } | 769 } |
772 } | 770 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 // that should keep our frame. old_layer will be returned to the | 874 // that should keep our frame. old_layer will be returned to the |
877 // RecreateLayer caller, and should have a copy. | 875 // RecreateLayer caller, and should have a copy. |
878 if (frame_provider_.get()) { | 876 if (frame_provider_.get()) { |
879 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 877 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
880 current_frame_size_in_dip_); | 878 current_frame_size_in_dip_); |
881 } | 879 } |
882 } | 880 } |
883 | 881 |
884 } // namespace content | 882 } // namespace content |
885 | 883 |
OLD | NEW |