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

Unified Diff: content/renderer/render_widget.cc

Issue 16119003: Move SynchronousCompositor into content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 34b4ae4e4a823f6332d8bef4e73764d833cd0746..b2ca371696ccb2a228cbf0308fa111589c342f5e 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -19,12 +19,12 @@
#include "cc/base/thread_impl.h"
#include "cc/output/output_surface.h"
#include "cc/trees/layer_tree_host.h"
+// #include "content/browser/android/in_process/synchronous_compositor_impl.h"
#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "content/common/input_messages.h"
#include "content/common/swapped_out_messages.h"
#include "content/common/view_messages.h"
#include "content/public/common/content_switches.h"
-#include "content/renderer/android/synchronous_compositor_impl.h"
#include "content/renderer/gpu/compositor_output_surface.h"
#include "content/renderer/gpu/compositor_software_output_device.h"
#include "content/renderer/gpu/input_handler_manager.h"
@@ -63,7 +63,7 @@
#include "webkit/renderer/compositor_bindings/web_rendering_stats_impl.h"
#if defined(OS_ANDROID)
-#include "content/renderer/android/synchronous_compositor_output_surface.h"
+#include "content/renderer/android/synchronous_compositor_factory.h"
#endif
#if defined(OS_POSIX)
@@ -306,10 +306,7 @@ bool RenderWidget::AllowPartialSwap() const {
bool RenderWidget::UsingSynchronousRendererCompositor() const {
#if defined(OS_ANDROID)
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableSynchronousRendererCompositor)) {
- return true;
- }
+ return SynchronousCompositorFactory::HasInstance();
#endif
return false;
}
@@ -587,9 +584,12 @@ bool RenderWidget::ForceCompositingModeEnabled() {
scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (GetSynchronousCompositor()) {
- return GetSynchronousCompositor()->CreateOutputSurface();
+#if defined(OS_ANDROID)
+ if (SynchronousCompositorFactory::HasInstance()) {
+ return SynchronousCompositorFactory::GetInstance()->CreateOutputSurface(
+ routing_id());
}
+#endif
if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) {
return scoped_ptr<cc::OutputSurface>(
@@ -630,18 +630,6 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
new CompositorOutputSurface(routing_id(), context, NULL));
}
-SynchronousCompositorImpl* RenderWidget::GetSynchronousCompositor() {
-#if defined(OS_ANDROID)
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kEnableSynchronousRendererCompositor)) {
- synchronous_compositor_.reset(new SynchronousCompositorImpl(routing_id()));
- }
- return synchronous_compositor_.get();
-#else
- return NULL;
-#endif
-}
-
void RenderWidget::OnViewContextSwapBuffersAborted() {
TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersAborted");
while (!updates_pending_swap_.empty()) {

Powered by Google App Engine
This is Rietveld 408576698