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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 738983002: Move output surface fallback from cc to embedders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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/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 b4c72a0077a0519a33d80f93afcd0cf50ba991ae..53ed327b8f0d91ae5e1706f03eae8d61c43fb2cf 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -528,7 +528,13 @@ void CompositorImpl::Layout() {
ignore_schedule_composite_ = false;
}
-void CompositorImpl::RequestNewOutputSurface(bool fallback) {
+void CompositorImpl::RequestNewOutputSurface() {
+ // SetVisible(false) can happen (destroying the host_) between when this
+ // function is posted and when it is handled. An output surface will get
+ // re-requested when the host is recreated.
+ if (!host_.get())
+ return;
+
BrowserGpuChannelHostFactory* factory =
BrowserGpuChannelHostFactory::instance();
if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) {
@@ -537,15 +543,18 @@ void CompositorImpl::RequestNewOutputSurface(bool fallback) {
factory->EstablishGpuChannel(
cause,
base::Bind(&CompositorImpl::CreateOutputSurface,
- weak_factory_.GetWeakPtr(),
- fallback));
+ weak_factory_.GetWeakPtr()));
return;
}
- CreateOutputSurface(fallback);
+ CreateOutputSurface();
+}
+
+void CompositorImpl::DidFailToInitializeOutputSurface() {
+ RequestNewOutputSurface();
}
-void CompositorImpl::CreateOutputSurface(bool fallback) {
+void CompositorImpl::CreateOutputSurface() {
blink::WebGraphicsContext3D::Attributes attrs;
attrs.shareResources = true;
attrs.noAutomaticFlushes = true;
@@ -565,7 +574,9 @@ void CompositorImpl::CreateOutputSurface(bool fallback) {
}
if (!context_provider.get()) {
LOG(ERROR) << "Failed to create 3D context for compositor.";
- host_->SetOutputSurface(scoped_ptr<cc::OutputSurface>());
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE, base::Bind(&CompositorImpl::RequestNewOutputSurface,
+ weak_factory_.GetWeakPtr()));
return;
}
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.h ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698