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

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

Issue 357423002: Reduce resource limit with software compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/compositor_output_surface.h" 5 #include "content/renderer/gpu/compositor_output_surface.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 output_surface_filter_->AddRoute( 100 output_surface_filter_->AddRoute(
101 routing_id_, 101 routing_id_,
102 base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived, 102 base::Bind(&CompositorOutputSurfaceProxy::OnMessageReceived,
103 output_surface_proxy_)); 103 output_surface_proxy_));
104 104
105 if (!context_provider()) { 105 if (!context_provider()) {
106 // Without a GPU context, the memory policy otherwise wouldn't be set. 106 // Without a GPU context, the memory policy otherwise wouldn't be set.
107 client->SetMemoryPolicy(cc::ManagedMemoryPolicy( 107 client->SetMemoryPolicy(cc::ManagedMemoryPolicy(
108 128 * 1024 * 1024, 108 128 * 1024 * 1024,
109 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE, 109 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE,
110 cc::ManagedMemoryPolicy::kDefaultNumResourcesLimit)); 110 base::SharedMemory::GetHandleLimit() / 3));
111 } 111 }
112 112
113 return true; 113 return true;
114 } 114 }
115 115
116 void CompositorOutputSurface::ShortcutSwapAck( 116 void CompositorOutputSurface::ShortcutSwapAck(
117 uint32 output_surface_id, 117 uint32 output_surface_id,
118 scoped_ptr<cc::GLFrameData> gl_frame_data, 118 scoped_ptr<cc::GLFrameData> gl_frame_data,
119 scoped_ptr<cc::SoftwareFrameData> software_frame_data) { 119 scoped_ptr<cc::SoftwareFrameData> software_frame_data) {
120 if (!layout_test_previous_frame_ack_) { 120 if (!layout_test_previous_frame_ack_) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // If this is the last surface to stop preferring smoothness, 276 // If this is the last surface to stop preferring smoothness,
277 // Reset the main thread's priority to the default. 277 // Reset the main thread's priority to the default.
278 if (prefers_smoothness_ == true && 278 if (prefers_smoothness_ == true &&
279 --g_prefer_smoothness_count == 0) { 279 --g_prefer_smoothness_count == 0) {
280 SetThreadPriorityToDefault(main_thread_handle_); 280 SetThreadPriorityToDefault(main_thread_handle_);
281 } 281 }
282 prefers_smoothness_ = prefers_smoothness; 282 prefers_smoothness_ = prefers_smoothness;
283 } 283 }
284 284
285 } // namespace content 285 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698