Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: gpu/command_buffer/client/gl_in_process_context.h

Issue 22277004: Add gfx::SurfaceFactoryWebview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add thread check Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/gpu_preference.h" 13 #include "ui/gl/gpu_preference.h"
13 14
14 namespace gfx { 15 namespace gfx {
15 class Size; 16 class Size;
16 } 17 }
17 18
18 namespace gpu { 19 namespace gpu {
19 20
20 namespace gles2 { 21 namespace gles2 {
21 class GLES2Implementation; 22 class GLES2Implementation;
(...skipping 25 matching lines...) Expand all
47 // Create a GLInProcessContext, if |is_offscreen| is true, renders to an 48 // Create a GLInProcessContext, if |is_offscreen| is true, renders to an
48 // offscreen context. |attrib_list| must be NULL or a NONE-terminated list 49 // offscreen context. |attrib_list| must be NULL or a NONE-terminated list
49 // of attribute/value pairs. 50 // of attribute/value pairs.
50 static GLInProcessContext* CreateContext( 51 static GLInProcessContext* CreateContext(
51 bool is_offscreen, 52 bool is_offscreen,
52 gfx::AcceleratedWidget window, 53 gfx::AcceleratedWidget window,
53 const gfx::Size& size, 54 const gfx::Size& size,
54 bool share_resources, 55 bool share_resources,
55 const char* allowed_extensions, 56 const char* allowed_extensions,
56 const int32* attrib_list, 57 const int32* attrib_list,
57 gfx::GpuPreference gpu_preference, 58 gfx::GpuPreference gpu_preference);
58 const base::Closure& callback); 59
60 // Create context with the provided GLSurface. All other arguments match
61 // CreateContext factory above. Can only be called if the command buffer
62 // service runs on the same thread as this client because GLSurface is not
63 // thread safe.
64 static GLInProcessContext* CreateWithSurface(
65 scoped_refptr<gfx::GLSurface> surface,
66 bool is_offscreen,
67 const gfx::Size& size,
68 bool share_resources,
69 const char* allowed_extensions,
70 const int32* attrib_list,
71 gfx::GpuPreference gpu_preference);
72
73 virtual void SetContextLostCallback(const base::Closure& callback) = 0;
59 74
60 virtual void SignalSyncPoint(unsigned sync_point, 75 virtual void SignalSyncPoint(unsigned sync_point,
61 const base::Closure& callback) = 0; 76 const base::Closure& callback) = 0;
62 77
63 virtual void SignalQuery(unsigned query, const base::Closure& callback) = 0; 78 virtual void SignalQuery(unsigned query, const base::Closure& callback) = 0;
64 79
65 // Allows direct access to the GLES2 implementation so a GLInProcessContext 80 // Allows direct access to the GLES2 implementation so a GLInProcessContext
66 // can be used without making it current. 81 // can be used without making it current.
67 virtual gles2::GLES2Implementation* GetImplementation() = 0; 82 virtual gles2::GLES2Implementation* GetImplementation() = 0;
68 }; 83 };
69 84
70 } // namespace gpu 85 } // namespace gpu
71 86
72 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_ 87 #endif // GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698