Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / components / html_viewer / web_graphics_context_3d_command_buffer_impl.h
blob9c53d4fe5666b9338af7c34c4555b578768b8017
1 // Copyright 2015 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 COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_
6 #define COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_
8 #include "base/macros.h"
9 #include "gpu/blink/webgraphicscontext3d_impl.h"
10 #include "mojo/public/c/gles2/gles2.h"
11 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
12 #include "third_party/WebKit/public/platform/WebString.h"
13 #include "third_party/mojo/src/mojo/public/cpp/system/core.h"
14 #include "third_party/mojo/src/mojo/public/cpp/system/message_pipe.h"
15 #include "url/gurl.h"
17 namespace gpu {
18 class ContextSupport;
19 namespace gles2 { class GLES2Interface; }
22 namespace mojo {
23 class ApplicationImpl;
24 } // namespace mojo
26 namespace html_viewer {
28 class WebGraphicsContext3DCommandBufferImpl
29 : public gpu_blink::WebGraphicsContext3DImpl {
30 public:
31 WebGraphicsContext3DCommandBufferImpl(
32 mojo::ApplicationImpl* app,
33 const GURL& active_url,
34 const blink::WebGraphicsContext3D::Attributes& attributes,
35 blink::WebGraphicsContext3D* share_context,
36 blink::WebGLInfo* gl_info);
37 virtual ~WebGraphicsContext3DCommandBufferImpl();
39 static WebGraphicsContext3DCommandBufferImpl* CreateOffscreenContext(
40 mojo::ApplicationImpl* app,
41 const GURL& active_url,
42 const blink::WebGraphicsContext3D::Attributes& attributes,
43 blink::WebGraphicsContext3D* share_context,
44 blink::WebGLInfo* gl_info);
46 private:
47 static void ContextLostThunk(void* closure) {
48 static_cast<WebGraphicsContext3DCommandBufferImpl*>(closure)->ContextLost();
50 void ContextLost();
52 mojo::ScopedMessagePipeHandle command_buffer_handle_;
53 MojoGLES2Context gles2_context_;
54 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_;
56 DISALLOW_COPY_AND_ASSIGN(WebGraphicsContext3DCommandBufferImpl);
59 } // namespace html_viewer
61 #endif // COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_