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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { | 114 void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { |
115 if (use_swap_compositor_frame_message_) { | 115 if (use_swap_compositor_frame_message_) { |
116 Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, | 116 Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, |
117 output_surface_id_, | 117 output_surface_id_, |
118 *frame)); | 118 *frame)); |
119 DidSwapBuffers(); | 119 DidSwapBuffers(); |
120 return; | 120 return; |
121 } | 121 } |
122 | 122 |
123 if (frame->gl_frame_data) { | 123 if (frame->gl_frame_data) { |
| 124 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); |
124 ContextProviderCommandBuffer* provider_command_buffer = | 125 ContextProviderCommandBuffer* provider_command_buffer = |
125 static_cast<ContextProviderCommandBuffer*>(context_provider_.get()); | 126 static_cast<ContextProviderCommandBuffer*>(context_provider_.get()); |
126 CommandBufferProxyImpl* command_buffer_proxy = | 127 CommandBufferProxyImpl* command_buffer_proxy = |
127 provider_command_buffer->GetCommandBufferProxy(); | 128 provider_command_buffer->GetCommandBufferProxy(); |
128 DCHECK(command_buffer_proxy); | 129 DCHECK(command_buffer_proxy); |
129 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); | |
130 command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info); | 130 command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info); |
131 } | 131 } |
132 | 132 |
133 OutputSurface::SwapBuffers(frame); | 133 OutputSurface::SwapBuffers(frame); |
134 } | 134 } |
135 | 135 |
136 void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) { | 136 void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) { |
137 DCHECK(CalledOnValidThread()); | 137 DCHECK(CalledOnValidThread()); |
138 if (!HasClient()) | 138 if (!HasClient()) |
139 return; | 139 return; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // If this is the last surface to stop preferring smoothness, | 226 // If this is the last surface to stop preferring smoothness, |
227 // Reset the main thread's priority to the default. | 227 // Reset the main thread's priority to the default. |
228 if (prefers_smoothness_ == true && | 228 if (prefers_smoothness_ == true && |
229 --g_prefer_smoothness_count == 0) { | 229 --g_prefer_smoothness_count == 0) { |
230 SetThreadPriorityToDefault(main_thread_handle_); | 230 SetThreadPriorityToDefault(main_thread_handle_); |
231 } | 231 } |
232 prefers_smoothness_ = prefers_smoothness; | 232 prefers_smoothness_ = prefers_smoothness; |
233 } | 233 } |
234 | 234 |
235 } // namespace content | 235 } // namespace content |
OLD | NEW |