OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "content/renderer/pepper_parent_context_provider.h" |
9 #include "content/renderer/render_widget_fullscreen.h" | 10 #include "content/renderer/render_widget_fullscreen.h" |
10 #include "content/renderer/gpu/renderer_gl_context.h" | 11 #include "content/renderer/gpu/renderer_gl_context.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
12 #include "webkit/plugins/ppapi/fullscreen_container.h" | 13 #include "webkit/plugins/ppapi/fullscreen_container.h" |
13 | 14 |
14 namespace webkit { | 15 namespace webkit { |
15 namespace ppapi { | 16 namespace ppapi { |
16 | 17 |
17 class PluginInstance; | 18 class PluginInstance; |
18 | 19 |
19 } // namespace ppapi | 20 } // namespace ppapi |
20 } // namespace webkit | 21 } // namespace webkit |
21 | 22 |
22 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a | 23 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a |
23 // FullscreenContainer that the plugin instance can callback into to e.g. | 24 // FullscreenContainer that the plugin instance can callback into to e.g. |
24 // invalidate rects. | 25 // invalidate rects. |
25 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen, | 26 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen, |
26 public webkit::ppapi::FullscreenContainer { | 27 public webkit::ppapi::FullscreenContainer, |
| 28 public PepperParentContextProvider { |
27 public: | 29 public: |
28 static RenderWidgetFullscreenPepper* Create( | 30 static RenderWidgetFullscreenPepper* Create( |
29 int32 opener_id, | 31 int32 opener_id, |
30 webkit::ppapi::PluginInstance* plugin, | 32 webkit::ppapi::PluginInstance* plugin, |
31 const GURL& active_url); | 33 const GURL& active_url); |
32 | 34 |
33 // pepper::FullscreenContainer API. | 35 // pepper::FullscreenContainer API. |
34 virtual void Invalidate(); | 36 virtual void Invalidate(); |
35 virtual void InvalidateRect(const WebKit::WebRect& rect); | 37 virtual void InvalidateRect(const WebKit::WebRect& rect); |
36 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect); | 38 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // and notify the browser. | 81 // and notify the browser. |
80 bool CheckCompositing(); | 82 bool CheckCompositing(); |
81 | 83 |
82 // Called when the compositing context gets lost. | 84 // Called when the compositing context gets lost. |
83 void OnLostContext(RendererGLContext::ContextLostReason); | 85 void OnLostContext(RendererGLContext::ContextLostReason); |
84 | 86 |
85 // Binding of RendererGLContext swapbuffers callback to | 87 // Binding of RendererGLContext swapbuffers callback to |
86 // RenderWidget::OnSwapBuffersCompleted. | 88 // RenderWidget::OnSwapBuffersCompleted. |
87 void OnSwapBuffersCompleteByRendererGLContext(); | 89 void OnSwapBuffersCompleteByRendererGLContext(); |
88 | 90 |
| 91 // Implementation of PepperParentContextProvider. |
| 92 virtual RendererGLContext* GetParentContextForPlatformContext3D(); |
| 93 |
89 // URL that is responsible for this widget, passed to ggl::CreateViewContext. | 94 // URL that is responsible for this widget, passed to ggl::CreateViewContext. |
90 GURL active_url_; | 95 GURL active_url_; |
91 | 96 |
92 // The plugin instance this widget wraps. | 97 // The plugin instance this widget wraps. |
93 webkit::ppapi::PluginInstance* plugin_; | 98 webkit::ppapi::PluginInstance* plugin_; |
94 | 99 |
95 // GL context for compositing. | 100 // GL context for compositing. |
96 RendererGLContext* context_; | 101 RendererGLContext* context_; |
97 unsigned int buffer_; | 102 unsigned int buffer_; |
98 unsigned int program_; | 103 unsigned int program_; |
99 | 104 |
100 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; | 105 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; |
101 | 106 |
102 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); | 107 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); |
103 }; | 108 }; |
104 | 109 |
105 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 110 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
OLD | NEW |