OLD | NEW |
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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 settings.create_low_res_tiling = false; | 463 settings.create_low_res_tiling = false; |
464 if (cmd->HasSwitch(cc::switches::kEnableBeginFrameScheduling)) | 464 if (cmd->HasSwitch(cc::switches::kEnableBeginFrameScheduling)) |
465 settings.use_external_begin_frame_source = true; | 465 settings.use_external_begin_frame_source = true; |
466 | 466 |
467 if (widget_->for_oopif()) { | 467 if (widget_->for_oopif()) { |
468 // TODO(simonhong): Apply BeginFrame scheduling for OOPIF. | 468 // TODO(simonhong): Apply BeginFrame scheduling for OOPIF. |
469 // See crbug.com/471411. | 469 // See crbug.com/471411. |
470 settings.use_external_begin_frame_source = false; | 470 settings.use_external_begin_frame_source = false; |
471 } | 471 } |
472 | 472 |
| 473 settings.max_staging_buffers = 32; |
| 474 // Use 1/4th of staging buffers on low-end devices. |
| 475 if (base::SysInfo::IsLowEndDevice()) |
| 476 settings.max_staging_buffers /= 4; |
| 477 |
473 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = | 478 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = |
474 compositor_deps_->GetCompositorImplThreadTaskRunner(); | 479 compositor_deps_->GetCompositorImplThreadTaskRunner(); |
475 scoped_refptr<base::SingleThreadTaskRunner> | 480 scoped_refptr<base::SingleThreadTaskRunner> |
476 main_thread_compositor_task_runner = | 481 main_thread_compositor_task_runner = |
477 compositor_deps_->GetCompositorMainThreadTaskRunner(); | 482 compositor_deps_->GetCompositorMainThreadTaskRunner(); |
478 cc::SharedBitmapManager* shared_bitmap_manager = | 483 cc::SharedBitmapManager* shared_bitmap_manager = |
479 compositor_deps_->GetSharedBitmapManager(); | 484 compositor_deps_->GetSharedBitmapManager(); |
480 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = | 485 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = |
481 compositor_deps_->GetGpuMemoryBufferManager(); | 486 compositor_deps_->GetGpuMemoryBufferManager(); |
482 cc::TaskGraphRunner* task_graph_runner = | 487 cc::TaskGraphRunner* task_graph_runner = |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 return; | 1050 return; |
1046 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 1051 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
1047 } | 1052 } |
1048 | 1053 |
1049 void RenderWidgetCompositor::SetSurfaceIdNamespace( | 1054 void RenderWidgetCompositor::SetSurfaceIdNamespace( |
1050 uint32_t surface_id_namespace) { | 1055 uint32_t surface_id_namespace) { |
1051 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); | 1056 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); |
1052 } | 1057 } |
1053 | 1058 |
1054 } // namespace content | 1059 } // namespace content |
OLD | NEW |