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

Unified Diff: content/renderer/render_widget.cc

Issue 19331002: Associate an id with the output surface to handle lost contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android, tests Created 7 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 61bfe829fc26c43231d390dd16bacc3aacd2482f..f604fd05668267bcbad119279ba5f04a891d061a 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -226,6 +226,7 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type,
screen_info_(screen_info),
device_scale_factor_(screen_info_.deviceScaleFactor),
is_threaded_compositing_enabled_(false),
+ next_output_surface_id_(0),
weak_ptr_factory_(this) {
if (!swapped_out)
RenderProcess::current()->AddRefProcess();
@@ -641,9 +642,11 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
}
#endif
+ uint32 output_surface_id = next_output_surface_id_++;
+
if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) {
return scoped_ptr<cc::OutputSurface>(
- new CompositorOutputSurface(routing_id(), NULL,
+ new CompositorOutputSurface(routing_id(), output_surface_id, NULL,
new CompositorSoftwareOutputDevice(), true));
}
@@ -674,15 +677,18 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
!command_line.HasSwitch(switches::kDisableDelegatedRenderer)) {
DCHECK(is_threaded_compositing_enabled_);
return scoped_ptr<cc::OutputSurface>(
- new DelegatedCompositorOutputSurface(routing_id(), context, NULL));
+ new DelegatedCompositorOutputSurface(routing_id(), output_surface_id,
+ context, NULL));
}
if (command_line.HasSwitch(cc::switches::kCompositeToMailbox)) {
DCHECK(is_threaded_compositing_enabled_);
return scoped_ptr<cc::OutputSurface>(
- new MailboxOutputSurface(routing_id(), context, NULL));
+ new MailboxOutputSurface(routing_id(), output_surface_id,
+ context, NULL));
}
return scoped_ptr<cc::OutputSurface>(
- new CompositorOutputSurface(routing_id(), context, NULL, false));
+ new CompositorOutputSurface(routing_id(), output_surface_id,
+ context, NULL, false));
}
void RenderWidget::OnViewContextSwapBuffersAborted() {
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698