| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class TransferBuffer; | 23 class TransferBuffer; |
| 24 class GpuScheduler; | 24 class GpuScheduler; |
| 25 | 25 |
| 26 namespace gles2 { | 26 namespace gles2 { |
| 27 | 27 |
| 28 class ContextGroup; | 28 class ContextGroup; |
| 29 class MailboxManager; | 29 class MailboxManager; |
| 30 class GLES2Decoder; | 30 class GLES2Decoder; |
| 31 class GLES2CmdHelper; | 31 class GLES2CmdHelper; |
| 32 class GLES2Implementation; | 32 class GLES2Implementation; |
| 33 class ImageManager; |
| 33 class ShareGroup; | 34 class ShareGroup; |
| 34 | 35 |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 class GLManager { | 38 class GLManager { |
| 38 public: | 39 public: |
| 39 struct Options { | 40 struct Options { |
| 40 Options(); | 41 Options(); |
| 41 // The size of the backbuffer. | 42 // The size of the backbuffer. |
| 42 gfx::Size size; | 43 gfx::Size size; |
| 43 // If not null will share resources with this context. | 44 // If not null will share resources with this context. |
| 44 GLManager* share_group_manager; | 45 GLManager* share_group_manager; |
| 45 // If not null will share a mailbox manager with this context. | 46 // If not null will share a mailbox manager with this context. |
| 46 GLManager* share_mailbox_manager; | 47 GLManager* share_mailbox_manager; |
| 47 // If not null will create a virtual manager based on this context. | 48 // If not null will create a virtual manager based on this context. |
| 48 GLManager* virtual_manager; | 49 GLManager* virtual_manager; |
| 49 // Whether or not glBindXXX generates a resource. | 50 // Whether or not glBindXXX generates a resource. |
| 50 bool bind_generates_resource; | 51 bool bind_generates_resource; |
| 51 // Whether or not it's ok to lose the context. | 52 // Whether or not it's ok to lose the context. |
| 52 bool context_lost_allowed; | 53 bool context_lost_allowed; |
| 54 // Image manager to be used. |
| 55 gles2::ImageManager* image_manager; |
| 53 }; | 56 }; |
| 54 GLManager(); | 57 GLManager(); |
| 55 ~GLManager(); | 58 ~GLManager(); |
| 56 | 59 |
| 57 void Initialize(const Options& options); | 60 void Initialize(const Options& options); |
| 58 void Destroy(); | 61 void Destroy(); |
| 59 | 62 |
| 60 void MakeCurrent(); | 63 void MakeCurrent(); |
| 61 | 64 |
| 62 gles2::MailboxManager* mailbox_manager() const { | 65 gles2::MailboxManager* mailbox_manager() const { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // Used on Android to virtualize GL for all contexts. | 98 // Used on Android to virtualize GL for all contexts. |
| 96 static int use_count_; | 99 static int use_count_; |
| 97 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; | 100 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; |
| 98 static scoped_refptr<gfx::GLSurface>* base_surface_; | 101 static scoped_refptr<gfx::GLSurface>* base_surface_; |
| 99 static scoped_refptr<gfx::GLContext>* base_context_; | 102 static scoped_refptr<gfx::GLContext>* base_context_; |
| 100 }; | 103 }; |
| 101 | 104 |
| 102 } // namespace gpu | 105 } // namespace gpu |
| 103 | 106 |
| 104 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 107 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| OLD | NEW |