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

Unified Diff: content/renderer/render_widget.cc

Issue 15875009: Refactor SynchronousCompositor out of SynchronousCompositorOutputSurface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rebase mistake Created 7 years, 7 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 19a035d4e2e7f14196da9a5bdb54dd713c178e16..6082fd9656fb6094ae0db3391f40181af89858d8 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -62,6 +62,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
@@ -585,9 +586,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
@@ -630,6 +630,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()) {
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698