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. 4 5 #ifndef MOJO_SERVICES_GLES2_GLES2_IMPL_H_ 6 #define MOJO_SERVICES_GLES2_GLES2_IMPL_H_ 7 8 #include "base/memory/scoped_ptr.h" 9 #include "mojo/public/bindings/lib/remote_ptr.h" 10 #include "mojo/public/system/core_cpp.h" 11 #include "mojom/gles2.h" 12 #include "ui/gfx/native_widget_types.h" 13 #include "ui/gfx/size.h" 14 15 namespace gpu { 16 class GLInProcessContext; 17 } 18 19 namespace mojo { 20 namespace services { 21 22 class GLES2Impl : public GLES2Stub { 23 public: 24 explicit GLES2Impl(ScopedMessagePipeHandle client); 25 virtual ~GLES2Impl(); 26 27 virtual void Destroy() OVERRIDE; 28 29 void CreateContext(gfx::AcceleratedWidget widget, const gfx::Size& size); 30 31 private: 32 void OnGLContextLost(); 33 34 scoped_ptr<gpu::GLInProcessContext> gl_context_; 35 RemotePtr<GLES2Client> client_; 36 37 DISALLOW_COPY_AND_ASSIGN(GLES2Impl); 38 }; 39 40 } // namespace services 41 } // namespace mojo 42 43 #endif // MOJO_SERVICES_GLES2_GLES2_IMPL_H_ 44