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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 OnSwapAck(output_surface_id, *layout_test_previous_frame_ack_); | 125 OnSwapAck(output_surface_id, *layout_test_previous_frame_ack_); |
126 | 126 |
127 layout_test_previous_frame_ack_->gl_frame_data = gl_frame_data.Pass(); | 127 layout_test_previous_frame_ack_->gl_frame_data = gl_frame_data.Pass(); |
128 layout_test_previous_frame_ack_->last_software_frame_id = | 128 layout_test_previous_frame_ack_->last_software_frame_id = |
129 software_frame_data ? software_frame_data->id : 0; | 129 software_frame_data ? software_frame_data->id : 0; |
130 } | 130 } |
131 | 131 |
132 void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { | 132 void CompositorOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { |
| 133 DCHECK(!is_lost_); |
| 134 |
133 if (layout_test_mode_ && use_swap_compositor_frame_message_) { | 135 if (layout_test_mode_ && use_swap_compositor_frame_message_) { |
134 // This code path is here to support layout tests that are currently | 136 // This code path is here to support layout tests that are currently |
135 // doing a readback in the renderer instead of the browser. So they | 137 // doing a readback in the renderer instead of the browser. So they |
136 // are using deprecated code paths in the renderer and don't need to | 138 // are using deprecated code paths in the renderer and don't need to |
137 // actually swap anything to the browser. We shortcut the swap to the | 139 // actually swap anything to the browser. We shortcut the swap to the |
138 // browser here and just ack directly within the renderer process. | 140 // browser here and just ack directly within the renderer process. |
139 // Once crbug.com/311404 is fixed, this can be removed. | 141 // Once crbug.com/311404 is fixed, this can be removed. |
140 | 142 |
141 // This would indicate that crbug.com/311404 is being fixed, and this | 143 // This would indicate that crbug.com/311404 is being fixed, and this |
142 // block needs to be removed. | 144 // block needs to be removed. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // If this is the last surface to stop preferring smoothness, | 279 // If this is the last surface to stop preferring smoothness, |
278 // Reset the main thread's priority to the default. | 280 // Reset the main thread's priority to the default. |
279 if (prefers_smoothness_ == true && | 281 if (prefers_smoothness_ == true && |
280 --g_prefer_smoothness_count == 0) { | 282 --g_prefer_smoothness_count == 0) { |
281 SetThreadPriorityToDefault(main_thread_handle_); | 283 SetThreadPriorityToDefault(main_thread_handle_); |
282 } | 284 } |
283 prefers_smoothness_ = prefers_smoothness; | 285 prefers_smoothness_ = prefers_smoothness; |
284 } | 286 } |
285 | 287 |
286 } // namespace content | 288 } // namespace content |
OLD | NEW |