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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 619843002: cc: Make separate interface for BeginFrame ipc from OutputSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/gpu/compositor_output_surface.cc ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 6d0768bc43578b68ce32c51fe9ac1db53d66e3bb..35601d6950f67c2c2d943d3ecb345b0fd200add1 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -33,6 +33,7 @@
#include "content/common/content_switches_internal.h"
#include "content/common/gpu/client/context_provider_command_buffer.h"
#include "content/public/common/content_switches.h"
+#include "content/renderer/gpu/compositor_external_begin_frame_source.h"
#include "content/renderer/input/input_handler_manager.h"
#include "content/renderer/render_thread_impl.h"
#include "gpu/command_buffer/client/gles2_interface.h"
@@ -534,6 +535,21 @@ void RenderWidgetCompositor::Initialize(cc::LayerTreeSettings settings) {
main_thread_compositor_task_runner =
render_thread->main_thread_compositor_task_runner();
}
+ scoped_ptr<cc::BeginFrameSource> external_begin_frame_source;
+#if defined(OS_ANDROID)
+ if (SynchronousCompositorFactory* factory =
+ SynchronousCompositorFactory::GetInstance()) {
+ DCHECK(settings.begin_frame_scheduling_enabled);
+ external_begin_frame_source =
+ factory->CreateExternalBeginFrameSource(widget_->routing_id());
+ }
+#endif
+ if (render_thread &&
+ !external_begin_frame_source.get() &&
+ settings.begin_frame_scheduling_enabled) {
+ external_begin_frame_source.reset(new CompositorExternalBeginFrameSource(
+ widget_->routing_id()));
+ }
if (compositor_message_loop_proxy.get()) {
layer_tree_host_ =
cc::LayerTreeHost::CreateThreaded(this,
@@ -541,15 +557,17 @@ void RenderWidgetCompositor::Initialize(cc::LayerTreeSettings settings) {
gpu_memory_buffer_manager,
settings,
main_thread_compositor_task_runner,
- compositor_message_loop_proxy);
+ compositor_message_loop_proxy,
+ external_begin_frame_source.Pass());
} else {
layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded(
- this,
- this,
- shared_bitmap_manager,
- gpu_memory_buffer_manager,
- settings,
- main_thread_compositor_task_runner);
+ this,
+ this,
+ shared_bitmap_manager,
+ gpu_memory_buffer_manager,
+ settings,
+ main_thread_compositor_task_runner,
+ external_begin_frame_source.Pass());
}
DCHECK(layer_tree_host_);
}
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.cc ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698