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

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

Issue 606113003: Revert of Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 bc2709c3eef96c96b196d7012befbf414dd5a6a1..31a5d2d018d699b9b9d1c038a080da6d376d326c 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -301,9 +301,10 @@
if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) {
CauseForGpuLaunch cause =
CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE;
- factory->EstablishGpuChannel(cause,
- base::Bind(&CompositorImpl::ScheduleComposite,
- weak_factory_.GetWeakPtr()));
+ factory->EstablishGpuChannel(
+ cause,
+ base::Bind(&CompositorImpl::OnGpuChannelEstablished,
+ weak_factory_.GetWeakPtr()));
return;
}
@@ -348,6 +349,10 @@
// Need to track vsync to avoid compositing more than once per frame.
root_window_->RequestVSyncUpdate();
+}
+
+void CompositorImpl::OnGpuChannelEstablished() {
+ ScheduleComposite();
}
UIResourceProvider& CompositorImpl::GetUIResourceProvider() {
@@ -543,24 +548,8 @@
ignore_schedule_composite_ = false;
}
-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) {
+scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface(
+ bool fallback) {
blink::WebGraphicsContext3D::Attributes attrs;
attrs.shareResources = true;
attrs.noAutomaticFlushes = true;
@@ -580,13 +569,11 @@
}
if (!context_provider.get()) {
LOG(ERROR) << "Failed to create 3D context for compositor.";
- host_->SetOutputSurface(scoped_ptr<cc::OutputSurface>());
- return;
- }
-
- host_->SetOutputSurface(
- scoped_ptr<cc::OutputSurface>(new OutputSurfaceWithoutParent(
- context_provider, weak_factory_.GetWeakPtr())));
+ return scoped_ptr<cc::OutputSurface>();
+ }
+
+ return scoped_ptr<cc::OutputSurface>(new OutputSurfaceWithoutParent(
+ context_provider, weak_factory_.GetWeakPtr()));
}
void CompositorImpl::PopulateGpuCapabilities(
« 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