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/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "content/common/gpu/client/content_gl_context.h" |
9 #include "content/renderer/pepper_parent_context_provider.h" | 10 #include "content/renderer/pepper_parent_context_provider.h" |
10 #include "content/renderer/render_widget_fullscreen.h" | 11 #include "content/renderer/render_widget_fullscreen.h" |
11 #include "content/renderer/gpu/renderer_gl_context.h" | |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
13 #include "webkit/plugins/ppapi/fullscreen_container.h" | 13 #include "webkit/plugins/ppapi/fullscreen_container.h" |
14 | 14 |
15 namespace webkit { | 15 namespace webkit { |
16 namespace ppapi { | 16 namespace ppapi { |
17 | 17 |
18 class PluginInstance; | 18 class PluginInstance; |
19 | 19 |
20 } // namespace ppapi | 20 } // namespace ppapi |
21 } // namespace webkit | 21 } // namespace webkit |
(...skipping 12 matching lines...) Expand all Loading... |
34 | 34 |
35 // pepper::FullscreenContainer API. | 35 // pepper::FullscreenContainer API. |
36 virtual void Invalidate() OVERRIDE; | 36 virtual void Invalidate() OVERRIDE; |
37 virtual void InvalidateRect(const WebKit::WebRect& rect) OVERRIDE; | 37 virtual void InvalidateRect(const WebKit::WebRect& rect) OVERRIDE; |
38 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect) OVERRIDE; | 38 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect) OVERRIDE; |
39 virtual void Destroy() OVERRIDE; | 39 virtual void Destroy() OVERRIDE; |
40 virtual void DidChangeCursor(const WebKit::WebCursorInfo& cursor) OVERRIDE; | 40 virtual void DidChangeCursor(const WebKit::WebCursorInfo& cursor) OVERRIDE; |
41 virtual webkit::ppapi::PluginDelegate::PlatformContext3D* | 41 virtual webkit::ppapi::PluginDelegate::PlatformContext3D* |
42 CreateContext3D() OVERRIDE; | 42 CreateContext3D() OVERRIDE; |
43 | 43 |
44 RendererGLContext* context() const { return context_; } | 44 ContentGLContext* context() const { return context_; } |
45 void SwapBuffers(); | 45 void SwapBuffers(); |
46 | 46 |
47 // Could be NULL when this widget is closing. | 47 // Could be NULL when this widget is closing. |
48 webkit::ppapi::PluginInstance* plugin() const { return plugin_; } | 48 webkit::ppapi::PluginInstance* plugin() const { return plugin_; } |
49 | 49 |
50 protected: | 50 protected: |
51 RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstance* plugin, | 51 RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstance* plugin, |
52 const GURL& active_url); | 52 const GURL& active_url); |
53 virtual ~RenderWidgetFullscreenPepper(); | 53 virtual ~RenderWidgetFullscreenPepper(); |
54 | 54 |
(...skipping 21 matching lines...) Expand all Loading... |
76 void CreateContext(); | 76 void CreateContext(); |
77 | 77 |
78 // Initialize the GL states and resources for compositing. | 78 // Initialize the GL states and resources for compositing. |
79 bool InitContext(); | 79 bool InitContext(); |
80 | 80 |
81 // Checks (and returns) whether accelerated compositing should be on or off, | 81 // Checks (and returns) whether accelerated compositing should be on or off, |
82 // and notify the browser. | 82 // and notify the browser. |
83 bool CheckCompositing(); | 83 bool CheckCompositing(); |
84 | 84 |
85 // Called when the compositing context gets lost. | 85 // Called when the compositing context gets lost. |
86 void OnLostContext(RendererGLContext::ContextLostReason); | 86 void OnLostContext(ContentGLContext::ContextLostReason); |
87 | 87 |
88 // Binding of RendererGLContext swapbuffers callback to | 88 // Binding of ContentGLContext swapbuffers callback to |
89 // RenderWidget::OnSwapBuffersCompleted. | 89 // RenderWidget::OnSwapBuffersCompleted. |
90 void OnSwapBuffersCompleteByRendererGLContext(); | 90 void OnSwapBuffersCompleteByContentGLContext(); |
91 | 91 |
92 // Implementation of PepperParentContextProvider. | 92 // Implementation of PepperParentContextProvider. |
93 virtual RendererGLContext* GetParentContextForPlatformContext3D() OVERRIDE; | 93 virtual ContentGLContext* GetParentContextForPlatformContext3D() OVERRIDE; |
94 | 94 |
95 // URL that is responsible for this widget, passed to ggl::CreateViewContext. | 95 // URL that is responsible for this widget, passed to ggl::CreateViewContext. |
96 GURL active_url_; | 96 GURL active_url_; |
97 | 97 |
98 // The plugin instance this widget wraps. | 98 // The plugin instance this widget wraps. |
99 webkit::ppapi::PluginInstance* plugin_; | 99 webkit::ppapi::PluginInstance* plugin_; |
100 | 100 |
101 // GL context for compositing. | 101 // GL context for compositing. |
102 RendererGLContext* context_; | 102 ContentGLContext* context_; |
103 unsigned int buffer_; | 103 unsigned int buffer_; |
104 unsigned int program_; | 104 unsigned int program_; |
105 | 105 |
106 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; | 106 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; |
107 | 107 |
108 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); | 108 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); |
109 }; | 109 }; |
110 | 110 |
111 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 111 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
OLD | NEW |