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 abc113929c2b8f9cf38e7b7c8bca0e7330b3ffd8..5d89126f092c233ff1ba2f42617864034936bfb0 100644 |
--- a/content/renderer/gpu/render_widget_compositor.cc |
+++ b/content/renderer/gpu/render_widget_compositor.cc |
@@ -178,6 +178,14 @@ gfx::Size CalculateDefaultTileSize(RenderWidget* widget) { |
return gfx::Size(default_tile_size, default_tile_size); |
} |
+size_t GetMaxBytesPerCopyOperation() { |
vmpstr
2015/06/04 01:26:44
nit: int this too please
reveman
2015/06/04 02:16:30
Done.
|
+ const int kMegabyte = 1024 * 1024; |
+ |
+ // 4MiB is the size of 4 512x512 tiles, which has proven to be a good |
+ // default batch size for copy operations. |
+ return kMegabyte * 4; |
+} |
+ |
// Check cc::TopControlsState, and blink::WebTopControlsState |
// are kept in sync. |
static_assert(int(blink::WebTopControlsBoth) == int(cc::BOTH), |
@@ -456,6 +464,8 @@ void RenderWidgetCompositor::Initialize() { |
settings.use_external_begin_frame_source = false; |
} |
+ settings.max_bytes_per_copy_operation = GetMaxBytesPerCopyOperation(); |
+ |
scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = |
compositor_deps_->GetCompositorImplThreadTaskRunner(); |
scoped_refptr<base::SingleThreadTaskRunner> |