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

Unified Diff: content/renderer/render_widget.cc

Issue 1395923003: Share context creation logic with sync compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 2 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/android/synchronous_compositor_factory.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 081f0832fcadeb0e234088a01822491d8835df50..1d4293daa3c4da334bfc72bc3ed21a1ea4e676f2 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -969,14 +969,6 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
// never get a request for a cc::OutputSurface.
DCHECK(!compositor_never_visible_);
-#if defined(OS_ANDROID)
- if (SynchronousCompositorFactory* factory =
- SynchronousCompositorFactory::GetInstance()) {
- return factory->CreateOutputSurface(routing_id(),
- frame_swap_message_queue_);
- }
-#endif
-
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
bool use_software = fallback;
@@ -998,6 +990,15 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
// Cause the compositor to wait and try again.
return nullptr;
}
+
+#if defined(OS_ANDROID)
+ if (SynchronousCompositorFactory* factory =
+ SynchronousCompositorFactory::GetInstance()) {
+ return factory->CreateOutputSurface(
+ routing_id(), frame_swap_message_queue_, context_provider,
+ worker_context_provider);
+ }
+#endif
}
uint32 output_surface_id = next_output_surface_id_++;
@@ -2325,12 +2326,17 @@ RenderWidget::CreateGraphicsContext3D(bool compositor) {
bool lose_context_when_out_of_memory = true;
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
#if defined(OS_ANDROID)
+ bool using_synchronous_compositing =
+ SynchronousCompositorFactory::GetInstance();
// If we raster too fast we become upload bound, and pending
// uploads consume memory. For maximum upload throughput, we would
// want to allow for upload_throughput * pipeline_time of pending
// uploads, after which we are just wasting memory. Since we don't
// know our upload throughput yet, this just caps our memory usage.
- size_t divider = 1;
+ // Synchronous compositor uses half because synchronous compositor
+ // pipeline is only one frame deep. But twice of half for low end
+ // because 16bit texture is not supported.
+ size_t divider = using_synchronous_compositing ? 2 : 1;
if (base::SysInfo::IsLowEndDevice())
divider = 6;
// For reference Nexus10 can upload 1MB in about 2.5ms.
« no previous file with comments | « content/renderer/android/synchronous_compositor_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698