diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 16:51:44 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-18 16:51:44 +0000 |
commit | 2cff005220a16c7d1f814d5495887823b634f077 (patch) | |
tree | 867b327f3272f0d4f9cc3bbe085f1c28b30c3905 /content/renderer/render_widget_fullscreen_pepper.h | |
parent | 21fcf83c508704a5bd11ed0467fc20b5e03f3acc (diff) | |
download | chromium_src-2cff005220a16c7d1f814d5495887823b634f077.zip chromium_src-2cff005220a16c7d1f814d5495887823b634f077.tar.gz chromium_src-2cff005220a16c7d1f814d5495887823b634f077.tar.bz2 |
Move render_widget files to content.
TBR=avi
Review URL: http://codereview.chromium.org/6709032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_widget_fullscreen_pepper.h')
-rw-r--r-- | content/renderer/render_widget_fullscreen_pepper.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/content/renderer/render_widget_fullscreen_pepper.h b/content/renderer/render_widget_fullscreen_pepper.h new file mode 100644 index 0000000..a3905ce --- /dev/null +++ b/content/renderer/render_widget_fullscreen_pepper.h @@ -0,0 +1,89 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ +#define CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ + +#include "content/renderer/render_widget_fullscreen.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" +#include "webkit/plugins/ppapi/fullscreen_container.h" + +namespace webkit { +namespace ppapi { + +class PluginInstance; + +} // 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, + public webkit::ppapi::FullscreenContainer { + public: + static RenderWidgetFullscreenPepper* Create( + int32 opener_id, + RenderThreadBase* render_thread, + webkit::ppapi::PluginInstance* plugin); + + // 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(); + + ggl::Context* context() const { return context_; } + + protected: + RenderWidgetFullscreenPepper(RenderThreadBase* render_thread, + webkit::ppapi::PluginInstance* plugin); + virtual ~RenderWidgetFullscreenPepper(); + + // RenderWidget API. + virtual void DidInitiatePaint(); + virtual void DidFlushPaint(); + virtual void Close(); + virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( + const gfx::Rect& paint_bounds, + 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_; + + // GL context for compositing. + ggl::Context* context_; + unsigned int buffer_; + unsigned int program_; + + DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); +}; + +#endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |