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