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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // TODO(epenner): Implement PlatformThread::CurrentHandle() on windows. | 62 // TODO(epenner): Implement PlatformThread::CurrentHandle() on windows. |
63 main_thread_handle_(base::PlatformThreadHandle()) | 63 main_thread_handle_(base::PlatformThreadHandle()) |
64 #else | 64 #else |
65 main_thread_handle_(base::PlatformThread::CurrentHandle()) | 65 main_thread_handle_(base::PlatformThread::CurrentHandle()) |
66 #endif | 66 #endif |
67 { | 67 { |
68 DCHECK(output_surface_filter_.get()); | 68 DCHECK(output_surface_filter_.get()); |
69 DetachFromThread(); | 69 DetachFromThread(); |
70 message_sender_ = RenderThreadImpl::current()->sync_message_filter(); | 70 message_sender_ = RenderThreadImpl::current()->sync_message_filter(); |
71 DCHECK(message_sender_.get()); | 71 DCHECK(message_sender_.get()); |
72 if (software_device) | 72 if (OutputSurface::software_device()) |
73 capabilities_.max_frames_pending = 1; | 73 capabilities_.max_frames_pending = 1; |
74 } | 74 } |
75 | 75 |
76 CompositorOutputSurface::~CompositorOutputSurface() { | 76 CompositorOutputSurface::~CompositorOutputSurface() { |
77 DCHECK(CalledOnValidThread()); | 77 DCHECK(CalledOnValidThread()); |
78 SetNeedsBeginFrame(false); | 78 SetNeedsBeginFrame(false); |
79 if (!HasClient()) | 79 if (!HasClient()) |
80 return; | 80 return; |
81 UpdateSmoothnessTakesPriority(false); | 81 UpdateSmoothnessTakesPriority(false); |
82 if (output_surface_proxy_.get()) | 82 if (output_surface_proxy_.get()) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // If this is the last surface to stop preferring smoothness, | 216 // If this is the last surface to stop preferring smoothness, |
217 // Reset the main thread's priority to the default. | 217 // Reset the main thread's priority to the default. |
218 if (prefers_smoothness_ == true && | 218 if (prefers_smoothness_ == true && |
219 --g_prefer_smoothness_count == 0) { | 219 --g_prefer_smoothness_count == 0) { |
220 SetThreadPriorityToDefault(main_thread_handle_); | 220 SetThreadPriorityToDefault(main_thread_handle_); |
221 } | 221 } |
222 prefers_smoothness_ = prefers_smoothness; | 222 prefers_smoothness_ = prefers_smoothness; |
223 } | 223 } |
224 | 224 |
225 } // namespace content | 225 } // namespace content |
OLD | NEW |