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