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/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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 void CompositorOutputSurface::SendFrameToParentCompositor( | 101 void CompositorOutputSurface::SendFrameToParentCompositor( |
102 cc::CompositorFrame* frame) { | 102 cc::CompositorFrame* frame) { |
103 DCHECK(CalledOnValidThread()); | 103 DCHECK(CalledOnValidThread()); |
104 Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, *frame)); | 104 Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, *frame)); |
105 } | 105 } |
106 | 106 |
107 void CompositorOutputSurface::SwapBuffers( | 107 void CompositorOutputSurface::SwapBuffers( |
108 const cc::LatencyInfo& latency_info) { | 108 const ui::LatencyInfo& latency_info) { |
109 WebGraphicsContext3DCommandBufferImpl* command_buffer = | 109 WebGraphicsContext3DCommandBufferImpl* command_buffer = |
110 static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d()); | 110 static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d()); |
111 CommandBufferProxyImpl* command_buffer_proxy = | 111 CommandBufferProxyImpl* command_buffer_proxy = |
112 command_buffer->GetCommandBufferProxy(); | 112 command_buffer->GetCommandBufferProxy(); |
113 DCHECK(command_buffer_proxy); | 113 DCHECK(command_buffer_proxy); |
114 context3d()->shallowFlushCHROMIUM(); | 114 context3d()->shallowFlushCHROMIUM(); |
115 command_buffer_proxy->SetLatencyInfo(latency_info); | 115 command_buffer_proxy->SetLatencyInfo(latency_info); |
116 OutputSurface::SwapBuffers(latency_info); | 116 OutputSurface::SwapBuffers(latency_info); |
117 } | 117 } |
118 | 118 |
119 void CompositorOutputSurface::PostSubBuffer( | 119 void CompositorOutputSurface::PostSubBuffer( |
120 gfx::Rect rect, const cc::LatencyInfo& latency_info) { | 120 gfx::Rect rect, const ui::LatencyInfo& latency_info) { |
121 WebGraphicsContext3DCommandBufferImpl* command_buffer = | 121 WebGraphicsContext3DCommandBufferImpl* command_buffer = |
122 static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d()); | 122 static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d()); |
123 CommandBufferProxyImpl* command_buffer_proxy = | 123 CommandBufferProxyImpl* command_buffer_proxy = |
124 command_buffer->GetCommandBufferProxy(); | 124 command_buffer->GetCommandBufferProxy(); |
125 DCHECK(command_buffer_proxy); | 125 DCHECK(command_buffer_proxy); |
126 context3d()->shallowFlushCHROMIUM(); | 126 context3d()->shallowFlushCHROMIUM(); |
127 command_buffer_proxy->SetLatencyInfo(latency_info); | 127 command_buffer_proxy->SetLatencyInfo(latency_info); |
128 OutputSurface::PostSubBuffer(rect, latency_info); | 128 OutputSurface::PostSubBuffer(rect, latency_info); |
129 } | 129 } |
130 | 130 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // If this is the last surface to stop preferring smoothness, | 203 // If this is the last surface to stop preferring smoothness, |
204 // Reset the main thread's priority to the default. | 204 // Reset the main thread's priority to the default. |
205 if (prefers_smoothness_ == true && | 205 if (prefers_smoothness_ == true && |
206 --g_prefer_smoothness_count == 0) { | 206 --g_prefer_smoothness_count == 0) { |
207 SetThreadsPriorityToDefault(main_thread_id_); | 207 SetThreadsPriorityToDefault(main_thread_id_); |
208 } | 208 } |
209 prefers_smoothness_ = prefers_smoothness; | 209 prefers_smoothness_ = prefers_smoothness; |
210 } | 210 } |
211 | 211 |
212 } // namespace content | 212 } // namespace content |
OLD | NEW |