Stop disabling force_compositing_mode for background RenderViews.
When a RenderView's WebContents are a VIEW_TYPE_BACKGROUND_CONTENTS or
a VIEW_TYPE_EXTENSION_BACKGROUND_PAGE, the RenderView is in the
background and never visible.
Currently we disable force_compositing_mode to prevent allocating a
GPU context for the view. Since force_compositing_mode is the standard
and we are deleting other code paths, we should stop trying to disable
the setting.
Instead, add a new parameter to the ViewMsg_New IPC for |background|,
and for a RenderView that |is_background|, when the RenderWidget makes
an OutputSurface for the compositor, it creates a new NullOutputSurface
which declares itself as a delegated compositor without a GPU context.
This puts the compositor into a similar state to software compositing,
but since the renderer never presents frames, the OutputSurface
provides no way of getting frames to the browser process.
[email protected], [email protected]
BUG=362165
Review URL: https://codereview.chromium.org/233093006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264075 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 13574d0..3ab88d25 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -159,6 +159,9 @@
virtual void didHandleGestureEvent(const blink::WebGestureEvent& event,
bool event_cancelled);
+ // Begins the compositor's scheduler to start producing frames.
+ void StartCompositor();
+
// Called when a plugin is moved. These events are queued up and sent with
// the next paint or scroll message to the host.
void SchedulePluginMove(const WebPluginGeometry& move);
@@ -275,7 +278,8 @@
RenderWidget(blink::WebPopupType popup_type,
const blink::WebScreenInfo& screen_info,
bool swapped_out,
- bool hidden);
+ bool hidden,
+ bool never_visible);
virtual ~RenderWidget();
@@ -617,6 +621,9 @@
// Indicates that we shouldn't bother generated paint events.
bool is_hidden_;
+ // Indicates that we are never visible, so never produce graphical output.
+ bool never_visible_;
+
// Indicates that we are in fullscreen mode.
bool is_fullscreen_;