1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MOJO_GLES2_GLES2_CONTEXT_H_
6 #define MOJO_GLES2_GLES2_CONTEXT_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "gpu/command_buffer/client/gles2_implementation.h"
11 #include "mojo/gles2/command_buffer_client_impl.h"
12 #include "mojo/public/c/gles2/gles2.h"
14 struct MojoGLES2ContextPrivate {};
20 class GLES2Implementation;
27 class GLES2Context : public CommandBufferDelegate,
28 public MojoGLES2ContextPrivate {
30 explicit GLES2Context(const MojoAsyncWaiter* async_waiter,
31 ScopedMessagePipeHandle command_buffer_handle,
32 MojoGLES2ContextLost lost_callback,
34 virtual ~GLES2Context();
37 gpu::gles2::GLES2Interface* interface() const {
38 return implementation_.get();
40 gpu::ContextSupport* context_support() const { return implementation_.get(); }
43 virtual void ContextLost() OVERRIDE;
45 CommandBufferClientImpl command_buffer_;
46 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_;
47 scoped_ptr<gpu::TransferBuffer> transfer_buffer_;
48 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_;
49 MojoGLES2ContextLost lost_callback_;
52 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2Context);
58 #endif // MOJO_GLES2_GLES2_CONTEXT_H_