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

Side by Side 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, 6 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 171 }
172 #elif defined(OS_CHROMEOS) 172 #elif defined(OS_CHROMEOS)
173 // Use 512 for high DPI (dsf=2.0f) devices. 173 // Use 512 for high DPI (dsf=2.0f) devices.
174 if (widget->screen_info().deviceScaleFactor >= 2.0f) 174 if (widget->screen_info().deviceScaleFactor >= 2.0f)
175 default_tile_size = 512; 175 default_tile_size = 512;
176 #endif 176 #endif
177 177
178 return gfx::Size(default_tile_size, default_tile_size); 178 return gfx::Size(default_tile_size, default_tile_size);
179 } 179 }
180 180
181 size_t GetMaxBytesPerCopyOperation() {
vmpstr 2015/06/04 01:26:44 nit: int this too please
reveman 2015/06/04 02:16:30 Done.
182 const int kMegabyte = 1024 * 1024;
183
184 // 4MiB is the size of 4 512x512 tiles, which has proven to be a good
185 // default batch size for copy operations.
186 return kMegabyte * 4;
187 }
188
181 // Check cc::TopControlsState, and blink::WebTopControlsState 189 // Check cc::TopControlsState, and blink::WebTopControlsState
182 // are kept in sync. 190 // are kept in sync.
183 static_assert(int(blink::WebTopControlsBoth) == int(cc::BOTH), 191 static_assert(int(blink::WebTopControlsBoth) == int(cc::BOTH),
184 "mismatching enums: BOTH"); 192 "mismatching enums: BOTH");
185 static_assert(int(blink::WebTopControlsHidden) == int(cc::HIDDEN), 193 static_assert(int(blink::WebTopControlsHidden) == int(cc::HIDDEN),
186 "mismatching enums: HIDDEN"); 194 "mismatching enums: HIDDEN");
187 static_assert(int(blink::WebTopControlsShown) == int(cc::SHOWN), 195 static_assert(int(blink::WebTopControlsShown) == int(cc::SHOWN),
188 "mismatching enums: SHOWN"); 196 "mismatching enums: SHOWN");
189 197
190 static cc::TopControlsState ConvertTopControlsState( 198 static cc::TopControlsState ConvertTopControlsState(
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 settings.create_low_res_tiling = false; 457 settings.create_low_res_tiling = false;
450 if (cmd->HasSwitch(cc::switches::kEnableBeginFrameScheduling)) 458 if (cmd->HasSwitch(cc::switches::kEnableBeginFrameScheduling))
451 settings.use_external_begin_frame_source = true; 459 settings.use_external_begin_frame_source = true;
452 460
453 if (widget_->for_oopif()) { 461 if (widget_->for_oopif()) {
454 // TODO(simonhong): Apply BeginFrame scheduling for OOPIF. 462 // TODO(simonhong): Apply BeginFrame scheduling for OOPIF.
455 // See crbug.com/471411. 463 // See crbug.com/471411.
456 settings.use_external_begin_frame_source = false; 464 settings.use_external_begin_frame_source = false;
457 } 465 }
458 466
467 settings.max_bytes_per_copy_operation = GetMaxBytesPerCopyOperation();
468
459 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = 469 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner =
460 compositor_deps_->GetCompositorImplThreadTaskRunner(); 470 compositor_deps_->GetCompositorImplThreadTaskRunner();
461 scoped_refptr<base::SingleThreadTaskRunner> 471 scoped_refptr<base::SingleThreadTaskRunner>
462 main_thread_compositor_task_runner = 472 main_thread_compositor_task_runner =
463 compositor_deps_->GetCompositorMainThreadTaskRunner(); 473 compositor_deps_->GetCompositorMainThreadTaskRunner();
464 cc::SharedBitmapManager* shared_bitmap_manager = 474 cc::SharedBitmapManager* shared_bitmap_manager =
465 compositor_deps_->GetSharedBitmapManager(); 475 compositor_deps_->GetSharedBitmapManager();
466 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = 476 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager =
467 compositor_deps_->GetGpuMemoryBufferManager(); 477 compositor_deps_->GetGpuMemoryBufferManager();
468 cc::TaskGraphRunner* task_graph_runner = 478 cc::TaskGraphRunner* task_graph_runner =
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 return; 973 return;
964 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 974 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
965 } 975 }
966 976
967 void RenderWidgetCompositor::SetSurfaceIdNamespace( 977 void RenderWidgetCompositor::SetSurfaceIdNamespace(
968 uint32_t surface_id_namespace) { 978 uint32_t surface_id_namespace) {
969 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); 979 layer_tree_host_->set_surface_id_namespace(surface_id_namespace);
970 } 980 }
971 981
972 } // namespace content 982 } // namespace content
OLDNEW
« 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