Chromium Code Reviews| 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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 767 | 767 |
| 768 void CompositorImpl::DeleteUIResource(cc::UIResourceId resource_id) { | 768 void CompositorImpl::DeleteUIResource(cc::UIResourceId resource_id) { |
| 769 TRACE_EVENT0("compositor", "CompositorImpl::DeleteUIResource"); | 769 TRACE_EVENT0("compositor", "CompositorImpl::DeleteUIResource"); |
| 770 host_->GetUIResourceManager()->DeleteUIResource(resource_id); | 770 host_->GetUIResourceManager()->DeleteUIResource(resource_id); |
| 771 } | 771 } |
| 772 | 772 |
| 773 bool CompositorImpl::SupportsETC1NonPowerOfTwo() const { | 773 bool CompositorImpl::SupportsETC1NonPowerOfTwo() const { |
| 774 return gpu_capabilities_.texture_format_etc1_npot; | 774 return gpu_capabilities_.texture_format_etc1_npot; |
| 775 } | 775 } |
| 776 | 776 |
| 777 void CompositorImpl::DidPostSwapBuffers() { | 777 void CompositorImpl::DidSubmitCompositorFrame() { |
| 778 TRACE_EVENT0("compositor", "CompositorImpl::DidPostSwapBuffers"); | 778 TRACE_EVENT0("compositor", "CompositorImpl::DidSubmitCompositorFrame"); |
| 779 pending_swapbuffers_++; | 779 pending_swapbuffers_++; |
| 780 } | 780 } |
| 781 | 781 |
| 782 void CompositorImpl::DidReceiveCompositorFrameAck() { | 782 void CompositorImpl::DidReceiveCompositorFrameAck() { |
| 783 TRACE_EVENT0("compositor", "CompositorImpl::DidReceiveCompositorFrameAck"); | 783 TRACE_EVENT0("compositor", "CompositorImpl::DidReceiveCompositorFrameAck"); |
| 784 DCHECK_GT(pending_swapbuffers_, 0U); | 784 DCHECK_GT(pending_swapbuffers_, 0U); |
| 785 pending_swapbuffers_--; | 785 pending_swapbuffers_--; |
| 786 client_->OnSwapBuffersCompleted(pending_swapbuffers_); | 786 client_->OnSwapBuffersCompleted(pending_swapbuffers_); |
| 787 } | 787 } |
| 788 | 788 |
| 789 void CompositorImpl::DidAbortSwapBuffers() { | 789 void CompositorImpl::DidLoseCompositorFrameSink() { |
| 790 TRACE_EVENT0("compositor", "CompositorImpl::DidAbortSwapBuffers"); | 790 TRACE_EVENT0("compositor", "CompositorImpl::DidLoseCompositorFrameSink"); |
| 791 // This really gets called only once from | |
| 792 // SingleThreadProxy::DidLoseCompositorFrameSinkOnImplThread() when the | |
| 793 // context was lost. | |
| 794 if (host_->IsVisible()) | |
| 795 host_->SetNeedsCommit(); | |
|
piman
2016/10/21 23:44:22
What makes it ok to remove? Is there another mecha
danakj
2016/10/21 23:46:20
Oh right this one. SingleThreadProxy::DidLoseCompo
| |
| 796 client_->OnSwapBuffersCompleted(0); | 791 client_->OnSwapBuffersCompleted(0); |
| 797 } | 792 } |
| 798 | 793 |
| 799 void CompositorImpl::DidCommit() { | 794 void CompositorImpl::DidCommit() { |
| 800 root_window_->OnCompositingDidCommit(); | 795 root_window_->OnCompositingDidCommit(); |
| 801 } | 796 } |
| 802 | 797 |
| 803 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { | 798 void CompositorImpl::AttachLayerForReadback(scoped_refptr<cc::Layer> layer) { |
| 804 readback_layer_tree_->AddChild(layer); | 799 readback_layer_tree_->AddChild(layer); |
| 805 } | 800 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 837 | 832 |
| 838 cc::FrameSinkId CompositorImpl::GetFrameSinkId() { | 833 cc::FrameSinkId CompositorImpl::GetFrameSinkId() { |
| 839 return frame_sink_id_; | 834 return frame_sink_id_; |
| 840 } | 835 } |
| 841 | 836 |
| 842 bool CompositorImpl::HavePendingReadbacks() { | 837 bool CompositorImpl::HavePendingReadbacks() { |
| 843 return !readback_layer_tree_->children().empty(); | 838 return !readback_layer_tree_->children().empty(); |
| 844 } | 839 } |
| 845 | 840 |
| 846 } // namespace content | 841 } // namespace content |
| OLD | NEW |