Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: chrome/renderer/render_widget_fullscreen_pepper.h

Issue 5994002: use accelerated compositing in fullscreen pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/renderer/render_widget_fullscreen_pepper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ 5 #ifndef CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_
6 #define CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ 6 #define CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_
7 7
8 #include "chrome/renderer/render_widget_fullscreen.h" 8 #include "chrome/renderer/render_widget_fullscreen.h"
9 #include "third_party/WebKit/WebKit/chromium/public/WebWidget.h" 9 #include "third_party/WebKit/WebKit/chromium/public/WebWidget.h"
10 #include "webkit/plugins/ppapi/fullscreen_container.h"
10 11
11 namespace webkit { 12 namespace webkit {
12 namespace ppapi { 13 namespace ppapi {
13 14
14 class PluginInstance; 15 class PluginInstance;
15 class FullscreenContainer;
16 16
17 } // namespace ppapi 17 } // namespace ppapi
18 } // namespace webkit 18 } // namespace webkit
19 19
20 namespace ggl {
21 class Context;
22 } // namespace ggl
23
20 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a 24 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a
21 // FullscreenContainer that the plugin instance can callback into to e.g. 25 // FullscreenContainer that the plugin instance can callback into to e.g.
22 // invalidate rects. 26 // invalidate rects.
23 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen { 27 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen,
28 public webkit::ppapi::FullscreenContainer {
24 public: 29 public:
25 static RenderWidgetFullscreenPepper* Create( 30 static RenderWidgetFullscreenPepper* Create(
26 int32 opener_id, 31 int32 opener_id,
27 RenderThreadBase* render_thread, 32 RenderThreadBase* render_thread,
28 webkit::ppapi::PluginInstance* plugin); 33 webkit::ppapi::PluginInstance* plugin);
29 34
30 // Asks the browser to close this view, which will tear off the window and 35 // pepper::FullscreenContainer API.
31 // close this widget. 36 virtual void Invalidate();
32 void SendClose(); 37 virtual void InvalidateRect(const WebKit::WebRect& rect);
38 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect);
39 virtual void Destroy();
40 virtual webkit::ppapi::PluginDelegate::PlatformContext3D* CreateContext3D();
33 41
34 // Invalidate the whole widget to force a redraw. 42 ggl::Context* context() const { return context_; }
35 void GenerateFullRepaint();
36
37 webkit::ppapi::FullscreenContainer* container() const {
38 return container_.get();
39 }
40 43
41 protected: 44 protected:
42 RenderWidgetFullscreenPepper(RenderThreadBase* render_thread, 45 RenderWidgetFullscreenPepper(RenderThreadBase* render_thread,
43 webkit::ppapi::PluginInstance* plugin); 46 webkit::ppapi::PluginInstance* plugin);
44 virtual ~RenderWidgetFullscreenPepper(); 47 virtual ~RenderWidgetFullscreenPepper();
45 48
46 // RenderWidget API. 49 // RenderWidget API.
47 virtual void DidInitiatePaint(); 50 virtual void DidInitiatePaint();
48 virtual void DidFlushPaint(); 51 virtual void DidFlushPaint();
49 virtual void Close(); 52 virtual void Close();
50 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( 53 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint(
51 const gfx::Rect& paint_bounds, 54 const gfx::Rect& paint_bounds,
52 TransportDIB** dib, 55 TransportDIB** dib,
53 gfx::Rect* location, 56 gfx::Rect* location,
54 gfx::Rect* clip); 57 gfx::Rect* clip);
58 virtual void OnResize(const gfx::Size& new_size,
59 const gfx::Rect& resizer_rect);
55 60
56 // RenderWidgetFullscreen API. 61 // RenderWidgetFullscreen API.
57 virtual WebKit::WebWidget* CreateWebWidget(); 62 virtual WebKit::WebWidget* CreateWebWidget();
58 63
59 private: 64 private:
65 // Creates the GL context for compositing.
66 void CreateContext();
67
68 // Destroys the GL context for compositing.
69 void DestroyContext();
70
71 // Initialize the GL states and resources for compositing.
72 bool InitContext();
73
74 // Checks (and returns) whether accelerated compositing should be on or off,
75 // and notify the browser.
76 bool CheckCompositing();
77
60 // The plugin instance this widget wraps. 78 // The plugin instance this widget wraps.
61 webkit::ppapi::PluginInstance* plugin_; 79 webkit::ppapi::PluginInstance* plugin_;
62 80
63 // The FullscreenContainer that the plugin instance can callback into. 81 #if defined(OS_MACOSX)
64 scoped_ptr<webkit::ppapi::FullscreenContainer> container_; 82 gfx::PluginWindowHandle plugin_handle_;
83 #endif
84 // GL context for compositing.
85 ggl::Context* context_;
86 unsigned int buffer_;
87 unsigned int program_;
65 88
66 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); 89 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper);
67 }; 90 };
68 91
69 #endif // CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ 92 #endif // CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/renderer/render_widget_fullscreen_pepper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698