OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 DCHECK_NE(DrawSwapReadbackResult::DRAW_SUCCESS, result.draw_result); | 1224 DCHECK_NE(DrawSwapReadbackResult::DRAW_SUCCESS, result.draw_result); |
1225 } | 1225 } |
1226 impl().layer_tree_host_impl->DidDrawAllLayers(frame); | 1226 impl().layer_tree_host_impl->DidDrawAllLayers(frame); |
1227 | 1227 |
1228 bool start_ready_animations = draw_frame; | 1228 bool start_ready_animations = draw_frame; |
1229 impl().layer_tree_host_impl->UpdateAnimationState(start_ready_animations); | 1229 impl().layer_tree_host_impl->UpdateAnimationState(start_ready_animations); |
1230 | 1230 |
1231 // Check for a pending CompositeAndReadback. | 1231 // Check for a pending CompositeAndReadback. |
1232 if (drawing_for_readback) { | 1232 if (drawing_for_readback) { |
1233 DCHECK(!swap_requested); | 1233 DCHECK(!swap_requested); |
1234 result.did_readback = false; | 1234 bool did_readback = false; |
1235 if (draw_frame) { | 1235 if (draw_frame) { |
1236 if (!impl().layer_tree_host_impl->IsContextLost()) { | 1236 if (!impl().layer_tree_host_impl->IsContextLost()) { |
1237 impl().layer_tree_host_impl->Readback(impl().readback_request->pixels, | 1237 impl().layer_tree_host_impl->Readback(impl().readback_request->pixels, |
1238 impl().readback_request->rect); | 1238 impl().readback_request->rect); |
1239 result.did_readback = true; | 1239 did_readback = true; |
1240 } else { | 1240 } else { |
1241 result.draw_result = DrawSwapReadbackResult::DRAW_ABORTED_CONTEXT_LOST; | 1241 result.draw_result = DrawSwapReadbackResult::DRAW_ABORTED_CONTEXT_LOST; |
1242 } | 1242 } |
1243 } | 1243 } |
1244 impl().readback_request->success = result.did_readback; | 1244 impl().readback_request->success = did_readback; |
1245 impl().readback_request->completion.Signal(); | 1245 impl().readback_request->completion.Signal(); |
1246 impl().readback_request = NULL; | 1246 impl().readback_request = NULL; |
1247 } else if (draw_frame) { | 1247 } else if (draw_frame) { |
1248 DCHECK(swap_requested); | 1248 DCHECK(swap_requested); |
1249 result.did_request_swap = impl().layer_tree_host_impl->SwapBuffers(frame); | 1249 bool did_request_swap = impl().layer_tree_host_impl->SwapBuffers(frame); |
1250 | 1250 |
1251 // We don't know if we have incomplete tiles if we didn't actually swap. | 1251 // We don't know if we have incomplete tiles if we didn't actually swap. |
1252 if (result.did_request_swap) { | 1252 if (did_request_swap) { |
1253 DCHECK(!frame.has_no_damage); | 1253 DCHECK(!frame.has_no_damage); |
1254 SetSwapUsedIncompleteTileOnImplThread(frame.contains_incomplete_tile); | 1254 SetSwapUsedIncompleteTileOnImplThread(frame.contains_incomplete_tile); |
1255 } | 1255 } |
1256 } | 1256 } |
1257 | 1257 |
1258 // Tell the main thread that the the newly-commited frame was drawn. | 1258 // Tell the main thread that the the newly-commited frame was drawn. |
1259 if (impl().next_frame_is_newly_committed_frame) { | 1259 if (impl().next_frame_is_newly_committed_frame) { |
1260 impl().next_frame_is_newly_committed_frame = false; | 1260 impl().next_frame_is_newly_committed_frame = false; |
1261 Proxy::MainThreadTaskRunner()->PostTask( | 1261 Proxy::MainThreadTaskRunner()->PostTask( |
1262 FROM_HERE, | 1262 FROM_HERE, |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1696 | 1696 |
1697 impl().timing_history.DidActivatePendingTree(); | 1697 impl().timing_history.DidActivatePendingTree(); |
1698 } | 1698 } |
1699 | 1699 |
1700 void ThreadProxy::DidManageTiles() { | 1700 void ThreadProxy::DidManageTiles() { |
1701 DCHECK(IsImplThread()); | 1701 DCHECK(IsImplThread()); |
1702 impl().scheduler->DidManageTiles(); | 1702 impl().scheduler->DidManageTiles(); |
1703 } | 1703 } |
1704 | 1704 |
1705 } // namespace cc | 1705 } // namespace cc |
OLD | NEW |