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/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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 main_thread_handle_(base::PlatformThread::CurrentHandle()), | 69 main_thread_handle_(base::PlatformThread::CurrentHandle()), |
| 70 #endif | 70 #endif |
| 71 layout_test_mode_(RenderThreadImpl::current()->layout_test_mode()), | 71 layout_test_mode_(RenderThreadImpl::current()->layout_test_mode()), |
| 72 weak_ptrs_(this) { | 72 weak_ptrs_(this) { |
| 73 DCHECK(output_surface_filter_.get()); | 73 DCHECK(output_surface_filter_.get()); |
| 74 DetachFromThread(); | 74 DetachFromThread(); |
| 75 message_sender_ = RenderThreadImpl::current()->sync_message_filter(); | 75 message_sender_ = RenderThreadImpl::current()->sync_message_filter(); |
| 76 DCHECK(message_sender_.get()); | 76 DCHECK(message_sender_.get()); |
| 77 if (OutputSurface::software_device()) | 77 if (OutputSurface::software_device()) |
| 78 capabilities_.max_frames_pending = 1; | 78 capabilities_.max_frames_pending = 1; |
| 79 #if defined(OS_ANDROID) | |
|
piman
2014/06/13 20:46:43
Why android only? All platforms but Mac* use deleg
Sami
2014/06/16 13:15:04
Yeah, I was wondering if this should be done more
| |
| 80 capabilities_.adjust_deadline_for_parent = false; | |
| 81 #endif | |
| 79 } | 82 } |
| 80 | 83 |
| 81 CompositorOutputSurface::~CompositorOutputSurface() { | 84 CompositorOutputSurface::~CompositorOutputSurface() { |
| 82 DCHECK(CalledOnValidThread()); | 85 DCHECK(CalledOnValidThread()); |
| 83 SetNeedsBeginFrame(false); | 86 SetNeedsBeginFrame(false); |
| 84 if (!HasClient()) | 87 if (!HasClient()) |
| 85 return; | 88 return; |
| 86 UpdateSmoothnessTakesPriority(false); | 89 UpdateSmoothnessTakesPriority(false); |
| 87 if (output_surface_proxy_.get()) | 90 if (output_surface_proxy_.get()) |
| 88 output_surface_proxy_->ClearOutputSurface(); | 91 output_surface_proxy_->ClearOutputSurface(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 // If this is the last surface to stop preferring smoothness, | 278 // If this is the last surface to stop preferring smoothness, |
| 276 // Reset the main thread's priority to the default. | 279 // Reset the main thread's priority to the default. |
| 277 if (prefers_smoothness_ == true && | 280 if (prefers_smoothness_ == true && |
| 278 --g_prefer_smoothness_count == 0) { | 281 --g_prefer_smoothness_count == 0) { |
| 279 SetThreadPriorityToDefault(main_thread_handle_); | 282 SetThreadPriorityToDefault(main_thread_handle_); |
| 280 } | 283 } |
| 281 prefers_smoothness_ = prefers_smoothness; | 284 prefers_smoothness_ = prefers_smoothness; |
| 282 } | 285 } |
| 283 | 286 |
| 284 } // namespace content | 287 } // namespace content |
| OLD | NEW |