| 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 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1720 return; | 1720 return; |
| 1721 | 1721 |
| 1722 // Return all resources immediately. | 1722 // Return all resources immediately. |
| 1723 TransferableResourceArray resources_to_return = | 1723 TransferableResourceArray resources_to_return = |
| 1724 output_surface()->resources_held_by_parent(); | 1724 output_surface()->resources_held_by_parent(); |
| 1725 | 1725 |
| 1726 CompositorFrameAck ack; | 1726 CompositorFrameAck ack; |
| 1727 for (size_t i = 0; i < resources_to_return.size(); ++i) | 1727 for (size_t i = 0; i < resources_to_return.size(); ++i) |
| 1728 output_surface()->ReturnResource(resources_to_return[i].id, &ack); | 1728 output_surface()->ReturnResource(resources_to_return[i].id, &ack); |
| 1729 host_impl->ReclaimResources(&ack); | 1729 host_impl->ReclaimResources(&ack); |
| 1730 host_impl->OnSwapBuffersComplete(); | |
| 1731 } | 1730 } |
| 1732 | 1731 |
| 1733 virtual void AfterTest() OVERRIDE {} | 1732 virtual void AfterTest() OVERRIDE {} |
| 1734 | 1733 |
| 1735 private: | 1734 private: |
| 1736 scoped_refptr<TextureLayer> texture_layer_; | 1735 scoped_refptr<TextureLayer> texture_layer_; |
| 1737 }; | 1736 }; |
| 1738 | 1737 |
| 1739 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest); | 1738 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerNoExtraCommitForMailboxTest); |
| 1740 | 1739 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 return; | 1864 return; |
| 1866 | 1865 |
| 1867 // Return all resources immediately. | 1866 // Return all resources immediately. |
| 1868 TransferableResourceArray resources_to_return = | 1867 TransferableResourceArray resources_to_return = |
| 1869 output_surface()->resources_held_by_parent(); | 1868 output_surface()->resources_held_by_parent(); |
| 1870 | 1869 |
| 1871 CompositorFrameAck ack; | 1870 CompositorFrameAck ack; |
| 1872 for (size_t i = 0; i < resources_to_return.size(); ++i) | 1871 for (size_t i = 0; i < resources_to_return.size(); ++i) |
| 1873 output_surface()->ReturnResource(resources_to_return[i].id, &ack); | 1872 output_surface()->ReturnResource(resources_to_return[i].id, &ack); |
| 1874 host_impl->ReclaimResources(&ack); | 1873 host_impl->ReclaimResources(&ack); |
| 1875 host_impl->OnSwapBuffersComplete(); | |
| 1876 } | 1874 } |
| 1877 | 1875 |
| 1878 virtual void AfterTest() OVERRIDE {} | 1876 virtual void AfterTest() OVERRIDE {} |
| 1879 | 1877 |
| 1880 private: | 1878 private: |
| 1881 scoped_refptr<SolidColorLayer> solid_layer_; | 1879 scoped_refptr<SolidColorLayer> solid_layer_; |
| 1882 scoped_refptr<Layer> parent_layer_; | 1880 scoped_refptr<Layer> parent_layer_; |
| 1883 scoped_refptr<TextureLayer> texture_layer_; | 1881 scoped_refptr<TextureLayer> texture_layer_; |
| 1884 | 1882 |
| 1885 // Used on the main thread. | 1883 // Used on the main thread. |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2191 int callback_count_; | 2189 int callback_count_; |
| 2192 scoped_refptr<Layer> root_; | 2190 scoped_refptr<Layer> root_; |
| 2193 scoped_refptr<TextureLayer> layer_; | 2191 scoped_refptr<TextureLayer> layer_; |
| 2194 }; | 2192 }; |
| 2195 | 2193 |
| 2196 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 2194 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
| 2197 TextureLayerWithMailboxImplThreadDeleted); | 2195 TextureLayerWithMailboxImplThreadDeleted); |
| 2198 | 2196 |
| 2199 } // namespace | 2197 } // namespace |
| 2200 } // namespace cc | 2198 } // namespace cc |
| OLD | NEW |