OLD | NEW |
| (Empty) |
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. | |
4 | |
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_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "components/mus/public/interfaces/command_buffer.mojom.h" | |
10 #include "gpu/blink/webgraphicscontext3d_impl.h" | |
11 #include "mojo/public/c/gles2/gles2.h" | |
12 #include "mojo/public/cpp/system/core.h" | |
13 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | |
14 #include "third_party/WebKit/public/platform/WebString.h" | |
15 #include "url/gurl.h" | |
16 | |
17 namespace mojo { | |
18 class Shell; | |
19 } | |
20 | |
21 namespace gpu { | |
22 class ContextSupport; | |
23 namespace gles2 { class GLES2Interface; } | |
24 } | |
25 | |
26 namespace html_viewer { | |
27 | |
28 class GlobalState; | |
29 | |
30 class WebGraphicsContext3DCommandBufferImpl | |
31 : public gpu_blink::WebGraphicsContext3DImpl { | |
32 public: | |
33 static WebGraphicsContext3DCommandBufferImpl* CreateOffscreenContext( | |
34 GlobalState* global_state, | |
35 mojo::Shell* shell, | |
36 const GURL& active_url, | |
37 const blink::WebGraphicsContext3D::Attributes& attributes, | |
38 blink::WebGraphicsContext3D* share_context, | |
39 blink::WebGraphicsContext3D::WebGraphicsInfo* gl_info); | |
40 | |
41 private: | |
42 WebGraphicsContext3DCommandBufferImpl( | |
43 mojo::InterfacePtrInfo<mus::mojom::CommandBuffer> command_buffer_info, | |
44 const GURL& active_url, | |
45 const blink::WebGraphicsContext3D::Attributes& attributes, | |
46 blink::WebGraphicsContext3D* share_context); | |
47 ~WebGraphicsContext3DCommandBufferImpl() override; | |
48 | |
49 static void ContextLostThunk(void* closure) { | |
50 static_cast<WebGraphicsContext3DCommandBufferImpl*>(closure)->ContextLost(); | |
51 } | |
52 void ContextLost(); | |
53 | |
54 MojoGLES2Context gles2_context_; | |
55 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(WebGraphicsContext3DCommandBufferImpl); | |
58 }; | |
59 | |
60 } // namespace html_viewer | |
61 | |
62 #endif // COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_ | |
OLD | NEW |