| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 new display_compositor:: | 150 new display_compositor:: |
| 151 CompositorOverlayCandidateValidatorAndroid()), | 151 CompositorOverlayCandidateValidatorAndroid()), |
| 152 weak_ptr_factory_(this) { | 152 weak_ptr_factory_(this) { |
| 153 capabilities_.max_frames_pending = kMaxDisplaySwapBuffers; | 153 capabilities_.max_frames_pending = kMaxDisplaySwapBuffers; |
| 154 } | 154 } |
| 155 | 155 |
| 156 ~AndroidOutputSurface() override = default; | 156 ~AndroidOutputSurface() override = default; |
| 157 | 157 |
| 158 void SwapBuffers(cc::OutputSurfaceFrame frame) override { | 158 void SwapBuffers(cc::OutputSurfaceFrame frame) override { |
| 159 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info); | 159 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info); |
| 160 if (frame.sub_buffer_rect.IsEmpty()) { | 160 if (frame.sub_buffer_rect) { |
| 161 DCHECK(frame.sub_buffer_rect->IsEmpty()); |
| 161 context_provider_->ContextSupport()->CommitOverlayPlanes(); | 162 context_provider_->ContextSupport()->CommitOverlayPlanes(); |
| 162 } else { | 163 } else { |
| 163 DCHECK(frame.sub_buffer_rect == gfx::Rect(frame.size)); | |
| 164 context_provider_->ContextSupport()->Swap(); | 164 context_provider_->ContextSupport()->Swap(); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 void BindToClient(cc::OutputSurfaceClient* client) override { | 168 void BindToClient(cc::OutputSurfaceClient* client) override { |
| 169 DCHECK(client); | 169 DCHECK(client); |
| 170 DCHECK(!client_); | 170 DCHECK(!client_); |
| 171 client_ = client; | 171 client_ = client; |
| 172 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( | 172 GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( |
| 173 base::Bind(&AndroidOutputSurface::OnSwapBuffersCompleted, | 173 base::Bind(&AndroidOutputSurface::OnSwapBuffersCompleted, |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 ui::ContextProviderFactory::GetInstance() | 762 ui::ContextProviderFactory::GetInstance() |
| 763 ->GetSurfaceManager() | 763 ->GetSurfaceManager() |
| 764 ->UnregisterFrameSinkHierarchy(frame_sink_id_, frame_sink_id); | 764 ->UnregisterFrameSinkHierarchy(frame_sink_id_, frame_sink_id); |
| 765 } | 765 } |
| 766 | 766 |
| 767 bool CompositorImpl::HavePendingReadbacks() { | 767 bool CompositorImpl::HavePendingReadbacks() { |
| 768 return !readback_layer_tree_->children().empty(); | 768 return !readback_layer_tree_->children().empty(); |
| 769 } | 769 } |
| 770 | 770 |
| 771 } // namespace content | 771 } // namespace content |
| OLD | NEW |