| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 // Use 1/4th of staging buffers on low-end devices. | 505 // Use 1/4th of staging buffers on low-end devices. |
| 506 if (base::SysInfo::IsLowEndDevice()) | 506 if (base::SysInfo::IsLowEndDevice()) |
| 507 settings.max_staging_buffer_usage_in_bytes /= 4; | 507 settings.max_staging_buffer_usage_in_bytes /= 4; |
| 508 | 508 |
| 509 cc::ManagedMemoryPolicy current = settings.memory_policy_; | 509 cc::ManagedMemoryPolicy current = settings.memory_policy_; |
| 510 settings.memory_policy_ = GetGpuMemoryPolicy(current); | 510 settings.memory_policy_ = GetGpuMemoryPolicy(current); |
| 511 | 511 |
| 512 settings.use_cached_picture_raster = | 512 settings.use_cached_picture_raster = |
| 513 !cmd.HasSwitch(cc::switches::kDisableCachedPictureRaster); | 513 !cmd.HasSwitch(cc::switches::kDisableCachedPictureRaster); |
| 514 | 514 |
| 515 if (cmd.HasSwitch(switches::kUseRemoteCompositing)) | 515 if (cmd.HasSwitch(switches::kUseRemoteCompositing) || |
| 516 cmd.HasSwitch(switches::kIsRunningInMash)) |
| 516 settings.use_external_begin_frame_source = false; | 517 settings.use_external_begin_frame_source = false; |
| 517 | 518 |
| 518 return settings; | 519 return settings; |
| 519 } | 520 } |
| 520 | 521 |
| 521 // static | 522 // static |
| 522 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy( | 523 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy( |
| 523 const cc::ManagedMemoryPolicy& policy) { | 524 const cc::ManagedMemoryPolicy& policy) { |
| 524 cc::ManagedMemoryPolicy actual = policy; | 525 cc::ManagedMemoryPolicy actual = policy; |
| 525 actual.bytes_limit_when_visible = 0; | 526 actual.bytes_limit_when_visible = 0; |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 | 1146 |
| 1146 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); | 1147 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); |
| 1147 } | 1148 } |
| 1148 | 1149 |
| 1149 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1150 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
| 1150 float device_scale) { | 1151 float device_scale) { |
| 1151 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1152 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
| 1152 } | 1153 } |
| 1153 | 1154 |
| 1154 } // namespace content | 1155 } // namespace content |
| OLD | NEW |