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_image_layer_impl.h" | 5 #include "cc/layers/picture_image_layer_impl.h" |
6 | 6 |
7 #include "cc/test/fake_impl_proxy.h" | 7 #include "cc/test/fake_impl_proxy.h" |
8 #include "cc/test/fake_layer_tree_host_impl.h" | 8 #include "cc/test/fake_layer_tree_host_impl.h" |
9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
10 #include "cc/test/fake_picture_layer_tiling_client.h" | 10 #include "cc/test/fake_picture_layer_tiling_client.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 : host_impl_(ImplSidePaintingSettings(), &proxy_) { | 28 : host_impl_(ImplSidePaintingSettings(), &proxy_) { |
29 tiling_client_.SetTileSize(ImplSidePaintingSettings().default_tile_size); | 29 tiling_client_.SetTileSize(ImplSidePaintingSettings().default_tile_size); |
30 host_impl_.CreatePendingTree(); | 30 host_impl_.CreatePendingTree(); |
31 host_impl_.InitializeRenderer(CreateFakeOutputSurface()); | 31 host_impl_.InitializeRenderer(CreateFakeOutputSurface()); |
32 } | 32 } |
33 | 33 |
34 scoped_ptr<TestablePictureImageLayerImpl> CreateLayer(int id) { | 34 scoped_ptr<TestablePictureImageLayerImpl> CreateLayer(int id) { |
35 TestablePictureImageLayerImpl* layer = | 35 TestablePictureImageLayerImpl* layer = |
36 new TestablePictureImageLayerImpl(host_impl_.pending_tree(), id); | 36 new TestablePictureImageLayerImpl(host_impl_.pending_tree(), id); |
37 layer->SetBounds(gfx::Size(100, 200)); | 37 layer->SetBounds(gfx::Size(100, 200)); |
38 layer->tilings_.reset(new PictureLayerTilingSet(&tiling_client_)); | 38 layer->tilings_.reset(new PictureLayerTilingSet(&tiling_client_, |
39 layer->tilings_->SetLayerBounds(layer->bounds()); | 39 layer->bounds())); |
40 layer->pile_ = tiling_client_.pile(); | 40 layer->pile_ = tiling_client_.pile(); |
41 return make_scoped_ptr(layer); | 41 return make_scoped_ptr(layer); |
42 } | 42 } |
43 | 43 |
44 private: | 44 private: |
45 FakeImplProxy proxy_; | 45 FakeImplProxy proxy_; |
46 FakeLayerTreeHostImpl host_impl_; | 46 FakeLayerTreeHostImpl host_impl_; |
47 FakePictureLayerTilingClient tiling_client_; | 47 FakePictureLayerTilingClient tiling_client_; |
48 }; | 48 }; |
49 | 49 |
(...skipping 22 matching lines...) Expand all Loading... |
72 gfx::Size content_bounds; | 72 gfx::Size content_bounds; |
73 layer->CalculateContentsScale(2.f, false, | 73 layer->CalculateContentsScale(2.f, false, |
74 &contents_scale_x, &contents_scale_y, | 74 &contents_scale_x, &contents_scale_y, |
75 &content_bounds); | 75 &content_bounds); |
76 | 76 |
77 EXPECT_TRUE(layer->AreVisibleResourcesReady()); | 77 EXPECT_TRUE(layer->AreVisibleResourcesReady()); |
78 } | 78 } |
79 | 79 |
80 } // namespace | 80 } // namespace |
81 } // namespace cc | 81 } // namespace cc |
OLD | NEW |