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 <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 SetAnchorPoint(gfx::PointF()); | 1531 SetAnchorPoint(gfx::PointF()); |
1532 SetBounds(gfx::Size(10, 10)); | 1532 SetBounds(gfx::Size(10, 10)); |
1533 SetContentBounds(gfx::Size(10, 10)); | 1533 SetContentBounds(gfx::Size(10, 10)); |
1534 SetDrawsContent(true); | 1534 SetDrawsContent(true); |
1535 set_skips_draw(false); | 1535 set_skips_draw(false); |
1536 draw_properties().visible_content_rect = gfx::Rect(0, 0, 10, 10); | 1536 draw_properties().visible_content_rect = gfx::Rect(0, 0, 10, 10); |
1537 | 1537 |
1538 scoped_ptr<LayerTilingData> tiler = | 1538 scoped_ptr<LayerTilingData> tiler = |
1539 LayerTilingData::Create(gfx::Size(100, 100), | 1539 LayerTilingData::Create(gfx::Size(100, 100), |
1540 LayerTilingData::HAS_BORDER_TEXELS); | 1540 LayerTilingData::HAS_BORDER_TEXELS); |
1541 tiler->SetBounds(content_bounds()); | 1541 tiler->SetTilingRect(gfx::Rect(content_bounds())); |
1542 SetTilingData(*tiler.get()); | 1542 SetTilingData(*tiler.get()); |
1543 } | 1543 } |
1544 | 1544 |
1545 private: | 1545 private: |
1546 bool will_draw_returns_false_; | 1546 bool will_draw_returns_false_; |
1547 bool will_draw_called_; | 1547 bool will_draw_called_; |
1548 bool append_quads_called_; | 1548 bool append_quads_called_; |
1549 bool did_draw_called_; | 1549 bool did_draw_called_; |
1550 }; | 1550 }; |
1551 | 1551 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 MissingTextureAnimatingLayer(LayerTreeImpl* tree_impl, | 1742 MissingTextureAnimatingLayer(LayerTreeImpl* tree_impl, |
1743 int id, | 1743 int id, |
1744 bool tile_missing, | 1744 bool tile_missing, |
1745 bool skips_draw, | 1745 bool skips_draw, |
1746 bool animating, | 1746 bool animating, |
1747 ResourceProvider* resource_provider) | 1747 ResourceProvider* resource_provider) |
1748 : DidDrawCheckLayer(tree_impl, id), tile_missing_(tile_missing) { | 1748 : DidDrawCheckLayer(tree_impl, id), tile_missing_(tile_missing) { |
1749 scoped_ptr<LayerTilingData> tiling_data = | 1749 scoped_ptr<LayerTilingData> tiling_data = |
1750 LayerTilingData::Create(gfx::Size(10, 10), | 1750 LayerTilingData::Create(gfx::Size(10, 10), |
1751 LayerTilingData::NO_BORDER_TEXELS); | 1751 LayerTilingData::NO_BORDER_TEXELS); |
1752 tiling_data->SetBounds(bounds()); | 1752 tiling_data->SetTilingRect(gfx::Rect(bounds())); |
1753 SetTilingData(*tiling_data.get()); | 1753 SetTilingData(*tiling_data.get()); |
1754 set_skips_draw(skips_draw); | 1754 set_skips_draw(skips_draw); |
1755 if (!tile_missing) { | 1755 if (!tile_missing) { |
1756 ResourceProvider::ResourceId resource = | 1756 ResourceProvider::ResourceId resource = |
1757 resource_provider->CreateResource(gfx::Size(1, 1), | 1757 resource_provider->CreateResource(gfx::Size(1, 1), |
1758 GL_CLAMP_TO_EDGE, | 1758 GL_CLAMP_TO_EDGE, |
1759 ResourceProvider::TextureUsageAny, | 1759 ResourceProvider::TextureUsageAny, |
1760 RGBA_8888); | 1760 RGBA_8888); |
1761 resource_provider->AllocateForTesting(resource); | 1761 resource_provider->AllocateForTesting(resource); |
1762 PushTileProperties(0, 0, resource, gfx::Rect(), false); | 1762 PushTileProperties(0, 0, resource, gfx::Rect(), false); |
(...skipping 4509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6272 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, | 6272 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, |
6273 300u * 1024u * 1024u); | 6273 300u * 1024u * 1024u); |
6274 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, | 6274 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, |
6275 150u * 1024u * 1024u); | 6275 150u * 1024u * 1024u); |
6276 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, | 6276 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, |
6277 75u * 1024u * 1024u); | 6277 75u * 1024u * 1024u); |
6278 } | 6278 } |
6279 | 6279 |
6280 } // namespace | 6280 } // namespace |
6281 } // namespace cc | 6281 } // namespace cc |
OLD | NEW |