| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } else { | 157 } else { |
| 158 base::MessageLoopProxy::current()->PostTask(FROM_HERE, closure); | 158 base::MessageLoopProxy::current()->PostTask(FROM_HERE, closure); |
| 159 } | 159 } |
| 160 client_->DidSwapBuffers(); | 160 client_->DidSwapBuffers(); |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 if (use_swap_compositor_frame_message_) { | 164 if (use_swap_compositor_frame_message_) { |
| 165 Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, | 165 Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, |
| 166 output_surface_id_, | 166 output_surface_id_, |
| 167 *frame)); | 167 *frame); |
| 168 client_->DidSwapBuffers(); | 168 client_->DidSwapBuffers(); |
| 169 return; | 169 return; |
| 170 } | 170 } |
| 171 | 171 |
| 172 if (frame->gl_frame_data) { | 172 if (frame->gl_frame_data) { |
| 173 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); | 173 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); |
| 174 ContextProviderCommandBuffer* provider_command_buffer = | 174 ContextProviderCommandBuffer* provider_command_buffer = |
| 175 static_cast<ContextProviderCommandBuffer*>(context_provider_.get()); | 175 static_cast<ContextProviderCommandBuffer*>(context_provider_.get()); |
| 176 CommandBufferProxyImpl* command_buffer_proxy = | 176 CommandBufferProxyImpl* command_buffer_proxy = |
| 177 provider_command_buffer->GetCommandBufferProxy(); | 177 provider_command_buffer->GetCommandBufferProxy(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // If this is the last surface to stop preferring smoothness, | 275 // If this is the last surface to stop preferring smoothness, |
| 276 // Reset the main thread's priority to the default. | 276 // Reset the main thread's priority to the default. |
| 277 if (prefers_smoothness_ == true && | 277 if (prefers_smoothness_ == true && |
| 278 --g_prefer_smoothness_count == 0) { | 278 --g_prefer_smoothness_count == 0) { |
| 279 SetThreadPriorityToDefault(main_thread_handle_); | 279 SetThreadPriorityToDefault(main_thread_handle_); |
| 280 } | 280 } |
| 281 prefers_smoothness_ = prefers_smoothness; | 281 prefers_smoothness_ = prefers_smoothness; |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace content | 284 } // namespace content |
| OLD | NEW |