Disable signin-to-Chrome when using Guest profile.
[chromium-blink-merge.git] / mojo / gles2 / gles2_context.h
blobe6f1e9e375f7ba3307a7e04ecbd42f32cc95da4c
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/bindings/remote_ptr.h"
13 #include "mojo/public/gles2/gles2.h"
15 struct MojoGLES2ContextPrivate {};
17 namespace gpu {
18 class TransferBuffer;
19 namespace gles2 {
20 class GLES2CmdHelper;
21 class GLES2Implementation;
25 namespace mojo {
26 namespace gles2 {
28 class GLES2Context : public CommandBufferDelegate,
29 public MojoGLES2ContextPrivate {
30 public:
31 explicit GLES2Context(MojoAsyncWaiter* async_waiter,
32 ScopedCommandBufferHandle command_buffer_handle,
33 MojoGLES2ContextLost lost_callback,
34 MojoGLES2DrawAnimationFrame animation_callback,
35 void* closure);
36 virtual ~GLES2Context();
37 bool Initialize();
39 gpu::gles2::GLES2Interface* interface() const {
40 return implementation_.get();
42 gpu::ContextSupport* context_support() const { return implementation_.get(); }
43 void RequestAnimationFrames();
44 void CancelAnimationFrames();
46 private:
47 virtual void ContextLost() OVERRIDE;
48 virtual void DrawAnimationFrame() OVERRIDE;
50 CommandBufferClientImpl command_buffer_;
51 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_;
52 scoped_ptr<gpu::TransferBuffer> transfer_buffer_;
53 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_;
54 MojoGLES2ContextLost lost_callback_;
55 MojoGLES2DrawAnimationFrame animation_callback_;
56 void* closure_;
58 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2Context);
61 } // namespace gles2
62 } // namespace mojo
64 #endif // MOJO_GLES2_GLES2_CONTEXT_H_