| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/support/compositor/compositor_dependencies_impl.h" | 5 #include "blimp/client/support/compositor/compositor_dependencies_impl.h" |
| 6 | 6 |
| 7 #include "blimp/client/support/compositor/blimp_context_provider.h" | 7 #include "blimp/client/support/compositor/blimp_context_provider.h" |
| 8 #include "blimp/client/support/compositor/blimp_gpu_memory_buffer_manager.h" | 8 #include "blimp/client/support/compositor/blimp_gpu_memory_buffer_manager.h" |
| 9 #include "blimp/client/support/compositor/blimp_layer_tree_settings.h" | 9 #include "blimp/client/support/compositor/blimp_layer_tree_settings.h" |
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 gpu::GpuMemoryBufferManager* | 85 gpu::GpuMemoryBufferManager* |
| 86 CompositorDependenciesImpl::GetGpuMemoryBufferManager() { | 86 CompositorDependenciesImpl::GetGpuMemoryBufferManager() { |
| 87 return gpu_memory_buffer_manager_.get(); | 87 return gpu_memory_buffer_manager_.get(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 cc::SurfaceManager* CompositorDependenciesImpl::GetSurfaceManager() { | 90 cc::SurfaceManager* CompositorDependenciesImpl::GetSurfaceManager() { |
| 91 return surface_manager_.get(); | 91 return surface_manager_.get(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 uint32_t CompositorDependenciesImpl::AllocateSurfaceId() { | 94 uint32_t CompositorDependenciesImpl::AllocateSurfaceClientId() { |
| 95 return ++next_surface_id_; | 95 return ++next_surface_id_; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void CompositorDependenciesImpl::GetContextProvider( | 98 void CompositorDependenciesImpl::GetContextProviders( |
| 99 const CompositorDependencies::ContextProviderCallback& callback) { | 99 const CompositorDependencies::ContextProviderCallback& callback) { |
| 100 scoped_refptr<cc::ContextProvider> provider = BlimpContextProvider::Create( | 100 scoped_refptr<cc::ContextProvider> compositor_context = |
| 101 gfx::kNullAcceleratedWidget, gpu_memory_buffer_manager_.get()); | 101 BlimpContextProvider::Create(gfx::kNullAcceleratedWidget, |
| 102 callback.Run(provider); | 102 gpu_memory_buffer_manager_.get()); |
| 103 |
| 104 // TODO(khushalsagar): Make a worker context and bind to the current thread. |
| 105 ContextProviders context_providers; |
| 106 context_providers.compositor_context_provider = std::move(compositor_context); |
| 107 callback.Run(context_providers); |
| 103 } | 108 } |
| 104 | 109 |
| 105 } // namespace client | 110 } // namespace client |
| 106 } // namespace blimp | 111 } // namespace blimp |
| OLD | NEW |