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_PUBLIC_GLES2_GLES2_PRIVATE_H_
6 #define MOJO_PUBLIC_GLES2_GLES2_PRIVATE_H_
10 #include "mojo/public/gles2/gles2_export.h"
11 #include "mojo/public/gles2/gles2_types.h"
12 #include "mojo/public/system/async_waiter.h"
13 #include "mojo/public/system/core_cpp.h"
18 // Implementors of the GLES2 APIs can use this interface to install their
19 // implementation into the mojo_gles2 dynamic library. Mojo clients should not
20 // call these functions directly.
21 class MOJO_GLES2_EXPORT GLES2Support {
23 virtual ~GLES2Support();
25 static void Init(GLES2Support* gles2_support);
27 virtual void Initialize(MojoAsyncWaiter* async_waiter) = 0;
28 virtual void Terminate() = 0;
29 virtual MojoGLES2Context CreateContext(
30 MessagePipeHandle handle,
31 MojoGLES2ContextCreated created_callback,
32 MojoGLES2ContextLost lost_callback,
33 MojoGLES2DrawAnimationFrame animation_callback,
35 virtual void DestroyContext(MojoGLES2Context context) = 0;
36 virtual void MakeCurrent(MojoGLES2Context context) = 0;
37 virtual void SwapBuffers() = 0;
38 virtual void RequestAnimationFrames(MojoGLES2Context context) = 0;
39 virtual void CancelAnimationFrames(MojoGLES2Context context) = 0;
40 virtual void* GetGLES2Interface(MojoGLES2Context context) = 0;
41 virtual void* GetContextSupport(MojoGLES2Context context) = 0;
42 virtual GLES2Interface* GetGLES2InterfaceForCurrentContext() = 0;
47 #endif // MOJO_PUBLIC_GLES2_GLES2_PRIVATE_H_