| 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 "content/browser/renderer_host/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <unordered_set> | 10 #include <unordered_set> |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 readback_layer_tree_->AddChild(layer); | 804 readback_layer_tree_->AddChild(layer); |
| 805 } | 805 } |
| 806 | 806 |
| 807 void CompositorImpl::RequestCopyOfOutputOnRootLayer( | 807 void CompositorImpl::RequestCopyOfOutputOnRootLayer( |
| 808 std::unique_ptr<cc::CopyOutputRequest> request) { | 808 std::unique_ptr<cc::CopyOutputRequest> request) { |
| 809 root_window_->GetLayer()->RequestCopyOfOutput(std::move(request)); | 809 root_window_->GetLayer()->RequestCopyOfOutput(std::move(request)); |
| 810 } | 810 } |
| 811 | 811 |
| 812 void CompositorImpl::OnVSync(base::TimeTicks frame_time, | 812 void CompositorImpl::OnVSync(base::TimeTicks frame_time, |
| 813 base::TimeDelta vsync_period) { | 813 base::TimeDelta vsync_period) { |
| 814 FOR_EACH_OBSERVER(VSyncObserver, observer_list_, | 814 for (auto& observer : observer_list_) |
| 815 OnVSync(frame_time, vsync_period)); | 815 observer.OnVSync(frame_time, vsync_period); |
| 816 if (needs_begin_frames_) | 816 if (needs_begin_frames_) |
| 817 root_window_->RequestVSyncUpdate(); | 817 root_window_->RequestVSyncUpdate(); |
| 818 } | 818 } |
| 819 | 819 |
| 820 void CompositorImpl::OnNeedsBeginFramesChange(bool needs_begin_frames) { | 820 void CompositorImpl::OnNeedsBeginFramesChange(bool needs_begin_frames) { |
| 821 if (needs_begin_frames_ == needs_begin_frames) | 821 if (needs_begin_frames_ == needs_begin_frames) |
| 822 return; | 822 return; |
| 823 | 823 |
| 824 needs_begin_frames_ = needs_begin_frames; | 824 needs_begin_frames_ = needs_begin_frames; |
| 825 if (needs_begin_frames_) | 825 if (needs_begin_frames_) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 837 | 837 |
| 838 cc::FrameSinkId CompositorImpl::GetFrameSinkId() { | 838 cc::FrameSinkId CompositorImpl::GetFrameSinkId() { |
| 839 return frame_sink_id_; | 839 return frame_sink_id_; |
| 840 } | 840 } |
| 841 | 841 |
| 842 bool CompositorImpl::HavePendingReadbacks() { | 842 bool CompositorImpl::HavePendingReadbacks() { |
| 843 return !readback_layer_tree_->children().empty(); | 843 return !readback_layer_tree_->children().empty(); |
| 844 } | 844 } |
| 845 | 845 |
| 846 } // namespace content | 846 } // namespace content |
| OLD | NEW |