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_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_
6 #define MOJO_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_
8 #include "base/time/time.h"
9 #include "base/timer/timer.h"
10 #include "mojo/public/bindings/lib/remote_ptr.h"
11 #include "mojo/public/gles2/gles2.h"
12 #include "mojom/native_viewport.h"
13 #include "ui/gfx/size.h"
25 class GLES2ClientImpl {
28 ScopedMessagePipeHandle pipe,
29 const base::Callback<void(gfx::Size)>& context_created_callback);
30 virtual ~GLES2ClientImpl();
32 gpu::gles2::GLES2Interface* Interface() const;
33 gpu::ContextSupport* Support() const;
36 void DidCreateContext(uint32_t width, uint32_t height);
37 static void DidCreateContextThunk(
42 static void ContextLostThunk(void* closure);
44 base::Callback<void(gfx::Size viewport_size)> context_created_callback_;
46 MojoGLES2Context context_;
48 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl);
51 } // namespace examples
54 #endif // MOJO_EXAMPLES_COMPOSITOR_APP_GLES2_CLIENT_IMPL_H_