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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 ReclaimResources(&ack); | 208 ReclaimResources(&ack); |
209 } | 209 } |
210 | 210 |
211 bool CompositorOutputSurface::Send(IPC::Message* message) { | 211 bool CompositorOutputSurface::Send(IPC::Message* message) { |
212 return message_sender_->Send(message); | 212 return message_sender_->Send(message); |
213 } | 213 } |
214 | 214 |
215 namespace { | 215 namespace { |
216 #if defined(OS_ANDROID) | 216 #if defined(OS_ANDROID) |
217 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) { | 217 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) { |
218 base::PlatformThread::SetThreadPriority( | 218 base::PlatformThread::SetThreadPriority(handle, |
219 handle, base::kThreadPriority_Background); | 219 base::ThreadPriority::BACKGROUND); |
220 } | 220 } |
221 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) { | 221 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) { |
222 base::PlatformThread::SetThreadPriority( | 222 base::PlatformThread::SetThreadPriority(handle, |
223 handle, base::kThreadPriority_Normal); | 223 base::ThreadPriority::NORMAL); |
224 } | 224 } |
225 #else | 225 #else |
226 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) {} | 226 void SetThreadPriorityToIdle(base::PlatformThreadHandle handle) {} |
227 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) {} | 227 void SetThreadPriorityToDefault(base::PlatformThreadHandle handle) {} |
228 #endif | 228 #endif |
229 } | 229 } |
230 | 230 |
231 void CompositorOutputSurface::UpdateSmoothnessTakesPriority( | 231 void CompositorOutputSurface::UpdateSmoothnessTakesPriority( |
232 bool prefers_smoothness) { | 232 bool prefers_smoothness) { |
233 #ifndef NDEBUG | 233 #ifndef NDEBUG |
(...skipping 13 matching lines...) Expand all Loading... |
247 // If this is the last surface to stop preferring smoothness, | 247 // If this is the last surface to stop preferring smoothness, |
248 // Reset the main thread's priority to the default. | 248 // Reset the main thread's priority to the default. |
249 if (prefers_smoothness_ == true && | 249 if (prefers_smoothness_ == true && |
250 --g_prefer_smoothness_count == 0) { | 250 --g_prefer_smoothness_count == 0) { |
251 SetThreadPriorityToDefault(main_thread_handle_); | 251 SetThreadPriorityToDefault(main_thread_handle_); |
252 } | 252 } |
253 prefers_smoothness_ = prefers_smoothness; | 253 prefers_smoothness_ = prefers_smoothness; |
254 } | 254 } |
255 | 255 |
256 } // namespace content | 256 } // namespace content |
OLD | NEW |