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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 std::unique_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator_; | 230 std::unique_ptr<cc::OverlayCandidateValidator> overlay_candidate_validator_; |
231 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_; | 231 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_; |
232 }; | 232 }; |
233 | 233 |
234 #if defined(ENABLE_VULKAN) | 234 #if defined(ENABLE_VULKAN) |
235 class VulkanOutputSurface : public cc::OutputSurface { | 235 class VulkanOutputSurface : public cc::OutputSurface { |
236 public: | 236 public: |
237 VulkanOutputSurface( | 237 VulkanOutputSurface( |
238 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, | 238 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider, |
239 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source) | 239 std::unique_ptr<ExternalBeginFrameSource> begin_frame_source) |
240 : OutputSurface(nullptr, | 240 : OutputSurface(std::move(vulkan_context_provider)), |
241 nullptr, | |
242 std::move(vulkan_context_provider), | |
243 nullptr), | |
244 begin_frame_source_(std::move(begin_frame_source)) {} | 241 begin_frame_source_(std::move(begin_frame_source)) {} |
245 | 242 |
246 ~VulkanOutputSurface() override { Destroy(); } | 243 ~VulkanOutputSurface() override { Destroy(); } |
247 | 244 |
248 bool Initialize(gfx::AcceleratedWidget widget) { | 245 bool Initialize(gfx::AcceleratedWidget widget) { |
249 DCHECK(!surface_); | 246 DCHECK(!surface_); |
250 std::unique_ptr<gpu::VulkanSurface> surface( | 247 std::unique_ptr<gpu::VulkanSurface> surface( |
251 gpu::VulkanSurface::CreateViewSurface(widget)); | 248 gpu::VulkanSurface::CreateViewSurface(widget)); |
252 if (!surface->Initialize(vulkan_context_provider()->GetDeviceQueue(), | 249 if (!surface->Initialize(vulkan_context_provider()->GetDeviceQueue(), |
253 gpu::VulkanSurface::DEFAULT_SURFACE_FORMAT)) { | 250 gpu::VulkanSurface::DEFAULT_SURFACE_FORMAT)) { |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 void CompositorImpl::SetNeedsAnimate() { | 799 void CompositorImpl::SetNeedsAnimate() { |
803 needs_animate_ = true; | 800 needs_animate_ = true; |
804 if (!host_->visible()) | 801 if (!host_->visible()) |
805 return; | 802 return; |
806 | 803 |
807 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); | 804 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); |
808 host_->SetNeedsAnimate(); | 805 host_->SetNeedsAnimate(); |
809 } | 806 } |
810 | 807 |
811 } // namespace content | 808 } // namespace content |
OLD | NEW |