OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_ | 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_ | 6 #define COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/mus/public/interfaces/command_buffer.mojom.h" | 9 #include "components/mus/public/interfaces/command_buffer.mojom.h" |
10 #include "gpu/blink/webgraphicscontext3d_impl.h" | 10 #include "gpu/blink/webgraphicscontext3d_impl.h" |
11 #include "mojo/public/c/gles2/gles2.h" | 11 #include "mojo/public/c/gles2/gles2.h" |
12 #include "mojo/public/cpp/system/core.h" | 12 #include "mojo/public/cpp/system/core.h" |
13 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 13 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
14 #include "third_party/WebKit/public/platform/WebString.h" | 14 #include "third_party/WebKit/public/platform/WebString.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 class ApplicationImpl; | 18 class Shell; |
19 } | 19 } |
20 | 20 |
21 namespace gpu { | 21 namespace gpu { |
22 class ContextSupport; | 22 class ContextSupport; |
23 namespace gles2 { class GLES2Interface; } | 23 namespace gles2 { class GLES2Interface; } |
24 } | 24 } |
25 | 25 |
26 namespace html_viewer { | 26 namespace html_viewer { |
27 | 27 |
28 class GlobalState; | 28 class GlobalState; |
29 | 29 |
30 class WebGraphicsContext3DCommandBufferImpl | 30 class WebGraphicsContext3DCommandBufferImpl |
31 : public gpu_blink::WebGraphicsContext3DImpl { | 31 : public gpu_blink::WebGraphicsContext3DImpl { |
32 public: | 32 public: |
33 static WebGraphicsContext3DCommandBufferImpl* CreateOffscreenContext( | 33 static WebGraphicsContext3DCommandBufferImpl* CreateOffscreenContext( |
34 GlobalState* global_state, | 34 GlobalState* global_state, |
35 mojo::ApplicationImpl* app, | 35 mojo::Shell* shell, |
36 const GURL& active_url, | 36 const GURL& active_url, |
37 const blink::WebGraphicsContext3D::Attributes& attributes, | 37 const blink::WebGraphicsContext3D::Attributes& attributes, |
38 blink::WebGraphicsContext3D* share_context, | 38 blink::WebGraphicsContext3D* share_context, |
39 blink::WebGraphicsContext3D::WebGraphicsInfo* gl_info); | 39 blink::WebGraphicsContext3D::WebGraphicsInfo* gl_info); |
40 | 40 |
41 private: | 41 private: |
42 WebGraphicsContext3DCommandBufferImpl( | 42 WebGraphicsContext3DCommandBufferImpl( |
43 mojo::InterfacePtrInfo<mus::mojom::CommandBuffer> command_buffer_info, | 43 mojo::InterfacePtrInfo<mus::mojom::CommandBuffer> command_buffer_info, |
44 const GURL& active_url, | 44 const GURL& active_url, |
45 const blink::WebGraphicsContext3D::Attributes& attributes, | 45 const blink::WebGraphicsContext3D::Attributes& attributes, |
46 blink::WebGraphicsContext3D* share_context); | 46 blink::WebGraphicsContext3D* share_context); |
47 ~WebGraphicsContext3DCommandBufferImpl() override; | 47 ~WebGraphicsContext3DCommandBufferImpl() override; |
48 | 48 |
49 static void ContextLostThunk(void* closure) { | 49 static void ContextLostThunk(void* closure) { |
50 static_cast<WebGraphicsContext3DCommandBufferImpl*>(closure)->ContextLost(); | 50 static_cast<WebGraphicsContext3DCommandBufferImpl*>(closure)->ContextLost(); |
51 } | 51 } |
52 void ContextLost(); | 52 void ContextLost(); |
53 | 53 |
54 MojoGLES2Context gles2_context_; | 54 MojoGLES2Context gles2_context_; |
55 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; | 55 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(WebGraphicsContext3DCommandBufferImpl); | 57 DISALLOW_COPY_AND_ASSIGN(WebGraphicsContext3DCommandBufferImpl); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace html_viewer | 60 } // namespace html_viewer |
61 | 61 |
62 #endif // COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_ | 62 #endif // COMPONENTS_HTML_VIEWER_WEB_GRAPHICS_CONTEXT_3D_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |