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

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

Issue 1148413007: cc: Use max_bytes_per_copy_operation setting to determine one-copy flush interval. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: vmpstr Created 5 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 | « cc/raster/one_copy_tile_task_worker_pool.cc ('k') | no next file » | 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 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>
« no previous file with comments | « cc/raster/one_copy_tile_task_worker_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698