| 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/gpu_preference.h" | 12 #include "ui/gl/gpu_preference.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Size; | 15 class Size; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace gpu { | 18 namespace gpu { |
| 19 | 19 |
| 20 namespace gles2 { | 20 namespace gles2 { |
| 21 class GLES2Implementation; | 21 class GLES2Implementation; |
| 22 } | 22 } |
| 23 | 23 |
| 24 class GpuMemoryBuffer; | 24 class GpuMemoryBufferFactory; |
| 25 | 25 |
| 26 class GLES2_IMPL_EXPORT GLInProcessContext { | 26 class GLES2_IMPL_EXPORT GLInProcessContext { |
| 27 public: | 27 public: |
| 28 virtual ~GLInProcessContext() {} | 28 virtual ~GLInProcessContext() {} |
| 29 | 29 |
| 30 typedef scoped_ptr< ::gpu::GpuMemoryBuffer> GpuMemoryBufferCreator( | 30 // Must be called before any GLInProcessContext instances are created. |
| 31 int width, int height); | 31 static void SetGpuMemoryBufferFactory(GpuMemoryBufferFactory* factory); |
| 32 static void SetGpuMemoryBufferCreator(GpuMemoryBufferCreator* creator); | |
| 33 | 32 |
| 34 // Must be called before any GLInProcessContext instances are created. | 33 // Must be called before any GLInProcessContext instances are created. |
| 35 // Default value is false. | 34 // Default value is false. |
| 36 static void EnableVirtualizedContext(); | 35 static void EnableVirtualizedContext(); |
| 37 | 36 |
| 38 // GLInProcessContext configuration attributes. These are the same as used by | 37 // GLInProcessContext configuration attributes. These are the same as used by |
| 39 // EGL. Attributes are matched using a closest fit algorithm. | 38 // EGL. Attributes are matched using a closest fit algorithm. |
| 40 enum Attribute { | 39 enum Attribute { |
| 41 ALPHA_SIZE = 0x3021, | 40 ALPHA_SIZE = 0x3021, |
| 42 BLUE_SIZE = 0x3022, | 41 BLUE_SIZE = 0x3022, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 68 virtual void SignalQuery(unsigned query, const base::Closure& callback) = 0; | 67 virtual void SignalQuery(unsigned query, const base::Closure& callback) = 0; |
| 69 | 68 |
| 70 // Allows direct access to the GLES2 implementation so a GLInProcessContext | 69 // Allows direct access to the GLES2 implementation so a GLInProcessContext |
| 71 // can be used without making it current. | 70 // can be used without making it current. |
| 72 virtual gles2::GLES2Implementation* GetImplementation() = 0; | 71 virtual gles2::GLES2Implementation* GetImplementation() = 0; |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 } // namespace gpu | 74 } // namespace gpu |
| 76 | 75 |
| 77 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ | 76 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ |
| OLD | NEW |