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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 return; | 1800 return; |
1801 | 1801 |
1802 // Return all resources immediately. | 1802 // Return all resources immediately. |
1803 TransferableResourceArray resources_to_return = | 1803 TransferableResourceArray resources_to_return = |
1804 output_surface()->resources_held_by_parent(); | 1804 output_surface()->resources_held_by_parent(); |
1805 | 1805 |
1806 CompositorFrameAck ack; | 1806 CompositorFrameAck ack; |
1807 for (size_t i = 0; i < resources_to_return.size(); ++i) | 1807 for (size_t i = 0; i < resources_to_return.size(); ++i) |
1808 output_surface()->ReturnResource(resources_to_return[i].id, &ack); | 1808 output_surface()->ReturnResource(resources_to_return[i].id, &ack); |
1809 host_impl->ReclaimResources(&ack); | 1809 host_impl->ReclaimResources(&ack); |
1810 host_impl->OnSwapBuffersComplete(); | |
1811 } | 1810 } |
1812 | 1811 |
1813 virtual void AfterTest() OVERRIDE {} | 1812 virtual void AfterTest() OVERRIDE {} |
1814 | 1813 |
1815 private: | 1814 private: |
1816 scoped_refptr<TextureLayer> texture_layer_; | 1815 scoped_refptr<TextureLayer> texture_layer_; |
1817 }; | 1816 }; |
1818 | 1817 |
1819 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest); | 1818 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest); |
1820 | 1819 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 return; | 1944 return; |
1946 | 1945 |
1947 // Return all resources immediately. | 1946 // Return all resources immediately. |
1948 TransferableResourceArray resources_to_return = | 1947 TransferableResourceArray resources_to_return = |
1949 output_surface()->resources_held_by_parent(); | 1948 output_surface()->resources_held_by_parent(); |
1950 | 1949 |
1951 CompositorFrameAck ack; | 1950 CompositorFrameAck ack; |
1952 for (size_t i = 0; i < resources_to_return.size(); ++i) | 1951 for (size_t i = 0; i < resources_to_return.size(); ++i) |
1953 output_surface()->ReturnResource(resources_to_return[i].id, &ack); | 1952 output_surface()->ReturnResource(resources_to_return[i].id, &ack); |
1954 host_impl->ReclaimResources(&ack); | 1953 host_impl->ReclaimResources(&ack); |
1955 host_impl->OnSwapBuffersComplete(); | |
1956 } | 1954 } |
1957 | 1955 |
1958 virtual void AfterTest() OVERRIDE {} | 1956 virtual void AfterTest() OVERRIDE {} |
1959 | 1957 |
1960 private: | 1958 private: |
1961 scoped_refptr<SolidColorLayer> solid_layer_; | 1959 scoped_refptr<SolidColorLayer> solid_layer_; |
1962 scoped_refptr<Layer> parent_layer_; | 1960 scoped_refptr<Layer> parent_layer_; |
1963 scoped_refptr<TextureLayer> texture_layer_; | 1961 scoped_refptr<TextureLayer> texture_layer_; |
1964 | 1962 |
1965 // Used on the main thread. | 1963 // Used on the main thread. |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 int callback_count_; | 2269 int callback_count_; |
2272 scoped_refptr<Layer> root_; | 2270 scoped_refptr<Layer> root_; |
2273 scoped_refptr<TextureLayer> layer_; | 2271 scoped_refptr<TextureLayer> layer_; |
2274 }; | 2272 }; |
2275 | 2273 |
2276 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 2274 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
2277 TextureLayerWithMailboxImplThreadDeleted); | 2275 TextureLayerWithMailboxImplThreadDeleted); |
2278 | 2276 |
2279 } // namespace | 2277 } // namespace |
2280 } // namespace cc | 2278 } // namespace cc |
OLD | NEW |