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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 | 1395 |
1396 private: | 1396 private: |
1397 bool mailbox_released_; | 1397 bool mailbox_released_; |
1398 }; | 1398 }; |
1399 | 1399 |
1400 class TextureLayerReleaseResourcesAfterCommit | 1400 class TextureLayerReleaseResourcesAfterCommit |
1401 : public TextureLayerReleaseResourcesBase { | 1401 : public TextureLayerReleaseResourcesBase { |
1402 public: | 1402 public: |
1403 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 1403 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
1404 LayerTreeImpl* tree = nullptr; | 1404 LayerTreeImpl* tree = nullptr; |
1405 if (host_impl->settings().impl_side_painting) | 1405 tree = host_impl->sync_tree(); |
1406 tree = host_impl->pending_tree(); | |
1407 else | |
1408 tree = host_impl->active_tree(); | |
1409 tree->root_layer()->children()[0]->ReleaseResources(); | 1406 tree->root_layer()->children()[0]->ReleaseResources(); |
1410 } | 1407 } |
1411 }; | 1408 }; |
1412 | 1409 |
1413 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerReleaseResourcesAfterCommit); | 1410 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerReleaseResourcesAfterCommit); |
1414 | 1411 |
1415 class TextureLayerReleaseResourcesAfterActivate | 1412 class TextureLayerReleaseResourcesAfterActivate |
1416 : public TextureLayerReleaseResourcesBase { | 1413 : public TextureLayerReleaseResourcesBase { |
1417 public: | 1414 public: |
1418 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { | 1415 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 int callback_count_; | 1555 int callback_count_; |
1559 scoped_refptr<Layer> root_; | 1556 scoped_refptr<Layer> root_; |
1560 scoped_refptr<TextureLayer> layer_; | 1557 scoped_refptr<TextureLayer> layer_; |
1561 }; | 1558 }; |
1562 | 1559 |
1563 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 1560 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
1564 TextureLayerWithMailboxImplThreadDeleted); | 1561 TextureLayerWithMailboxImplThreadDeleted); |
1565 | 1562 |
1566 } // namespace | 1563 } // namespace |
1567 } // namespace cc | 1564 } // namespace cc |
OLD | NEW |