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

Unified Diff: content/browser/renderer_host/render_widget_host_view_base.h

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
Index: content/browser/renderer_host/render_widget_host_view_base.h
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index d6da2e39d36d2791fa83d3aa77f1ef1dc867dbe6..aed347f2abceed2bd421ead315eb5bb24fb730fb 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -53,6 +53,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
virtual bool IsShowingContextMenu() const OVERRIDE;
virtual void SetShowingContextMenu(bool showing_menu) OVERRIDE;
virtual bool IsMouseLocked() OVERRIDE;
+ virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
+ virtual bool ResizeNeedsNewSurface() OVERRIDE;
virtual void UnhandledWheelEvent(
const WebKit::WebMouseWheelEvent& event) OVERRIDE;
virtual void SetPopupType(WebKit::WebPopupType popup_type) OVERRIDE;
@@ -60,14 +62,54 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
virtual BrowserAccessibilityManager*
GetBrowserAccessibilityManager() const OVERRIDE;
+ virtual void AcceleratedSurfaceBuffersSwapped(
+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel,
+ int gpu_host_id) OVERRIDE;
+ virtual void AcceleratedSurfaceNew(
+ int32 width_in_pixel,
+ int32 height_in_pixel,
+ uint64* surface_handle,
+ TransportDIB::Handle* shm_handle) OVERRIDE;
+ virtual void AcceleratedSurfaceRelease(uint64 surface_handle) OVERRIDE;
+ virtual void AcceleratedSurfacePostSubBuffer(
+ const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel,
+ int gpu_host_id) OVERRIDE;
+
void SetBrowserAccessibilityManager(BrowserAccessibilityManager* manager);
// Notification that a resize or move session ended on the native widget.
void UpdateScreenInfo();
+ // A small wrapper to represent a pluggable mechanism for generating a
+ // GLSurfaceHandle. Normally the platform-specific derived class will
+ // provide an implementation, but for the browser plugin, an alternate
+ // implementation is used.
+ class CompositingDelegate {
+ public:
+ virtual gfx::GLSurfaceHandle GetCompositingSurface() = 0;
+ virtual bool ResizeNeedsNewSurface() = 0;
+ virtual void AcceleratedSurfaceBuffersSwapped(
+ const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel,
+ int gpu_host_id) = 0;
+ virtual void AcceleratedSurfaceNew(
+ int32 width_in_pixel,
+ int32 height_in_pixel,
+ uint64* surface_handle,
+ TransportDIB::Handle* shm_handle);
+ virtual void AcceleratedSurfaceRelease(uint64 surface_handle);
+ virtual void AcceleratedSurfacePostSubBuffer(
+ const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel,
+ int gpu_host_id) = 0;
+ virtual ~CompositingDelegate();
+ };
+
+ void SetCompositingDelegate(scoped_ptr<CompositingDelegate> delegate) {
+ compositing_delegate_.reset(delegate.release());
+ }
+
protected:
// Interface class only, do not construct.
- RenderWidgetHostViewBase();
+ RenderWidgetHostViewBase(scoped_ptr<CompositingDelegate> delegate);
// Whether this view is a popup and what kind of popup it is (select,
// autofill...).
@@ -97,6 +139,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
// The current selection range relative to the start of the web page.
ui::Range selection_range_;
+
private:
// Manager of the tree representation of the WebKit render tree.
scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_;
@@ -104,6 +147,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
gfx::Rect current_display_area_;
float current_device_scale_factor_;
+ scoped_ptr<CompositingDelegate> compositing_delegate_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase);
};

Powered by Google App Engine
This is Rietveld 408576698