Chromium Code Reviews| 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_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "cc/compositor_frame.h" | 9 #include "cc/compositor_frame.h" |
| 10 #include "cc/compositor_frame_ack.h" | 10 #include "cc/compositor_frame_ack.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 make_scoped_ptr(software_device)), | 58 make_scoped_ptr(software_device)), |
| 59 output_surface_filter_( | 59 output_surface_filter_( |
| 60 RenderThreadImpl::current()->compositor_output_surface_filter()), | 60 RenderThreadImpl::current()->compositor_output_surface_filter()), |
| 61 routing_id_(routing_id), | 61 routing_id_(routing_id), |
| 62 prefers_smoothness_(false), | 62 prefers_smoothness_(false), |
| 63 main_thread_id_(base::PlatformThread::CurrentId()) { | 63 main_thread_id_(base::PlatformThread::CurrentId()) { |
| 64 DCHECK(output_surface_filter_); | 64 DCHECK(output_surface_filter_); |
| 65 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 65 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 66 capabilities_.has_parent_compositor = command_line->HasSwitch( | 66 capabilities_.has_parent_compositor = command_line->HasSwitch( |
| 67 switches::kEnableDelegatedRenderer); | 67 switches::kEnableDelegatedRenderer); |
| 68 if (capabilities_.has_parent_compositor) | |
| 69 capabilities_.max_frames_pending = 1; | |
|
piman
2013/03/13 15:55:22
This logic should stay inside the compositor. It's
jonathan.backer
2013/03/13 16:55:29
Done.
| |
| 68 DetachFromThread(); | 70 DetachFromThread(); |
| 69 } | 71 } |
| 70 | 72 |
| 71 CompositorOutputSurface::~CompositorOutputSurface() { | 73 CompositorOutputSurface::~CompositorOutputSurface() { |
| 72 DCHECK(CalledOnValidThread()); | 74 DCHECK(CalledOnValidThread()); |
| 73 if (!client_) | 75 if (!client_) |
| 74 return; | 76 return; |
| 75 UpdateSmoothnessTakesPriority(false); | 77 UpdateSmoothnessTakesPriority(false); |
| 76 if (output_surface_proxy_) | 78 if (output_surface_proxy_) |
| 77 output_surface_proxy_->ClearOutputSurface(); | 79 output_surface_proxy_->ClearOutputSurface(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 // If this is the last surface to stop preferring smoothness, | 163 // If this is the last surface to stop preferring smoothness, |
| 162 // Reset the main thread's priority to the default. | 164 // Reset the main thread's priority to the default. |
| 163 if (prefers_smoothness_ == true && | 165 if (prefers_smoothness_ == true && |
| 164 --g_prefer_smoothness_count == 0) { | 166 --g_prefer_smoothness_count == 0) { |
| 165 SetThreadsPriorityToDefault(main_thread_id_); | 167 SetThreadsPriorityToDefault(main_thread_id_); |
| 166 } | 168 } |
| 167 prefers_smoothness_ = prefers_smoothness; | 169 prefers_smoothness_ = prefers_smoothness; |
| 168 } | 170 } |
| 169 | 171 |
| 170 } // namespace content | 172 } // namespace content |
| OLD | NEW |