| 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 15 matching lines...) Expand all Loading... |
| 26 // compositor thread, so we use a simple int here to track prefer-smoothness. | 26 // compositor thread, so we use a simple int here to track prefer-smoothness. |
| 27 int g_prefer_smoothness_count = 0; | 27 int g_prefer_smoothness_count = 0; |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 | 31 |
| 32 CompositorOutputSurface::CompositorOutputSurface( | 32 CompositorOutputSurface::CompositorOutputSurface( |
| 33 int32 routing_id, | 33 int32 routing_id, |
| 34 uint32 output_surface_id, | 34 uint32 output_surface_id, |
| 35 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, | 35 const scoped_refptr<ContextProviderCommandBuffer>& context_provider, |
| 36 const scoped_refptr<ContextProviderCommandBuffer>& worker_context_provider, |
| 36 scoped_ptr<cc::SoftwareOutputDevice> software_device, | 37 scoped_ptr<cc::SoftwareOutputDevice> software_device, |
| 37 scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue, | 38 scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue, |
| 38 bool use_swap_compositor_frame_message) | 39 bool use_swap_compositor_frame_message) |
| 39 : OutputSurface(context_provider, software_device.Pass()), | 40 : OutputSurface(context_provider, |
| 41 worker_context_provider, |
| 42 software_device.Pass()), |
| 40 output_surface_id_(output_surface_id), | 43 output_surface_id_(output_surface_id), |
| 41 use_swap_compositor_frame_message_(use_swap_compositor_frame_message), | 44 use_swap_compositor_frame_message_(use_swap_compositor_frame_message), |
| 42 output_surface_filter_( | 45 output_surface_filter_( |
| 43 RenderThreadImpl::current()->compositor_message_filter()), | 46 RenderThreadImpl::current()->compositor_message_filter()), |
| 44 frame_swap_message_queue_(swap_frame_message_queue), | 47 frame_swap_message_queue_(swap_frame_message_queue), |
| 45 routing_id_(routing_id), | 48 routing_id_(routing_id), |
| 46 prefers_smoothness_(false), | 49 prefers_smoothness_(false), |
| 47 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 48 // TODO(epenner): Implement PlatformThread::CurrentHandle() on windows. | 51 // TODO(epenner): Implement PlatformThread::CurrentHandle() on windows. |
| 49 main_thread_handle_(base::PlatformThreadHandle()), | 52 main_thread_handle_(base::PlatformThreadHandle()), |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 // If this is the last surface to stop preferring smoothness, | 247 // If this is the last surface to stop preferring smoothness, |
| 245 // Reset the main thread's priority to the default. | 248 // Reset the main thread's priority to the default. |
| 246 if (prefers_smoothness_ == true && | 249 if (prefers_smoothness_ == true && |
| 247 --g_prefer_smoothness_count == 0) { | 250 --g_prefer_smoothness_count == 0) { |
| 248 SetThreadPriorityToDefault(main_thread_handle_); | 251 SetThreadPriorityToDefault(main_thread_handle_); |
| 249 } | 252 } |
| 250 prefers_smoothness_ = prefers_smoothness; | 253 prefers_smoothness_ = prefers_smoothness; |
| 251 } | 254 } |
| 252 | 255 |
| 253 } // namespace content | 256 } // namespace content |
| OLD | NEW |