1 // Copyright 2013 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_SERVICES_GLES2_GLES2_IMPL_H_
6 #define MOJO_SERVICES_GLES2_GLES2_IMPL_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/timer/timer.h"
10 #include "mojo/public/bindings/lib/remote_ptr.h"
11 #include "mojo/public/system/core_cpp.h"
12 #include "mojom/gles2.h"
13 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/size.h"
17 class GLInProcessContext;
23 class GLES2Impl : public GLES2 {
25 explicit GLES2Impl(ScopedMessagePipeHandle client);
28 void CreateContext(gfx::AcceleratedWidget widget, const gfx::Size& size);
31 virtual void RequestAnimationFrames() OVERRIDE;
32 virtual void CancelAnimationFrames() OVERRIDE;
33 virtual void Destroy() OVERRIDE;
35 void OnGLContextLost();
36 void DrawAnimationFrame();
38 base::RepeatingTimer<GLES2Impl> timer_;
39 scoped_ptr<gpu::GLInProcessContext> gl_context_;
40 RemotePtr<GLES2Client> client_;
42 DISALLOW_COPY_AND_ASSIGN(GLES2Impl);
45 } // namespace services
48 #endif // MOJO_SERVICES_GLES2_GLES2_IMPL_H_