| 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 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 CompositorImpl* compositor_; | 132 CompositorImpl* compositor_; |
| 133 cc::BeginFrameArgs last_begin_frame_args_; | 133 cc::BeginFrameArgs last_begin_frame_args_; |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 // Used to override capabilities_.adjust_deadline_for_parent to false | 136 // Used to override capabilities_.adjust_deadline_for_parent to false |
| 137 class OutputSurfaceWithoutParent : public cc::OutputSurface, | 137 class OutputSurfaceWithoutParent : public cc::OutputSurface, |
| 138 public CompositorImpl::VSyncObserver { | 138 public CompositorImpl::VSyncObserver { |
| 139 public: | 139 public: |
| 140 OutputSurfaceWithoutParent( | 140 OutputSurfaceWithoutParent( |
| 141 CompositorImpl* compositor, | 141 CompositorImpl* compositor, |
| 142 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 142 scoped_refptr<ContextProviderCommandBuffer> context_provider, |
| 143 const base::Callback<void(gpu::Capabilities)>& | 143 const base::Callback<void(gpu::Capabilities)>& |
| 144 populate_gpu_capabilities_callback, | 144 populate_gpu_capabilities_callback, |
| 145 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source) | 145 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source) |
| 146 : cc::OutputSurface(context_provider), | 146 : cc::OutputSurface(std::move(context_provider), nullptr, nullptr), |
| 147 compositor_(compositor), | 147 compositor_(compositor), |
| 148 populate_gpu_capabilities_callback_(populate_gpu_capabilities_callback), | 148 populate_gpu_capabilities_callback_(populate_gpu_capabilities_callback), |
| 149 swap_buffers_completion_callback_( | 149 swap_buffers_completion_callback_( |
| 150 base::Bind(&OutputSurfaceWithoutParent::OnSwapBuffersCompleted, | 150 base::Bind(&OutputSurfaceWithoutParent::OnSwapBuffersCompleted, |
| 151 base::Unretained(this))), | 151 base::Unretained(this))), |
| 152 overlay_candidate_validator_( | 152 overlay_candidate_validator_( |
| 153 new display_compositor:: | 153 new display_compositor:: |
| 154 CompositorOverlayCandidateValidatorAndroid()), | 154 CompositorOverlayCandidateValidatorAndroid()), |
| 155 begin_frame_source_(std::move(begin_frame_source)) { | 155 begin_frame_source_(std::move(begin_frame_source)) { |
| 156 capabilities_.adjust_deadline_for_parent = false; | 156 capabilities_.adjust_deadline_for_parent = false; |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 void CompositorImpl::SetNeedsAnimate() { | 802 void CompositorImpl::SetNeedsAnimate() { |
| 803 needs_animate_ = true; | 803 needs_animate_ = true; |
| 804 if (!host_->visible()) | 804 if (!host_->visible()) |
| 805 return; | 805 return; |
| 806 | 806 |
| 807 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); | 807 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); |
| 808 host_->SetNeedsAnimate(); | 808 host_->SetNeedsAnimate(); |
| 809 } | 809 } |
| 810 | 810 |
| 811 } // namespace content | 811 } // namespace content |
| OLD | NEW |