| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 | 13 |
| 14 class GLContext; | 14 class GLContext; |
| 15 class GLShareGroup; | 15 class GLShareGroup; |
| 16 class GLSurface; | 16 class GLSurface; |
| 17 | 17 |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace gpu { | 20 namespace gpu { |
| 21 | 21 |
| 22 class CommandBufferService; | 22 class CommandBufferService; |
| 23 class TransferBuffer; | 23 class TransferBuffer; |
| 24 class GpuScheduler; | 24 class GpuScheduler; |
| 25 | 25 |
| 26 namespace gles2 { | 26 namespace gles2 { |
| 27 | 27 |
| 28 class MailboxManager; |
| 28 class GLES2Decoder; | 29 class GLES2Decoder; |
| 29 class GLES2CmdHelper; | 30 class GLES2CmdHelper; |
| 30 class GLES2Implementation; | 31 class GLES2Implementation; |
| 31 | 32 |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 class GLManager { | 35 class GLManager { |
| 35 public: | 36 public: |
| 36 GLManager(); | 37 GLManager(gles2::MailboxManager* mailbox_manager, |
| 38 gfx::GLShareGroup* share_group); |
| 37 ~GLManager(); | 39 ~GLManager(); |
| 38 | 40 |
| 39 void Initialize(const gfx::Size& size); | 41 void Initialize(const gfx::Size& size); |
| 40 void Destroy(); | 42 void Destroy(); |
| 41 | 43 |
| 42 void MakeCurrent(); | 44 void MakeCurrent(); |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 void PumpCommands(); | 47 void PumpCommands(); |
| 46 bool GetBufferChanged(int32 transfer_buffer_id); | 48 bool GetBufferChanged(int32 transfer_buffer_id); |
| 47 | 49 |
| 50 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
| 48 scoped_refptr<gfx::GLShareGroup> share_group_; | 51 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 49 scoped_ptr<CommandBufferService> command_buffer_; | 52 scoped_ptr<CommandBufferService> command_buffer_; |
| 50 scoped_ptr<gles2::GLES2Decoder> decoder_; | 53 scoped_ptr<gles2::GLES2Decoder> decoder_; |
| 51 scoped_ptr<GpuScheduler> gpu_scheduler_; | 54 scoped_ptr<GpuScheduler> gpu_scheduler_; |
| 52 scoped_refptr<gfx::GLSurface> surface_; | 55 scoped_refptr<gfx::GLSurface> surface_; |
| 53 scoped_refptr<gfx::GLContext> context_; | 56 scoped_refptr<gfx::GLContext> context_; |
| 54 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 57 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
| 55 scoped_ptr<TransferBuffer> transfer_buffer_; | 58 scoped_ptr<TransferBuffer> transfer_buffer_; |
| 56 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; | 59 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace gpu | 62 } // namespace gpu |
| 60 | 63 |
| 61 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 64 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| OLD | NEW |