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 "gl_in_process_context_export.h" | 10 #include "gl_in_process_context_export.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const gfx::Size& size, | 58 const gfx::Size& size, |
59 bool share_resources, | 59 bool share_resources, |
60 const GLInProcessContextAttribs& attribs, | 60 const GLInProcessContextAttribs& attribs, |
61 gfx::GpuPreference gpu_preference); | 61 gfx::GpuPreference gpu_preference); |
62 | 62 |
63 // Create context with the provided GLSurface. All other arguments match | 63 // Create context with the provided GLSurface. All other arguments match |
64 // CreateContext factory above. Can only be called if the command buffer | 64 // CreateContext factory above. Can only be called if the command buffer |
65 // service runs on the same thread as this client because GLSurface is not | 65 // service runs on the same thread as this client because GLSurface is not |
66 // thread safe. | 66 // thread safe. |
67 static GLInProcessContext* CreateWithSurface( | 67 static GLInProcessContext* CreateWithSurface( |
68 scoped_refptr<gfx::GLSurface> surface, | 68 gfx::GLSurface* surface, |
69 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, | 69 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, |
70 GLInProcessContext* share_context, | 70 GLInProcessContext* share_context, |
71 const GLInProcessContextAttribs& attribs, | 71 const GLInProcessContextAttribs& attribs, |
72 gfx::GpuPreference gpu_preference); | 72 gfx::GpuPreference gpu_preference); |
73 | 73 |
74 virtual void SetContextLostCallback(const base::Closure& callback) = 0; | 74 virtual void SetContextLostCallback(const base::Closure& callback) = 0; |
75 | 75 |
76 // Allows direct access to the GLES2 implementation so a GLInProcessContext | 76 // Allows direct access to the GLES2 implementation so a GLInProcessContext |
77 // can be used without making it current. | 77 // can be used without making it current. |
78 virtual gles2::GLES2Implementation* GetImplementation() = 0; | 78 virtual gles2::GLES2Implementation* GetImplementation() = 0; |
79 | 79 |
80 #if defined(OS_ANDROID) | 80 #if defined(OS_ANDROID) |
81 virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( | 81 virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( |
82 uint32 stream_id) = 0; | 82 uint32 stream_id) = 0; |
83 #endif | 83 #endif |
84 }; | 84 }; |
85 | 85 |
86 } // namespace gpu | 86 } // namespace gpu |
87 | 87 |
88 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ | 88 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ |
OLD | NEW |