summaryrefslogtreecommitdiffstats
path: root/chromium/gpu/command_buffer/client/gl_in_process_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/gpu/command_buffer/client/gl_in_process_context.h')
-rw-r--r--chromium/gpu/command_buffer/client/gl_in_process_context.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/chromium/gpu/command_buffer/client/gl_in_process_context.h b/chromium/gpu/command_buffer/client/gl_in_process_context.h
index 6d96f131554..c1478b11135 100644
--- a/chromium/gpu/command_buffer/client/gl_in_process_context.h
+++ b/chromium/gpu/command_buffer/client/gl_in_process_context.h
@@ -7,7 +7,8 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
-#include "gles2_impl_export.h"
+#include "gl_in_process_context_export.h"
+#include "gpu/command_buffer/service/in_process_command_buffer.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gpu_preference.h"
@@ -29,7 +30,7 @@ class GLES2Implementation;
}
// The default uninitialized value is -1.
-struct GLES2_IMPL_EXPORT GLInProcessContextAttribs {
+struct GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContextAttribs {
GLInProcessContextAttribs();
int32 alpha_size;
@@ -41,15 +42,17 @@ struct GLES2_IMPL_EXPORT GLInProcessContextAttribs {
int32 samples;
int32 sample_buffers;
int32 fail_if_major_perf_caveat;
+ int32 lose_context_when_out_of_memory;
};
-class GLES2_IMPL_EXPORT GLInProcessContext {
+class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
public:
virtual ~GLInProcessContext() {}
// Create a GLInProcessContext, if |is_offscreen| is true, renders to an
// offscreen context. |attrib_list| must be NULL or a NONE-terminated list
// of attribute/value pairs.
+ // TODO(boliu): Fix all callsites to use Create and remove this.
static GLInProcessContext* CreateContext(
bool is_offscreen,
gfx::AcceleratedWidget window,
@@ -58,13 +61,21 @@ class GLES2_IMPL_EXPORT GLInProcessContext {
const GLInProcessContextAttribs& attribs,
gfx::GpuPreference gpu_preference);
- // Create context with the provided GLSurface. All other arguments match
- // CreateContext factory above. Can only be called if the command buffer
- // service runs on the same thread as this client because GLSurface is not
- // thread safe.
- static GLInProcessContext* CreateWithSurface(
+ // If |surface| is not NULL, then it must match |is_offscreen| and |size|,
+ // |window| must be gfx::kNullAcceleratedWidget, and the command buffer
+ // service must run on the same thread as this client because GLSurface is
+ // not thread safe. If |surface| is NULL, then the other parameters are used
+ // to correctly create a surface.
+ // Only one of |share_context| and |use_global_share_group| can be used at
+ // the same time.
+ static GLInProcessContext* Create(
+ scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
scoped_refptr<gfx::GLSurface> surface,
- bool share_resources,
+ bool is_offscreen,
+ gfx::AcceleratedWidget window,
+ const gfx::Size& size,
+ GLInProcessContext* share_context,
+ bool use_global_share_group,
const GLInProcessContextAttribs& attribs,
gfx::GpuPreference gpu_preference);