Index: content/browser/renderer_host/compositor_impl_android.cc |
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc |
index 31a5d2d018d699b9b9d1c038a080da6d376d326c..bc2709c3eef96c96b196d7012befbf414dd5a6a1 100644 |
--- a/content/browser/renderer_host/compositor_impl_android.cc |
+++ b/content/browser/renderer_host/compositor_impl_android.cc |
@@ -301,10 +301,9 @@ void CompositorImpl::Composite(CompositingTrigger trigger) { |
if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) { |
no sievers
2014/09/25 17:59:29
Can 301-308 actually be removed now that LTH::Comp
enne (OOO)
2014/09/25 19:05:05
If you don't mind me punting, I was going to remov
|
CauseForGpuLaunch cause = |
CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
- factory->EstablishGpuChannel( |
- cause, |
- base::Bind(&CompositorImpl::OnGpuChannelEstablished, |
- weak_factory_.GetWeakPtr())); |
+ factory->EstablishGpuChannel(cause, |
+ base::Bind(&CompositorImpl::ScheduleComposite, |
+ weak_factory_.GetWeakPtr())); |
return; |
} |
@@ -351,10 +350,6 @@ void CompositorImpl::Composite(CompositingTrigger trigger) { |
root_window_->RequestVSyncUpdate(); |
} |
-void CompositorImpl::OnGpuChannelEstablished() { |
- ScheduleComposite(); |
-} |
- |
UIResourceProvider& CompositorImpl::GetUIResourceProvider() { |
return ui_resource_provider_; |
} |
@@ -548,8 +543,24 @@ void CompositorImpl::Layout() { |
ignore_schedule_composite_ = false; |
} |
-scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( |
- bool fallback) { |
+void CompositorImpl::RequestNewOutputSurface(bool fallback) { |
+ BrowserGpuChannelHostFactory* factory = |
+ BrowserGpuChannelHostFactory::instance(); |
+ if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) { |
+ CauseForGpuLaunch cause = |
+ CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
+ factory->EstablishGpuChannel( |
+ cause, |
+ base::Bind(&CompositorImpl::CreateOutputSurface, |
+ weak_factory_.GetWeakPtr(), |
+ fallback)); |
+ return; |
+ } |
+ |
+ CreateOutputSurface(fallback); |
+} |
+ |
+void CompositorImpl::CreateOutputSurface(bool fallback) { |
blink::WebGraphicsContext3D::Attributes attrs; |
attrs.shareResources = true; |
attrs.noAutomaticFlushes = true; |
@@ -569,11 +580,13 @@ scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( |
} |
if (!context_provider.get()) { |
LOG(ERROR) << "Failed to create 3D context for compositor."; |
- return scoped_ptr<cc::OutputSurface>(); |
+ host_->SetOutputSurface(scoped_ptr<cc::OutputSurface>()); |
+ return; |
} |
- return scoped_ptr<cc::OutputSurface>(new OutputSurfaceWithoutParent( |
- context_provider, weak_factory_.GetWeakPtr())); |
+ host_->SetOutputSurface( |
+ scoped_ptr<cc::OutputSurface>(new OutputSurfaceWithoutParent( |
+ context_provider, weak_factory_.GetWeakPtr()))); |
} |
void CompositorImpl::PopulateGpuCapabilities( |