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 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 bool lose_context_when_out_of_memory; | 71 bool lose_context_when_out_of_memory; |
72 // Whether or not it's ok to lose the context. | 72 // Whether or not it's ok to lose the context. |
73 bool context_lost_allowed; | 73 bool context_lost_allowed; |
74 gles2::ContextType context_type; | 74 gles2::ContextType context_type; |
75 // Force shader name hashing for all context types. | 75 // Force shader name hashing for all context types. |
76 bool force_shader_name_hashing; | 76 bool force_shader_name_hashing; |
77 }; | 77 }; |
78 GLManager(); | 78 GLManager(); |
79 ~GLManager() override; | 79 ~GLManager() override; |
80 | 80 |
81 static scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( | 81 scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( |
82 const gfx::Size& size, | 82 const gfx::Size& size, |
83 gfx::BufferFormat format); | 83 gfx::BufferFormat format); |
84 | 84 |
85 void Initialize(const Options& options); | 85 void Initialize(const Options& options); |
86 void InitializeWithCommandLine(const Options& options, | 86 void InitializeWithCommandLine(const Options& options, |
87 base::CommandLine* command_line); | 87 base::CommandLine* command_line); |
88 void Destroy(); | 88 void Destroy(); |
89 | 89 |
90 bool IsInitialized() const { return gles2_implementation() != nullptr; } | 90 bool IsInitialized() const { return gles2_implementation() != nullptr; } |
91 | 91 |
92 void MakeCurrent(); | 92 void MakeCurrent(); |
93 | 93 |
94 void SetSurface(gfx::GLSurface* surface); | 94 void SetSurface(gfx::GLSurface* surface); |
95 | 95 |
| 96 void set_use_iosurface_memory_buffers(bool use_iosurface_memory_buffers) { |
| 97 use_iosurface_memory_buffers_ = use_iosurface_memory_buffers; |
| 98 } |
| 99 |
96 void SetCommandsPaused(bool paused) { pause_commands_ = paused; } | 100 void SetCommandsPaused(bool paused) { pause_commands_ = paused; } |
97 | 101 |
98 gles2::GLES2Decoder* decoder() const { | 102 gles2::GLES2Decoder* decoder() const { |
99 return decoder_.get(); | 103 return decoder_.get(); |
100 } | 104 } |
101 | 105 |
102 gles2::MailboxManager* mailbox_manager() const { | 106 gles2::MailboxManager* mailbox_manager() const { |
103 return mailbox_manager_.get(); | 107 return mailbox_manager_.get(); |
104 } | 108 } |
105 | 109 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 172 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
169 scoped_ptr<TransferBuffer> transfer_buffer_; | 173 scoped_ptr<TransferBuffer> transfer_buffer_; |
170 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; | 174 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; |
171 bool context_lost_allowed_; | 175 bool context_lost_allowed_; |
172 bool pause_commands_; | 176 bool pause_commands_; |
173 uint32_t paused_order_num_; | 177 uint32_t paused_order_num_; |
174 | 178 |
175 const CommandBufferId command_buffer_id_; | 179 const CommandBufferId command_buffer_id_; |
176 uint64_t next_fence_sync_release_; | 180 uint64_t next_fence_sync_release_; |
177 | 181 |
| 182 bool use_iosurface_memory_buffers_ = false; |
| 183 |
178 // Used on Android to virtualize GL for all contexts. | 184 // Used on Android to virtualize GL for all contexts. |
179 static int use_count_; | 185 static int use_count_; |
180 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; | 186 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; |
181 static scoped_refptr<gfx::GLSurface>* base_surface_; | 187 static scoped_refptr<gfx::GLSurface>* base_surface_; |
182 static scoped_refptr<gfx::GLContext>* base_context_; | 188 static scoped_refptr<gfx::GLContext>* base_context_; |
183 }; | 189 }; |
184 | 190 |
185 } // namespace gpu | 191 } // namespace gpu |
186 | 192 |
187 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 193 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
OLD | NEW |