| 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)) | |
| 517 settings.use_external_begin_frame_source = false; | 516 settings.use_external_begin_frame_source = false; |
| 518 | 517 |
| 519 return settings; | 518 return settings; |
| 520 } | 519 } |
| 521 | 520 |
| 522 // static | 521 // static |
| 523 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy( | 522 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy( |
| 524 const cc::ManagedMemoryPolicy& policy) { | 523 const cc::ManagedMemoryPolicy& policy) { |
| 525 cc::ManagedMemoryPolicy actual = policy; | 524 cc::ManagedMemoryPolicy actual = policy; |
| 526 actual.bytes_limit_when_visible = 0; | 525 actual.bytes_limit_when_visible = 0; |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 | 1152 |
| 1154 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); | 1153 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); |
| 1155 } | 1154 } |
| 1156 | 1155 |
| 1157 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1156 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
| 1158 float device_scale) { | 1157 float device_scale) { |
| 1159 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); | 1158 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); |
| 1160 } | 1159 } |
| 1161 | 1160 |
| 1162 } // namespace content | 1161 } // namespace content |
| OLD | NEW |