| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index 593b43b3c114da7cc14be112db161e2b7d28bd26..d595c0afa0c25711428990c4851cebec362d6612 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -61,6 +61,7 @@
|
| #include "webkit/renderer/compositor_bindings/web_rendering_stats_impl.h"
|
|
|
| #if defined(OS_ANDROID)
|
| +#include "content/renderer/android/synchronous_compositor_impl.h"
|
| #include "content/renderer/android/synchronous_compositor_output_surface.h"
|
| #endif
|
|
|
| @@ -586,9 +587,8 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
|
| const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
|
|
| #if defined(OS_ANDROID)
|
| - if (command_line.HasSwitch(switches::kEnableSynchronousRendererCompositor)) {
|
| - return scoped_ptr<cc::OutputSurface>(
|
| - new SynchronousCompositorOutputSurface(routing_id()));
|
| + if (GetSynchronousCompositor()) {
|
| + return GetSynchronousCompositor()->CreateOutputSurface();
|
| }
|
| #endif
|
|
|
| @@ -631,6 +631,17 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
|
| new CompositorOutputSurface(routing_id(), context, NULL));
|
| }
|
|
|
| +#if defined(OS_ANDROID)
|
| +SynchronousCompositorImpl* RenderWidget::GetSynchronousCompositor() {
|
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| + if (!synchronous_compositor_ &&
|
| + command_line.HasSwitch(switches::kEnableSynchronousRendererCompositor)) {
|
| + synchronous_compositor_.reset(new SynchronousCompositorImpl(routing_id()));
|
| + }
|
| + return synchronous_compositor_.get();
|
| +}
|
| +#endif
|
| +
|
| void RenderWidget::OnViewContextSwapBuffersAborted() {
|
| TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersAborted");
|
| while (!updates_pending_swap_.empty()) {
|
|
|