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 SetUseIOSurfaceMemoryBuffers(bool use_iosurface_memory_buffers); | |
Zhenyao Mo
2016/03/15 17:40:47
Nit: setter function should be named set_use_iosur
erikchen
2016/03/15 18:08:38
Done.
Note that technically, Chrome style require
| |
97 | |
96 void SetCommandsPaused(bool paused) { pause_commands_ = paused; } | 98 void SetCommandsPaused(bool paused) { pause_commands_ = paused; } |
97 | 99 |
98 gles2::GLES2Decoder* decoder() const { | 100 gles2::GLES2Decoder* decoder() const { |
99 return decoder_.get(); | 101 return decoder_.get(); |
100 } | 102 } |
101 | 103 |
102 gles2::MailboxManager* mailbox_manager() const { | 104 gles2::MailboxManager* mailbox_manager() const { |
103 return mailbox_manager_.get(); | 105 return mailbox_manager_.get(); |
104 } | 106 } |
105 | 107 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 170 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
169 scoped_ptr<TransferBuffer> transfer_buffer_; | 171 scoped_ptr<TransferBuffer> transfer_buffer_; |
170 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; | 172 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; |
171 bool context_lost_allowed_; | 173 bool context_lost_allowed_; |
172 bool pause_commands_; | 174 bool pause_commands_; |
173 uint32_t paused_order_num_; | 175 uint32_t paused_order_num_; |
174 | 176 |
175 const CommandBufferId command_buffer_id_; | 177 const CommandBufferId command_buffer_id_; |
176 uint64_t next_fence_sync_release_; | 178 uint64_t next_fence_sync_release_; |
177 | 179 |
180 bool use_iosurface_memory_buffers_ = false; | |
Zhenyao Mo
2016/03/15 17:40:48
Is this even legal? Shouldn't it be initialized in
erikchen
2016/03/15 18:08:38
This is a C++ 11 feature called in-class member in
| |
181 | |
178 // Used on Android to virtualize GL for all contexts. | 182 // Used on Android to virtualize GL for all contexts. |
179 static int use_count_; | 183 static int use_count_; |
180 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; | 184 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; |
181 static scoped_refptr<gfx::GLSurface>* base_surface_; | 185 static scoped_refptr<gfx::GLSurface>* base_surface_; |
182 static scoped_refptr<gfx::GLContext>* base_context_; | 186 static scoped_refptr<gfx::GLContext>* base_context_; |
183 }; | 187 }; |
184 | 188 |
185 } // namespace gpu | 189 } // namespace gpu |
186 | 190 |
187 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 191 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
OLD | NEW |