#ifndef GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_
#define GPU_COMMAND_BUFFER_CLIENT_GL_IN_PROCESS_CONTEXT_H_
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "gles2_impl_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"
namespace gfx {
class Size;
}
#if defined(OS_ANDROID)
namespace gfx {
class SurfaceTexture;
}
#endif
namespace gpu {
namespace gles2 {
class GLES2Implementation;
}
struct GLES2_IMPL_EXPORT GLInProcessContextAttribs {
GLInProcessContextAttribs();
int32 alpha_size;
int32 blue_size;
int32 green_size;
int32 red_size;
int32 depth_size;
int32 stencil_size;
int32 samples;
int32 sample_buffers;
int32 fail_if_major_perf_caveat;
int32 lose_context_when_out_of_memory;
};
class GLES2_IMPL_EXPORT GLInProcessContext {
public:
virtual ~GLInProcessContext() {}
static GLInProcessContext* CreateContext(
bool is_offscreen,
gfx::AcceleratedWidget window,
const gfx::Size& size,
bool share_resources,
const GLInProcessContextAttribs& attribs,
gfx::GpuPreference gpu_preference);
static GLInProcessContext* CreateWithSurface(
scoped_refptr<gfx::GLSurface> surface,
scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
GLInProcessContext* share_context,
const GLInProcessContextAttribs& attribs,
gfx::GpuPreference gpu_preference);
virtual void SetContextLostCallback(const base::Closure& callback) = 0;
virtual gles2::GLES2Implementation* GetImplementation() = 0;
#if defined(OS_ANDROID)
virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture(
uint32 stream_id) = 0;
#endif
};
}
#endif