| 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 27 matching lines...) Expand all Loading... |
| 38 #include "cc/proto/compositor_message.pb.h" | 38 #include "cc/proto/compositor_message.pb.h" |
| 39 #include "cc/resources/single_release_callback.h" | 39 #include "cc/resources/single_release_callback.h" |
| 40 #include "cc/scheduler/begin_frame_source.h" | 40 #include "cc/scheduler/begin_frame_source.h" |
| 41 #include "cc/trees/latency_info_swap_promise_monitor.h" | 41 #include "cc/trees/latency_info_swap_promise_monitor.h" |
| 42 #include "cc/trees/layer_tree_host.h" | 42 #include "cc/trees/layer_tree_host.h" |
| 43 #include "cc/trees/remote_proto_channel.h" | 43 #include "cc/trees/remote_proto_channel.h" |
| 44 #include "components/scheduler/renderer/renderer_scheduler.h" | 44 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 45 #include "content/common/content_switches_internal.h" | 45 #include "content/common/content_switches_internal.h" |
| 46 #include "content/common/gpu/client/context_provider_command_buffer.h" | 46 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 47 #include "content/public/common/content_client.h" | 47 #include "content/public/common/content_client.h" |
| 48 #include "content/public/common/content_features.h" |
| 48 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
| 49 #include "content/renderer/gpu/render_widget_compositor_delegate.h" | 50 #include "content/renderer/gpu/render_widget_compositor_delegate.h" |
| 50 #include "content/renderer/input/input_handler_manager.h" | 51 #include "content/renderer/input/input_handler_manager.h" |
| 51 #include "gpu/command_buffer/client/gles2_interface.h" | 52 #include "gpu/command_buffer/client/gles2_interface.h" |
| 52 #include "gpu/command_buffer/service/gpu_switches.h" | 53 #include "gpu/command_buffer/service/gpu_switches.h" |
| 53 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" | 54 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" |
| 54 #include "third_party/WebKit/public/platform/WebCompositorMutatorClient.h" | 55 #include "third_party/WebKit/public/platform/WebCompositorMutatorClient.h" |
| 55 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" | 56 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" |
| 56 #include "third_party/WebKit/public/platform/WebSize.h" | 57 #include "third_party/WebKit/public/platform/WebSize.h" |
| 57 #include "third_party/WebKit/public/web/WebKit.h" | 58 #include "third_party/WebKit/public/web/WebKit.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 cc::ManagedMemoryPolicy current = settings.memory_policy_; | 510 cc::ManagedMemoryPolicy current = settings.memory_policy_; |
| 510 settings.memory_policy_ = GetGpuMemoryPolicy(current); | 511 settings.memory_policy_ = GetGpuMemoryPolicy(current); |
| 511 | 512 |
| 512 settings.use_cached_picture_raster = | 513 settings.use_cached_picture_raster = |
| 513 !cmd.HasSwitch(cc::switches::kDisableCachedPictureRaster); | 514 !cmd.HasSwitch(cc::switches::kDisableCachedPictureRaster); |
| 514 | 515 |
| 515 if (cmd.HasSwitch(switches::kUseRemoteCompositing) || | 516 if (cmd.HasSwitch(switches::kUseRemoteCompositing) || |
| 516 cmd.HasSwitch(switches::kIsRunningInMash)) | 517 cmd.HasSwitch(switches::kIsRunningInMash)) |
| 517 settings.use_external_begin_frame_source = false; | 518 settings.use_external_begin_frame_source = false; |
| 518 | 519 |
| 520 // crbug.com/602486 |
| 521 settings.swap_ack_watchdog_enabled = |
| 522 base::FeatureList::IsEnabled(features::kSwapAckWatchdog); |
| 523 |
| 519 return settings; | 524 return settings; |
| 520 } | 525 } |
| 521 | 526 |
| 522 // static | 527 // static |
| 523 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy( | 528 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy( |
| 524 const cc::ManagedMemoryPolicy& policy) { | 529 const cc::ManagedMemoryPolicy& policy) { |
| 525 cc::ManagedMemoryPolicy actual = policy; | 530 cc::ManagedMemoryPolicy actual = policy; |
| 526 actual.bytes_limit_when_visible = 0; | 531 actual.bytes_limit_when_visible = 0; |
| 527 | 532 |
| 528 // If the value was overridden on the command line, use the specified value. | 533 // If the value was overridden on the command line, use the specified value. |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 | 1151 |
| 1147 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); | 1152 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); |
| 1148 } | 1153 } |
| 1149 | 1154 |
| 1150 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1155 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
| 1151 float device_scale) { | 1156 float device_scale) { |
| 1152 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1157 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
| 1153 } | 1158 } |
| 1154 | 1159 |
| 1155 } // namespace content | 1160 } // namespace content |
| OLD | NEW |