OLD | NEW |
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 output_surface_proxy_ = new CompositorOutputSurfaceProxy(this); | 99 output_surface_proxy_ = new CompositorOutputSurfaceProxy(this); |
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 64 * 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 cc::ManagedMemoryPolicy::kDefaultNumResourcesLimit)); |
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, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // If this is the last surface to stop preferring smoothness, | 275 // If this is the last surface to stop preferring smoothness, |
276 // Reset the main thread's priority to the default. | 276 // Reset the main thread's priority to the default. |
277 if (prefers_smoothness_ == true && | 277 if (prefers_smoothness_ == true && |
278 --g_prefer_smoothness_count == 0) { | 278 --g_prefer_smoothness_count == 0) { |
279 SetThreadPriorityToDefault(main_thread_handle_); | 279 SetThreadPriorityToDefault(main_thread_handle_); |
280 } | 280 } |
281 prefers_smoothness_ = prefers_smoothness; | 281 prefers_smoothness_ = prefers_smoothness; |
282 } | 282 } |
283 | 283 |
284 } // namespace content | 284 } // namespace content |
OLD | NEW |