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_CLIENT_IMPL_H_
6 #define MOJO_GLES2_GLES2_CLIENT_IMPL_H_
8 #include "gpu/command_buffer/client/gles2_implementation.h"
9 #include "mojo/public/bindings/lib/remote_ptr.h"
10 #include "mojo/public/gles2/gles2.h"
11 #include "mojom/gles2.h"
13 struct MojoGLES2ContextPrivate {};
18 class GLES2ClientImpl : public GLES2Client, public MojoGLES2ContextPrivate {
20 explicit GLES2ClientImpl(MojoAsyncWaiter* async_waiter,
21 ScopedMessagePipeHandle pipe,
22 MojoGLES2ContextCreated created_callback,
23 MojoGLES2ContextLost lost_callback,
24 MojoGLES2DrawAnimationFrame animation_callback,
26 virtual ~GLES2ClientImpl();
27 gpu::gles2::GLES2Interface* interface() const { return implementation_; }
28 gpu::ContextSupport* context_support() const { return implementation_; }
29 void RequestAnimationFrames();
30 void CancelAnimationFrames();
33 virtual void DidCreateContext(uint64_t encoded,
35 uint32_t height) MOJO_OVERRIDE;
36 virtual void ContextLost() MOJO_OVERRIDE;
37 virtual void DrawAnimationFrame() MOJO_OVERRIDE;
40 RemotePtr<GLES2> service_;
41 gpu::gles2::GLES2Implementation* implementation_;
42 MojoGLES2ContextCreated created_callback_;
43 MojoGLES2ContextLost lost_callback_;
44 MojoGLES2DrawAnimationFrame animation_callback_;
47 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl);
53 #endif // MOJO_GLES2_GLES2_CLIENT_IMPL_H_