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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/renderer/render_widget_fullscreen_pepper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_widget_fullscreen_pepper.h
diff --git a/chrome/renderer/render_widget_fullscreen_pepper.h b/chrome/renderer/render_widget_fullscreen_pepper.h
index 7133ec540c98ef35c39ab1d75b6b9410499dacf7..7b430e0c2d1b71866d05aeb26fd7d29529dfc653 100644
--- a/chrome/renderer/render_widget_fullscreen_pepper.h
+++ b/chrome/renderer/render_widget_fullscreen_pepper.h
@@ -7,36 +7,39 @@
#include "chrome/renderer/render_widget_fullscreen.h"
#include "third_party/WebKit/WebKit/chromium/public/WebWidget.h"
+#include "webkit/plugins/ppapi/fullscreen_container.h"
namespace webkit {
namespace ppapi {
class PluginInstance;
-class FullscreenContainer;
} // namespace ppapi
} // namespace webkit
+namespace ggl {
+class Context;
+} // namespace ggl
+
// A RenderWidget that hosts a fullscreen pepper plugin. This provides a
// FullscreenContainer that the plugin instance can callback into to e.g.
// invalidate rects.
-class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen {
+class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen,
+ public webkit::ppapi::FullscreenContainer {
public:
static RenderWidgetFullscreenPepper* Create(
int32 opener_id,
RenderThreadBase* render_thread,
webkit::ppapi::PluginInstance* plugin);
- // Asks the browser to close this view, which will tear off the window and
- // close this widget.
- void SendClose();
-
- // Invalidate the whole widget to force a redraw.
- void GenerateFullRepaint();
+ // pepper::FullscreenContainer API.
+ virtual void Invalidate();
+ virtual void InvalidateRect(const WebKit::WebRect& rect);
+ virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect);
+ virtual void Destroy();
+ virtual webkit::ppapi::PluginDelegate::PlatformContext3D* CreateContext3D();
- webkit::ppapi::FullscreenContainer* container() const {
- return container_.get();
- }
+ ggl::Context* context() const { return context_; }
protected:
RenderWidgetFullscreenPepper(RenderThreadBase* render_thread,
@@ -52,16 +55,36 @@ class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen {
TransportDIB** dib,
gfx::Rect* location,
gfx::Rect* clip);
+ virtual void OnResize(const gfx::Size& new_size,
+ const gfx::Rect& resizer_rect);
// RenderWidgetFullscreen API.
virtual WebKit::WebWidget* CreateWebWidget();
private:
+ // Creates the GL context for compositing.
+ void CreateContext();
+
+ // Destroys the GL context for compositing.
+ void DestroyContext();
+
+ // Initialize the GL states and resources for compositing.
+ bool InitContext();
+
+ // Checks (and returns) whether accelerated compositing should be on or off,
+ // and notify the browser.
+ bool CheckCompositing();
+
// The plugin instance this widget wraps.
webkit::ppapi::PluginInstance* plugin_;
- // The FullscreenContainer that the plugin instance can callback into.
- scoped_ptr<webkit::ppapi::FullscreenContainer> container_;
+#if defined(OS_MACOSX)
+ gfx::PluginWindowHandle plugin_handle_;
+#endif
+ // GL context for compositing.
+ ggl::Context* context_;
+ unsigned int buffer_;
+ unsigned int program_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper);
};
« 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