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

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

Issue 348093004: Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/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 2be0077a8f15d892d4b4dd1b49d124a8391c8ede..008a1368ba16204240abeea5f0ac9759503d2a02 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -281,10 +281,9 @@ void CompositorImpl::Composite(CompositingTrigger trigger) {
if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) {
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;
}
@@ -331,10 +330,6 @@ void CompositorImpl::Composite(CompositingTrigger trigger) {
root_window_->RequestVSyncUpdate();
}
-void CompositorImpl::OnGpuChannelEstablished() {
- ScheduleComposite();
-}
-
UIResourceProvider& CompositorImpl::GetUIResourceProvider() {
return ui_resource_provider_;
}
@@ -500,8 +495,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;
@@ -521,11 +532,11 @@ 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>());
no sievers 2014/06/23 19:53:58 either return here or if-else
enne (OOO) 2014/06/24 22:20:06 Oops! Good catch. Done.
}
- return scoped_ptr<cc::OutputSurface>(
- new OutputSurfaceWithoutParent(context_provider));
+ host_->SetOutputSurface(scoped_ptr<cc::OutputSurface>(
+ new OutputSurfaceWithoutParent(context_provider)));
}
void CompositorImpl::OnLostResources() {

Powered by Google App Engine
This is Rietveld 408576698