| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |