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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 : DidDrawCheckLayer(tree_impl, id) { | 1517 : DidDrawCheckLayer(tree_impl, id) { |
1518 scoped_ptr<LayerTilingData> tiling_data = | 1518 scoped_ptr<LayerTilingData> tiling_data = |
1519 LayerTilingData::Create(gfx::Size(10, 10), | 1519 LayerTilingData::Create(gfx::Size(10, 10), |
1520 LayerTilingData::NO_BORDER_TEXELS); | 1520 LayerTilingData::NO_BORDER_TEXELS); |
1521 tiling_data->SetBounds(bounds()); | 1521 tiling_data->SetBounds(bounds()); |
1522 SetTilingData(*tiling_data.get()); | 1522 SetTilingData(*tiling_data.get()); |
1523 set_skips_draw(skips_draw); | 1523 set_skips_draw(skips_draw); |
1524 if (!tile_missing) { | 1524 if (!tile_missing) { |
1525 ResourceProvider::ResourceId resource = | 1525 ResourceProvider::ResourceId resource = |
1526 resource_provider->CreateResource(gfx::Size(1, 1), | 1526 resource_provider->CreateResource(gfx::Size(1, 1), |
1527 GL_RGBA, | |
1528 GL_CLAMP_TO_EDGE, | 1527 GL_CLAMP_TO_EDGE, |
1529 ResourceProvider::TextureUsageAny); | 1528 ResourceProvider::TextureUsageAny, |
| 1529 RGBA_8888); |
1530 resource_provider->AllocateForTesting(resource); | 1530 resource_provider->AllocateForTesting(resource); |
1531 PushTileProperties(0, 0, resource, gfx::Rect(), false); | 1531 PushTileProperties(0, 0, resource, gfx::Rect(), false); |
1532 } | 1532 } |
1533 if (animating) | 1533 if (animating) |
1534 AddAnimatedTransformToLayer(this, 10.0, 3, 0); | 1534 AddAnimatedTransformToLayer(this, 10.0, 3, 0); |
1535 } | 1535 } |
1536 }; | 1536 }; |
1537 | 1537 |
1538 TEST_F(LayerTreeHostImplTest, PrepareToDrawFailsWhenAnimationUsesCheckerboard) { | 1538 TEST_F(LayerTreeHostImplTest, PrepareToDrawFailsWhenAnimationUsesCheckerboard) { |
1539 // When the texture is not missing, we draw as usual. | 1539 // When the texture is not missing, we draw as usual. |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2609 int id, | 2609 int id, |
2610 ResourceProvider* resource_provider) | 2610 ResourceProvider* resource_provider) |
2611 : LayerImpl(tree_impl, id), | 2611 : LayerImpl(tree_impl, id), |
2612 blend_(false), | 2612 blend_(false), |
2613 has_render_surface_(false), | 2613 has_render_surface_(false), |
2614 quads_appended_(false), | 2614 quads_appended_(false), |
2615 quad_rect_(5, 5, 5, 5), | 2615 quad_rect_(5, 5, 5, 5), |
2616 quad_visible_rect_(5, 5, 5, 5), | 2616 quad_visible_rect_(5, 5, 5, 5), |
2617 resource_id_(resource_provider->CreateResource( | 2617 resource_id_(resource_provider->CreateResource( |
2618 gfx::Size(1, 1), | 2618 gfx::Size(1, 1), |
2619 GL_RGBA, | |
2620 GL_CLAMP_TO_EDGE, | 2619 GL_CLAMP_TO_EDGE, |
2621 ResourceProvider::TextureUsageAny)) { | 2620 ResourceProvider::TextureUsageAny, |
| 2621 RGBA_8888)) { |
2622 resource_provider->AllocateForTesting(resource_id_); | 2622 resource_provider->AllocateForTesting(resource_id_); |
2623 SetAnchorPoint(gfx::PointF()); | 2623 SetAnchorPoint(gfx::PointF()); |
2624 SetBounds(gfx::Size(10, 10)); | 2624 SetBounds(gfx::Size(10, 10)); |
2625 SetContentBounds(gfx::Size(10, 10)); | 2625 SetContentBounds(gfx::Size(10, 10)); |
2626 SetDrawsContent(true); | 2626 SetDrawsContent(true); |
2627 } | 2627 } |
2628 | 2628 |
2629 bool blend_; | 2629 bool blend_; |
2630 bool has_render_surface_; | 2630 bool has_render_surface_; |
2631 bool quads_appended_; | 2631 bool quads_appended_; |
(...skipping 3984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6616 host_impl_.reset(); | 6616 host_impl_.reset(); |
6617 | 6617 |
6618 // The CopyOutputResult's callback was cancelled, the CopyOutputResult | 6618 // The CopyOutputResult's callback was cancelled, the CopyOutputResult |
6619 // released, and the texture deleted. | 6619 // released, and the texture deleted. |
6620 EXPECT_TRUE(context_provider->HasOneRef()); | 6620 EXPECT_TRUE(context_provider->HasOneRef()); |
6621 EXPECT_EQ(0u, context_provider->TestContext3d()->NumTextures()); | 6621 EXPECT_EQ(0u, context_provider->TestContext3d()->NumTextures()); |
6622 } | 6622 } |
6623 | 6623 |
6624 } // namespace | 6624 } // namespace |
6625 } // namespace cc | 6625 } // namespace cc |
OLD | NEW |