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

Unified Diff: content/browser/frame_host/render_widget_host_view_child_frame.h

Issue 1094113003: Allow out-of-process iframes to render to compositing surfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Destroy Surface when resetting id Created 5 years, 7 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/frame_host/render_widget_host_view_child_frame.h
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/frame_host/render_widget_host_view_child_frame.h
index 6513033172f1732a9d8c391e69e786aedfd1ecd5..be1fee6ce1ca3848541863c1a782b289737f7a56 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.h
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.h
@@ -6,16 +6,27 @@
#define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
#include "base/memory/scoped_ptr.h"
+#include "cc/resources/returned_resource.h"
+#include "cc/surfaces/surface_factory_client.h"
+#include "cc/surfaces/surface_id_allocator.h"
+#include "content/browser/compositor/image_transport_factory.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/common/content_export.h"
#include "content/public/browser/readback_types.h"
+#include "ui/compositor/compositor.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/native_widget_types.h"
+namespace cc {
+class SurfaceFactory;
+enum class SurfaceDrawStatus;
+}
+
namespace content {
class CrossProcessFrameConnector;
class RenderWidgetHost;
class RenderWidgetHostImpl;
+class RenderWidgetHostViewChildFrameTest;
// RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost
// associated with content being rendered in a separate process from
@@ -26,7 +37,9 @@ class RenderWidgetHostImpl;
//
// See comments in render_widget_host_view.h about this class and its members.
class CONTENT_EXPORT RenderWidgetHostViewChildFrame
- : public RenderWidgetHostViewBase {
+ : public RenderWidgetHostViewBase,
+ public cc::SurfaceFactoryClient,
+ public base::SupportsWeakPtr<RenderWidgetHostViewChildFrame> {
dcheng 2015/05/28 22:24:55 Prefer to embed a WeakPtrFactory rather than inher
kenrb 2015/05/29 19:29:36 Done.
public:
explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget);
~RenderWidgetHostViewChildFrame() override;
@@ -133,8 +146,14 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate) override;
+ // cc::SurfaceFactoryClient implementation.
+ void ReturnResources(const cc::ReturnedResourceArray& resources) override;
+
protected:
friend class RenderWidgetHostView;
+ friend class RenderWidgetHostViewChildFrameTest;
+
+ void SurfaceDrawn(uint32 output_surface_id, cc::SurfaceDrawStatus drawn);
// The last scroll offset of the view.
gfx::Vector2dF last_scroll_offset_;
@@ -143,6 +162,20 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
// The model object.
RenderWidgetHostImpl* host_;
+ // Flag determining whether we render into a compositing surface.
nasko 2015/05/28 20:42:36 nit: Is it Surface? You used capitalized version r
kenrb 2015/05/29 19:29:36 Done.
+ bool use_surfaces_;
+
+ // Surface-related state.
+ scoped_ptr<cc::SurfaceIdAllocator> id_allocator_;
+ scoped_ptr<cc::SurfaceFactory> surface_factory_;
+ cc::SurfaceId surface_id_;
+ uint32 next_surface_sequence_;
+ uint32 last_output_surface_id_;
+ gfx::Size current_surface_size_;
+ float current_surface_scale_factor_;
+ uint32 ack_pending_count_;
nasko 2015/05/28 20:42:36 nit: All other variables have some sort of "surfac
kenrb 2015/05/29 19:29:36 It is tracking expected CompositorFrameAcks. It is
+ cc::ReturnedResourceArray surface_returned_resources_;
+
// frame_connector_ provides a platform abstraction. Messages
// sent through it are routed to the embedding renderer process.
CrossProcessFrameConnector* frame_connector_;

Powered by Google App Engine
This is Rietveld 408576698