| 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_CLIENT_GL_IN_PROCESS_CONTEXT_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "gles2_impl_export.h" | 10 #include "gles2_impl_export.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 #include "ui/gl/gl_surface.h" | 12 #include "ui/gl/gl_surface.h" |
| 13 #include "ui/gl/gpu_preference.h" | 13 #include "ui/gl/gpu_preference.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Size; | 16 class Size; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace gpu { | 19 namespace gpu { |
| 20 | 20 |
| 21 namespace gles2 { | 21 namespace gles2 { |
| 22 class GLES2Implementation; | 22 class GLES2Implementation; |
| 23 } | 23 } |
| 24 | 24 |
| 25 class GpuMemoryBufferFactory; | |
| 26 | |
| 27 // The default uninitialized value is -1. | 25 // The default uninitialized value is -1. |
| 28 struct GLES2_IMPL_EXPORT GLInProcessContextAttribs { | 26 struct GLES2_IMPL_EXPORT GLInProcessContextAttribs { |
| 29 GLInProcessContextAttribs(); | 27 GLInProcessContextAttribs(); |
| 30 | 28 |
| 31 int32 alpha_size; | 29 int32 alpha_size; |
| 32 int32 blue_size; | 30 int32 blue_size; |
| 33 int32 green_size; | 31 int32 green_size; |
| 34 int32 red_size; | 32 int32 red_size; |
| 35 int32 depth_size; | 33 int32 depth_size; |
| 36 int32 stencil_size; | 34 int32 stencil_size; |
| 37 int32 samples; | 35 int32 samples; |
| 38 int32 sample_buffers; | 36 int32 sample_buffers; |
| 39 }; | 37 }; |
| 40 | 38 |
| 41 class GLES2_IMPL_EXPORT GLInProcessContext { | 39 class GLES2_IMPL_EXPORT GLInProcessContext { |
| 42 public: | 40 public: |
| 43 virtual ~GLInProcessContext() {} | 41 virtual ~GLInProcessContext() {} |
| 44 | 42 |
| 45 // Must be called before any GLInProcessContext instances are created. | |
| 46 static void SetGpuMemoryBufferFactory(GpuMemoryBufferFactory* factory); | |
| 47 | |
| 48 // Create a GLInProcessContext, if |is_offscreen| is true, renders to an | 43 // Create a GLInProcessContext, if |is_offscreen| is true, renders to an |
| 49 // offscreen context. |attrib_list| must be NULL or a NONE-terminated list | 44 // offscreen context. |attrib_list| must be NULL or a NONE-terminated list |
| 50 // of attribute/value pairs. | 45 // of attribute/value pairs. |
| 51 static GLInProcessContext* CreateContext( | 46 static GLInProcessContext* CreateContext( |
| 52 bool is_offscreen, | 47 bool is_offscreen, |
| 53 gfx::AcceleratedWidget window, | 48 gfx::AcceleratedWidget window, |
| 54 const gfx::Size& size, | 49 const gfx::Size& size, |
| 55 bool share_resources, | 50 bool share_resources, |
| 56 const char* allowed_extensions, | 51 const char* allowed_extensions, |
| 57 const GLInProcessContextAttribs& attribs, | 52 const GLInProcessContextAttribs& attribs, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 76 virtual void SignalQuery(unsigned query, const base::Closure& callback) = 0; | 71 virtual void SignalQuery(unsigned query, const base::Closure& callback) = 0; |
| 77 | 72 |
| 78 // Allows direct access to the GLES2 implementation so a GLInProcessContext | 73 // Allows direct access to the GLES2 implementation so a GLInProcessContext |
| 79 // can be used without making it current. | 74 // can be used without making it current. |
| 80 virtual gles2::GLES2Implementation* GetImplementation() = 0; | 75 virtual gles2::GLES2Implementation* GetImplementation() = 0; |
| 81 }; | 76 }; |
| 82 | 77 |
| 83 } // namespace gpu | 78 } // namespace gpu |
| 84 | 79 |
| 85 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ | 80 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ |
| OLD | NEW |