| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual void SetUp() OVERRIDE { | 52 virtual void SetUp() OVERRIDE { |
| 53 InitializeRenderer(); | 53 InitializeRenderer(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual void InitializeRenderer() { | 56 virtual void InitializeRenderer() { |
| 57 host_impl_.InitializeRenderer(CreateFakeOutputSurface()); | 57 host_impl_.InitializeRenderer(CreateFakeOutputSurface()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void SetupDefaultTrees(gfx::Size layer_bounds) { | 60 void SetupDefaultTrees(const gfx::Size& layer_bounds) { |
| 61 gfx::Size tile_size(100, 100); | 61 gfx::Size tile_size(100, 100); |
| 62 | 62 |
| 63 scoped_refptr<FakePicturePileImpl> pending_pile = | 63 scoped_refptr<FakePicturePileImpl> pending_pile = |
| 64 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 64 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 65 scoped_refptr<FakePicturePileImpl> active_pile = | 65 scoped_refptr<FakePicturePileImpl> active_pile = |
| 66 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 66 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
| 67 | 67 |
| 68 SetupTrees(pending_pile, active_pile); | 68 SetupTrees(pending_pile, active_pile); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ActivateTree() { | 71 void ActivateTree() { |
| 72 host_impl_.ActivatePendingTree(); | 72 host_impl_.ActivatePendingTree(); |
| 73 CHECK(!host_impl_.pending_tree()); | 73 CHECK(!host_impl_.pending_tree()); |
| 74 pending_layer_ = NULL; | 74 pending_layer_ = NULL; |
| 75 active_layer_ = static_cast<FakePictureLayerImpl*>( | 75 active_layer_ = static_cast<FakePictureLayerImpl*>( |
| 76 host_impl_.active_tree()->LayerById(id_)); | 76 host_impl_.active_tree()->LayerById(id_)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void SetupDefaultTreesWithFixedTileSize(gfx::Size layer_bounds, | 79 void SetupDefaultTreesWithFixedTileSize(const gfx::Size& layer_bounds, |
| 80 gfx::Size tile_size) { | 80 const gfx::Size& tile_size) { |
| 81 SetupDefaultTrees(layer_bounds); | 81 SetupDefaultTrees(layer_bounds); |
| 82 pending_layer_->set_fixed_tile_size(tile_size); | 82 pending_layer_->set_fixed_tile_size(tile_size); |
| 83 active_layer_->set_fixed_tile_size(tile_size); | 83 active_layer_->set_fixed_tile_size(tile_size); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void SetupTrees( | 86 void SetupTrees( |
| 87 scoped_refptr<PicturePileImpl> pending_pile, | 87 scoped_refptr<PicturePileImpl> pending_pile, |
| 88 scoped_refptr<PicturePileImpl> active_pile) { | 88 scoped_refptr<PicturePileImpl> active_pile) { |
| 89 SetupPendingTree(active_pile); | 89 SetupPendingTree(active_pile); |
| 90 ActivateTree(); | 90 ActivateTree(); |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 TestContextProvider::Create(), NULL)); | 1535 TestContextProvider::Create(), NULL)); |
| 1536 | 1536 |
| 1537 // These will crash PictureLayerImpl if this is not true. | 1537 // These will crash PictureLayerImpl if this is not true. |
| 1538 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); | 1538 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); |
| 1539 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); | 1539 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); |
| 1540 host_impl_.active_tree()->UpdateDrawProperties(); | 1540 host_impl_.active_tree()->UpdateDrawProperties(); |
| 1541 } | 1541 } |
| 1542 | 1542 |
| 1543 } // namespace | 1543 } // namespace |
| 1544 } // namespace cc | 1544 } // namespace cc |
| OLD | NEW |