OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
6 #define CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
11 #include "content/renderer/mouse_lock_dispatcher.h" | 11 #include "content/renderer/mouse_lock_dispatcher.h" |
12 #include "content/renderer/pepper/pepper_parent_context_provider.h" | |
13 #include "content/renderer/render_widget_fullscreen.h" | 12 #include "content/renderer/render_widget_fullscreen.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
16 #include "webkit/plugins/ppapi/fullscreen_container.h" | 15 #include "webkit/plugins/ppapi/fullscreen_container.h" |
17 | 16 |
18 namespace webkit { | 17 namespace webkit { |
19 namespace ppapi { | 18 namespace ppapi { |
20 | 19 |
21 class PluginInstance; | 20 class PluginInstance; |
22 | 21 |
23 } // namespace ppapi | 22 } // namespace ppapi |
24 } // namespace webkit | 23 } // namespace webkit |
25 | 24 |
26 namespace content { | 25 namespace content { |
27 class WebGraphicsContext3DCommandBufferImpl; | 26 class WebGraphicsContext3DCommandBufferImpl; |
28 | 27 |
29 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a | 28 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a |
30 // FullscreenContainer that the plugin instance can callback into to e.g. | 29 // FullscreenContainer that the plugin instance can callback into to e.g. |
31 // invalidate rects. | 30 // invalidate rects. |
32 class RenderWidgetFullscreenPepper : | 31 class RenderWidgetFullscreenPepper : |
33 public RenderWidgetFullscreen, | 32 public RenderWidgetFullscreen, |
34 public webkit::ppapi::FullscreenContainer, | 33 public webkit::ppapi::FullscreenContainer, |
35 public PepperParentContextProvider, | |
36 public WebGraphicsContext3DSwapBuffersClient { | 34 public WebGraphicsContext3DSwapBuffersClient { |
37 public: | 35 public: |
38 static RenderWidgetFullscreenPepper* Create( | 36 static RenderWidgetFullscreenPepper* Create( |
39 int32 opener_id, | 37 int32 opener_id, |
40 webkit::ppapi::PluginInstance* plugin, | 38 webkit::ppapi::PluginInstance* plugin, |
41 const GURL& active_url, | 39 const GURL& active_url, |
42 const WebKit::WebScreenInfo& screen_info); | 40 const WebKit::WebScreenInfo& screen_info); |
43 | 41 |
44 // WebGraphicscontext3DSwapBuffersClient implementation | 42 // WebGraphicscontext3DSwapBuffersClient implementation |
45 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; | 43 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Creates the GL context for compositing. | 102 // Creates the GL context for compositing. |
105 void CreateContext(); | 103 void CreateContext(); |
106 | 104 |
107 // Initialize the GL states and resources for compositing. | 105 // Initialize the GL states and resources for compositing. |
108 bool InitContext(); | 106 bool InitContext(); |
109 | 107 |
110 // Checks (and returns) whether accelerated compositing should be on or off, | 108 // Checks (and returns) whether accelerated compositing should be on or off, |
111 // and notify the browser. | 109 // and notify the browser. |
112 bool CheckCompositing(); | 110 bool CheckCompositing(); |
113 | 111 |
114 // Implementation of PepperParentContextProvider. | |
115 virtual WebGraphicsContext3DCommandBufferImpl* | |
116 GetParentContextForPlatformContext3D() OVERRIDE; | |
117 | |
118 // URL that is responsible for this widget, passed to ggl::CreateViewContext. | 112 // URL that is responsible for this widget, passed to ggl::CreateViewContext. |
119 GURL active_url_; | 113 GURL active_url_; |
120 | 114 |
121 // The plugin instance this widget wraps. | 115 // The plugin instance this widget wraps. |
122 webkit::ppapi::PluginInstance* plugin_; | 116 webkit::ppapi::PluginInstance* plugin_; |
123 | 117 |
124 // GL context for compositing. | 118 // GL context for compositing. |
125 WebGraphicsContext3DCommandBufferImpl* context_; | 119 WebGraphicsContext3DCommandBufferImpl* context_; |
126 unsigned int buffer_; | 120 unsigned int buffer_; |
127 unsigned int program_; | 121 unsigned int program_; |
128 | 122 |
129 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; | 123 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; |
130 | 124 |
131 scoped_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; | 125 scoped_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; |
132 | 126 |
133 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); | 127 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); |
134 }; | 128 }; |
135 | 129 |
136 } // namespace content | 130 } // namespace content |
137 | 131 |
138 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 132 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
OLD | NEW |