| 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 #ifndef SERVICES_UI_COMMON_GPU_SERVICE_H_ | 5 #ifndef SERVICES_UI_COMMON_GPU_SERVICE_H_ |
| 6 #define SERVICES_UI_COMMON_GPU_SERVICE_H_ | 6 #define SERVICES_UI_COMMON_GPU_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 class MUS_COMMON_EXPORT GpuService : public gpu::GpuChannelHostFactory { | 28 class MUS_COMMON_EXPORT GpuService : public gpu::GpuChannelHostFactory { |
| 29 public: | 29 public: |
| 30 void EstablishGpuChannel(const base::Closure& callback); | 30 void EstablishGpuChannel(const base::Closure& callback); |
| 31 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync(); | 31 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync(); |
| 32 scoped_refptr<gpu::GpuChannelHost> GetGpuChannel(); | 32 scoped_refptr<gpu::GpuChannelHost> GetGpuChannel(); |
| 33 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { | 33 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { |
| 34 return gpu_memory_buffer_manager_.get(); | 34 return gpu_memory_buffer_manager_.get(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 static bool UseChromeGpuCommandBuffer(); | |
| 38 | |
| 39 // The GpuService has to be initialized in the main thread before establishing | 37 // The GpuService has to be initialized in the main thread before establishing |
| 40 // the gpu channel. | 38 // the gpu channel. |
| 41 static void Initialize(shell::Connector* connector); | 39 static void Initialize(shell::Connector* connector); |
| 42 // The GpuService has to be terminated in the main thread. | 40 // The GpuService has to be terminated in the main thread. |
| 43 static void Terminate(); | 41 static void Terminate(); |
| 44 static GpuService* GetInstance(); | 42 static GpuService* GetInstance(); |
| 45 | 43 |
| 46 private: | 44 private: |
| 47 friend struct base::DefaultSingletonTraits<GpuService>; | 45 friend struct base::DefaultSingletonTraits<GpuService>; |
| 48 | 46 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 77 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; | 75 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; |
| 78 std::vector<base::Closure> establish_callbacks_; | 76 std::vector<base::Closure> establish_callbacks_; |
| 79 base::ConditionVariable establishing_condition_; | 77 base::ConditionVariable establishing_condition_; |
| 80 | 78 |
| 81 DISALLOW_COPY_AND_ASSIGN(GpuService); | 79 DISALLOW_COPY_AND_ASSIGN(GpuService); |
| 82 }; | 80 }; |
| 83 | 81 |
| 84 } // namespace ui | 82 } // namespace ui |
| 85 | 83 |
| 86 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_GPU_SERVICE_CONNECTION_H_ | 84 #endif // COMPONENTS_MUS_PUBLIC_CPP_LIB_GPU_SERVICE_CONNECTION_H_ |
| OLD | NEW |