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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2726263003: cc::ResourcePool - Re-use larger resources for smaller requests (Closed)
Patch Set: fix compile Created 3 years, 7 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 settings.max_staging_buffer_usage_in_bytes = 32 * 1024 * 1024; // 32MB 536 settings.max_staging_buffer_usage_in_bytes = 32 * 1024 * 1024; // 32MB
537 // Use 1/4th of staging buffers on low-end devices. 537 // Use 1/4th of staging buffers on low-end devices.
538 if (base::SysInfo::IsLowEndDevice()) 538 if (base::SysInfo::IsLowEndDevice())
539 settings.max_staging_buffer_usage_in_bytes /= 4; 539 settings.max_staging_buffer_usage_in_bytes /= 4;
540 540
541 cc::ManagedMemoryPolicy defaults = settings.gpu_memory_policy; 541 cc::ManagedMemoryPolicy defaults = settings.gpu_memory_policy;
542 settings.gpu_memory_policy = GetGpuMemoryPolicy(defaults); 542 settings.gpu_memory_policy = GetGpuMemoryPolicy(defaults);
543 settings.software_memory_policy.num_resources_limit = 543 settings.software_memory_policy.num_resources_limit =
544 base::SharedMemory::GetHandleLimit() / 3; 544 base::SharedMemory::GetHandleLimit() / 3;
545 545
546 settings.disallow_non_exact_resource_reuse =
547 cmd.HasSwitch(cc::switches::kDisallowNonExactResourceReuse);
548 settings.renderer_settings.disallow_non_exact_resource_reuse =
549 settings.disallow_non_exact_resource_reuse;
550
546 return settings; 551 return settings;
547 } 552 }
548 553
549 // static 554 // static
550 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy( 555 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy(
551 const cc::ManagedMemoryPolicy& default_policy) { 556 const cc::ManagedMemoryPolicy& default_policy) {
552 cc::ManagedMemoryPolicy actual = default_policy; 557 cc::ManagedMemoryPolicy actual = default_policy;
553 actual.bytes_limit_when_visible = 0; 558 actual.bytes_limit_when_visible = 0;
554 559
555 // If the value was overridden on the command line, use the specified value. 560 // If the value was overridden on the command line, use the specified value.
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 const cc::LocalSurfaceId& local_surface_id) { 1213 const cc::LocalSurfaceId& local_surface_id) {
1209 layer_tree_host_->SetLocalSurfaceId(local_surface_id); 1214 layer_tree_host_->SetLocalSurfaceId(local_surface_id);
1210 } 1215 }
1211 1216
1212 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) { 1217 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) {
1213 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>( 1218 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>(
1214 std::move(callback), base::ThreadTaskRunnerHandle::Get())); 1219 std::move(callback), base::ThreadTaskRunnerHandle::Get()));
1215 } 1220 }
1216 1221
1217 } // namespace content 1222 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/shell/app/shell_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698