Connect PPAPI IPC channels for non-SFI mode.
[chromium-blink-merge.git] / mojo / gles2 / gles2_context.h
blobcfbfcd694f4c08fb0a7efd4fee0d4bb4d787d8a9
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/memory/scoped_ptr.h"
9 #include "gpu/command_buffer/client/gles2_implementation.h"
10 #include "mojo/gles2/command_buffer_client_impl.h"
11 #include "mojo/public/bindings/remote_ptr.h"
12 #include "mojo/public/gles2/gles2.h"
14 struct MojoGLES2ContextPrivate {};
16 namespace gpu {
17 class TransferBuffer;
18 namespace gles2 {
19 class GLES2CmdHelper;
20 class GLES2Implementation;
24 namespace mojo {
25 namespace gles2 {
27 class GLES2Context : public CommandBufferDelegate,
28 public MojoGLES2ContextPrivate {
29 public:
30 explicit GLES2Context(MojoAsyncWaiter* async_waiter,
31 ScopedCommandBufferHandle command_buffer_handle,
32 MojoGLES2ContextLost lost_callback,
33 MojoGLES2DrawAnimationFrame animation_callback,
34 void* closure);
35 virtual ~GLES2Context();
36 bool Initialize();
38 gpu::gles2::GLES2Interface* interface() const {
39 return implementation_.get();
41 gpu::ContextSupport* context_support() const { return implementation_.get(); }
42 void RequestAnimationFrames();
43 void CancelAnimationFrames();
45 private:
46 virtual void ContextLost() MOJO_OVERRIDE;
47 virtual void DrawAnimationFrame() MOJO_OVERRIDE;
49 CommandBufferClientImpl command_buffer_;
50 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_;
51 scoped_ptr<gpu::TransferBuffer> transfer_buffer_;
52 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_;
53 MojoGLES2ContextLost lost_callback_;
54 MojoGLES2DrawAnimationFrame animation_callback_;
55 void* closure_;
57 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2Context);
60 } // namespace gles2
61 } // namespace mojo
63 #endif // MOJO_GLES2_GLES2_CONTEXT_H_