| 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 #ifndef GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/containers/scoped_ptr_hash_map.h" | 13 #include "base/containers/scoped_ptr_hash_map.h" |
| 12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "gpu/command_buffer/client/gpu_control.h" | 15 #include "gpu/command_buffer/client/gpu_control.h" |
| 15 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 16 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 16 #include "gpu/command_buffer/service/feature_info.h" | 17 #include "gpu/command_buffer/service/feature_info.h" |
| 17 #include "gpu/command_buffer/service/gpu_preferences.h" | 18 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 18 #include "ui/gfx/geometry/size.h" | 19 #include "ui/gfx/geometry/size.h" |
| 19 #include "ui/gfx/gpu_memory_buffer.h" | 20 #include "ui/gfx/gpu_memory_buffer.h" |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 class CommandLine; | 23 class CommandLine; |
| 23 } | 24 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 bool lose_context_when_out_of_memory; | 72 bool lose_context_when_out_of_memory; |
| 72 // Whether or not it's ok to lose the context. | 73 // Whether or not it's ok to lose the context. |
| 73 bool context_lost_allowed; | 74 bool context_lost_allowed; |
| 74 gles2::ContextType context_type; | 75 gles2::ContextType context_type; |
| 75 // Force shader name hashing for all context types. | 76 // Force shader name hashing for all context types. |
| 76 bool force_shader_name_hashing; | 77 bool force_shader_name_hashing; |
| 77 }; | 78 }; |
| 78 GLManager(); | 79 GLManager(); |
| 79 ~GLManager() override; | 80 ~GLManager() override; |
| 80 | 81 |
| 81 scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( | 82 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( |
| 82 const gfx::Size& size, | 83 const gfx::Size& size, |
| 83 gfx::BufferFormat format); | 84 gfx::BufferFormat format); |
| 84 | 85 |
| 85 void Initialize(const Options& options); | 86 void Initialize(const Options& options); |
| 86 void InitializeWithCommandLine(const Options& options, | 87 void InitializeWithCommandLine(const Options& options, |
| 87 const base::CommandLine& command_line); | 88 const base::CommandLine& command_line); |
| 88 void Destroy(); | 89 void Destroy(); |
| 89 | 90 |
| 90 bool IsInitialized() const { return gles2_implementation() != nullptr; } | 91 bool IsInitialized() const { return gles2_implementation() != nullptr; } |
| 91 | 92 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void OnFenceSyncRelease(uint64_t release); | 156 void OnFenceSyncRelease(uint64_t release); |
| 156 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, | 157 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, |
| 157 gpu::CommandBufferId command_buffer_id, | 158 gpu::CommandBufferId command_buffer_id, |
| 158 uint64_t release); | 159 uint64_t release); |
| 159 | 160 |
| 160 gpu::GpuPreferences gpu_preferences_; | 161 gpu::GpuPreferences gpu_preferences_; |
| 161 | 162 |
| 162 SyncPointManager* sync_point_manager_; // Non-owning. | 163 SyncPointManager* sync_point_manager_; // Non-owning. |
| 163 | 164 |
| 164 scoped_refptr<SyncPointOrderData> sync_point_order_data_; | 165 scoped_refptr<SyncPointOrderData> sync_point_order_data_; |
| 165 scoped_ptr<SyncPointClient> sync_point_client_; | 166 std::unique_ptr<SyncPointClient> sync_point_client_; |
| 166 scoped_refptr<gles2::MailboxManager> mailbox_manager_; | 167 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
| 167 scoped_refptr<gfx::GLShareGroup> share_group_; | 168 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 168 scoped_ptr<CommandBufferService> command_buffer_; | 169 std::unique_ptr<CommandBufferService> command_buffer_; |
| 169 scoped_ptr<gles2::GLES2Decoder> decoder_; | 170 std::unique_ptr<gles2::GLES2Decoder> decoder_; |
| 170 scoped_ptr<CommandExecutor> executor_; | 171 std::unique_ptr<CommandExecutor> executor_; |
| 171 scoped_refptr<gfx::GLSurface> surface_; | 172 scoped_refptr<gfx::GLSurface> surface_; |
| 172 scoped_refptr<gfx::GLContext> context_; | 173 scoped_refptr<gfx::GLContext> context_; |
| 173 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 174 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
| 174 scoped_ptr<TransferBuffer> transfer_buffer_; | 175 std::unique_ptr<TransferBuffer> transfer_buffer_; |
| 175 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; | 176 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; |
| 176 bool context_lost_allowed_; | 177 bool context_lost_allowed_; |
| 177 bool pause_commands_; | 178 bool pause_commands_; |
| 178 uint32_t paused_order_num_; | 179 uint32_t paused_order_num_; |
| 179 | 180 |
| 180 const CommandBufferId command_buffer_id_; | 181 const CommandBufferId command_buffer_id_; |
| 181 uint64_t next_fence_sync_release_; | 182 uint64_t next_fence_sync_release_; |
| 182 | 183 |
| 183 bool use_iosurface_memory_buffers_ = false; | 184 bool use_iosurface_memory_buffers_ = false; |
| 184 | 185 |
| 185 // Used on Android to virtualize GL for all contexts. | 186 // Used on Android to virtualize GL for all contexts. |
| 186 static int use_count_; | 187 static int use_count_; |
| 187 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; | 188 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; |
| 188 static scoped_refptr<gfx::GLSurface>* base_surface_; | 189 static scoped_refptr<gfx::GLSurface>* base_surface_; |
| 189 static scoped_refptr<gfx::GLContext>* base_context_; | 190 static scoped_refptr<gfx::GLContext>* base_context_; |
| 190 }; | 191 }; |
| 191 | 192 |
| 192 } // namespace gpu | 193 } // namespace gpu |
| 193 | 194 |
| 194 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 195 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| OLD | NEW |