OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 8113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8124 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10); | 8124 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10); |
8125 layer->SetBounds(gfx::Size(10, 10)); | 8125 layer->SetBounds(gfx::Size(10, 10)); |
8126 scoped_ptr<FakePictureLayerImpl> nondraw_layer = | 8126 scoped_ptr<FakePictureLayerImpl> nondraw_layer = |
8127 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12); | 8127 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12); |
8128 nondraw_layer->SetBounds(gfx::Size(10, 10)); | 8128 nondraw_layer->SetBounds(gfx::Size(10, 10)); |
8129 | 8129 |
8130 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile( | 8130 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile( |
8131 gfx::Size(10, 10), gfx::Size(10, 10))); | 8131 gfx::Size(10, 10), gfx::Size(10, 10))); |
8132 Region empty_invalidation; | 8132 Region empty_invalidation; |
8133 const PictureLayerTilingSet* null_tiling_set = nullptr; | 8133 const PictureLayerTilingSet* null_tiling_set = nullptr; |
8134 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); | 8134 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set, |
8135 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); | 8135 host_impl_->device_viewport_size()); |
| 8136 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set, |
| 8137 host_impl_->device_viewport_size()); |
8136 | 8138 |
8137 layer->AddChild(nondraw_layer.Pass()); | 8139 layer->AddChild(nondraw_layer.Pass()); |
8138 host_impl_->pending_tree()->SetRootLayer(layer.Pass()); | 8140 host_impl_->pending_tree()->SetRootLayer(layer.Pass()); |
8139 | 8141 |
8140 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); | 8142 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); |
8141 LayerImpl* pending_layer = pending_tree->root_layer(); | 8143 LayerImpl* pending_layer = pending_tree->root_layer(); |
8142 FakePictureLayerImpl* pending_nondraw_layer = | 8144 FakePictureLayerImpl* pending_nondraw_layer = |
8143 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]); | 8145 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]); |
8144 | 8146 |
8145 pending_nondraw_layer->SetIsDrawnRenderSurfaceLayerListMember(false); | 8147 pending_nondraw_layer->SetIsDrawnRenderSurfaceLayerListMember(false); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8242 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10); | 8244 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10); |
8243 layer->SetBounds(gfx::Size(10, 10)); | 8245 layer->SetBounds(gfx::Size(10, 10)); |
8244 scoped_ptr<FakePictureLayerImpl> nondraw_layer = | 8246 scoped_ptr<FakePictureLayerImpl> nondraw_layer = |
8245 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12); | 8247 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12); |
8246 nondraw_layer->SetBounds(gfx::Size(10, 10)); | 8248 nondraw_layer->SetBounds(gfx::Size(10, 10)); |
8247 | 8249 |
8248 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile( | 8250 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile( |
8249 gfx::Size(10, 10), gfx::Size(10, 10))); | 8251 gfx::Size(10, 10), gfx::Size(10, 10))); |
8250 Region empty_invalidation; | 8252 Region empty_invalidation; |
8251 const PictureLayerTilingSet* null_tiling_set = nullptr; | 8253 const PictureLayerTilingSet* null_tiling_set = nullptr; |
8252 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); | 8254 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set, |
8253 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); | 8255 host_impl_->device_viewport_size()); |
| 8256 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set, |
| 8257 host_impl_->device_viewport_size()); |
8254 | 8258 |
8255 layer->AddChild(nondraw_layer.Pass()); | 8259 layer->AddChild(nondraw_layer.Pass()); |
8256 host_impl_->pending_tree()->SetRootLayer(layer.Pass()); | 8260 host_impl_->pending_tree()->SetRootLayer(layer.Pass()); |
8257 | 8261 |
8258 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); | 8262 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); |
8259 LayerImpl* pending_layer = pending_tree->root_layer(); | 8263 LayerImpl* pending_layer = pending_tree->root_layer(); |
8260 FakePictureLayerImpl* pending_nondraw_layer = | 8264 FakePictureLayerImpl* pending_nondraw_layer = |
8261 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]); | 8265 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]); |
8262 | 8266 |
8263 pending_nondraw_layer->SetIsDrawnRenderSurfaceLayerListMember(false); | 8267 pending_nondraw_layer->SetIsDrawnRenderSurfaceLayerListMember(false); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8475 // surface. | 8479 // surface. |
8476 EXPECT_EQ(0, num_lost_surfaces_); | 8480 EXPECT_EQ(0, num_lost_surfaces_); |
8477 host_impl_->DidLoseOutputSurface(); | 8481 host_impl_->DidLoseOutputSurface(); |
8478 EXPECT_EQ(1, num_lost_surfaces_); | 8482 EXPECT_EQ(1, num_lost_surfaces_); |
8479 host_impl_->DidLoseOutputSurface(); | 8483 host_impl_->DidLoseOutputSurface(); |
8480 EXPECT_LE(1, num_lost_surfaces_); | 8484 EXPECT_LE(1, num_lost_surfaces_); |
8481 } | 8485 } |
8482 | 8486 |
8483 } // namespace | 8487 } // namespace |
8484 } // namespace cc | 8488 } // namespace cc |
OLD | NEW |