OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 break; | 1101 break; |
1102 default: | 1102 default: |
1103 NOTREACHED(); | 1103 NOTREACHED(); |
1104 break; | 1104 break; |
1105 } | 1105 } |
1106 } | 1106 } |
1107 | 1107 |
1108 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { | 1108 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { |
1109 ASSERT_TRUE(result); | 1109 ASSERT_TRUE(result); |
1110 DelegatedFrameData* delegated_frame_data = | 1110 DelegatedFrameData* delegated_frame_data = |
1111 output_surface()->last_sent_frame().delegated_frame_data.get(); | 1111 output_surface()->last_sent_frame()->delegated_frame_data.get(); |
1112 if (!delegated_frame_data) | 1112 if (!delegated_frame_data) |
1113 return; | 1113 return; |
1114 | 1114 |
1115 // Return all resources immediately. | 1115 // Return all resources immediately. |
1116 TransferableResourceArray resources_to_return = | 1116 TransferableResourceArray resources_to_return = |
1117 output_surface()->resources_held_by_parent(); | 1117 output_surface()->resources_held_by_parent(); |
1118 | 1118 |
1119 CompositorFrameAck ack; | 1119 CompositorFrameAck ack; |
1120 for (size_t i = 0; i < resources_to_return.size(); ++i) | 1120 for (size_t i = 0; i < resources_to_return.size(); ++i) |
1121 output_surface()->ReturnResource(resources_to_return[i].id, &ack); | 1121 output_surface()->ReturnResource(resources_to_return[i].id, &ack); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 break; | 1238 break; |
1239 default: | 1239 default: |
1240 NOTREACHED(); | 1240 NOTREACHED(); |
1241 break; | 1241 break; |
1242 } | 1242 } |
1243 } | 1243 } |
1244 | 1244 |
1245 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { | 1245 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { |
1246 ASSERT_TRUE(result); | 1246 ASSERT_TRUE(result); |
1247 DelegatedFrameData* delegated_frame_data = | 1247 DelegatedFrameData* delegated_frame_data = |
1248 output_surface()->last_sent_frame().delegated_frame_data.get(); | 1248 output_surface()->last_sent_frame()->delegated_frame_data.get(); |
1249 if (!delegated_frame_data) | 1249 if (!delegated_frame_data) |
1250 return; | 1250 return; |
1251 | 1251 |
1252 // Return all resources immediately. | 1252 // Return all resources immediately. |
1253 TransferableResourceArray resources_to_return = | 1253 TransferableResourceArray resources_to_return = |
1254 output_surface()->resources_held_by_parent(); | 1254 output_surface()->resources_held_by_parent(); |
1255 | 1255 |
1256 CompositorFrameAck ack; | 1256 CompositorFrameAck ack; |
1257 for (size_t i = 0; i < resources_to_return.size(); ++i) | 1257 for (size_t i = 0; i < resources_to_return.size(); ++i) |
1258 output_surface()->ReturnResource(resources_to_return[i].id, &ack); | 1258 output_surface()->ReturnResource(resources_to_return[i].id, &ack); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 int callback_count_; | 1489 int callback_count_; |
1490 scoped_refptr<Layer> root_; | 1490 scoped_refptr<Layer> root_; |
1491 scoped_refptr<TextureLayer> layer_; | 1491 scoped_refptr<TextureLayer> layer_; |
1492 }; | 1492 }; |
1493 | 1493 |
1494 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 1494 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
1495 TextureLayerWithMailboxImplThreadDeleted); | 1495 TextureLayerWithMailboxImplThreadDeleted); |
1496 | 1496 |
1497 } // namespace | 1497 } // namespace |
1498 } // namespace cc | 1498 } // namespace cc |
OLD | NEW |