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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 : DidDrawCheckLayer(tree_impl, id) { | 1522 : DidDrawCheckLayer(tree_impl, id) { |
1523 scoped_ptr<LayerTilingData> tiling_data = | 1523 scoped_ptr<LayerTilingData> tiling_data = |
1524 LayerTilingData::Create(gfx::Size(10, 10), | 1524 LayerTilingData::Create(gfx::Size(10, 10), |
1525 LayerTilingData::NO_BORDER_TEXELS); | 1525 LayerTilingData::NO_BORDER_TEXELS); |
1526 tiling_data->SetBounds(bounds()); | 1526 tiling_data->SetBounds(bounds()); |
1527 SetTilingData(*tiling_data.get()); | 1527 SetTilingData(*tiling_data.get()); |
1528 set_skips_draw(skips_draw); | 1528 set_skips_draw(skips_draw); |
1529 if (!tile_missing) { | 1529 if (!tile_missing) { |
1530 ResourceProvider::ResourceId resource = | 1530 ResourceProvider::ResourceId resource = |
1531 resource_provider->CreateResource(gfx::Size(1, 1), | 1531 resource_provider->CreateResource(gfx::Size(1, 1), |
1532 GL_RGBA, | |
1533 GL_CLAMP_TO_EDGE, | 1532 GL_CLAMP_TO_EDGE, |
1534 ResourceProvider::TextureUsageAny); | 1533 ResourceProvider::TextureUsageAny, |
| 1534 RGBA_8888); |
1535 resource_provider->AllocateForTesting(resource); | 1535 resource_provider->AllocateForTesting(resource); |
1536 PushTileProperties(0, 0, resource, gfx::Rect(), false); | 1536 PushTileProperties(0, 0, resource, gfx::Rect(), false); |
1537 } | 1537 } |
1538 if (animating) | 1538 if (animating) |
1539 AddAnimatedTransformToLayer(this, 10.0, 3, 0); | 1539 AddAnimatedTransformToLayer(this, 10.0, 3, 0); |
1540 } | 1540 } |
1541 }; | 1541 }; |
1542 | 1542 |
1543 TEST_F(LayerTreeHostImplTest, PrepareToDrawFailsWhenAnimationUsesCheckerboard) { | 1543 TEST_F(LayerTreeHostImplTest, PrepareToDrawFailsWhenAnimationUsesCheckerboard) { |
1544 // When the texture is not missing, we draw as usual. | 1544 // When the texture is not missing, we draw as usual. |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2614 int id, | 2614 int id, |
2615 ResourceProvider* resource_provider) | 2615 ResourceProvider* resource_provider) |
2616 : LayerImpl(tree_impl, id), | 2616 : LayerImpl(tree_impl, id), |
2617 blend_(false), | 2617 blend_(false), |
2618 has_render_surface_(false), | 2618 has_render_surface_(false), |
2619 quads_appended_(false), | 2619 quads_appended_(false), |
2620 quad_rect_(5, 5, 5, 5), | 2620 quad_rect_(5, 5, 5, 5), |
2621 quad_visible_rect_(5, 5, 5, 5), | 2621 quad_visible_rect_(5, 5, 5, 5), |
2622 resource_id_(resource_provider->CreateResource( | 2622 resource_id_(resource_provider->CreateResource( |
2623 gfx::Size(1, 1), | 2623 gfx::Size(1, 1), |
2624 GL_RGBA, | |
2625 GL_CLAMP_TO_EDGE, | 2624 GL_CLAMP_TO_EDGE, |
2626 ResourceProvider::TextureUsageAny)) { | 2625 ResourceProvider::TextureUsageAny, |
| 2626 RGBA_8888)) { |
2627 resource_provider->AllocateForTesting(resource_id_); | 2627 resource_provider->AllocateForTesting(resource_id_); |
2628 SetAnchorPoint(gfx::PointF()); | 2628 SetAnchorPoint(gfx::PointF()); |
2629 SetBounds(gfx::Size(10, 10)); | 2629 SetBounds(gfx::Size(10, 10)); |
2630 SetContentBounds(gfx::Size(10, 10)); | 2630 SetContentBounds(gfx::Size(10, 10)); |
2631 SetDrawsContent(true); | 2631 SetDrawsContent(true); |
2632 } | 2632 } |
2633 | 2633 |
2634 bool blend_; | 2634 bool blend_; |
2635 bool has_render_surface_; | 2635 bool has_render_surface_; |
2636 bool quads_appended_; | 2636 bool quads_appended_; |
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5364 } | 5364 } |
5365 | 5365 |
5366 TEST_F(LayerTreeHostImplTest, TestRemoveRenderPasses) { | 5366 TEST_F(LayerTreeHostImplTest, TestRemoveRenderPasses) { |
5367 LayerTreeSettings settings; | 5367 LayerTreeSettings settings; |
5368 FakeOutputSurfaceClient output_surface_client; | 5368 FakeOutputSurfaceClient output_surface_client; |
5369 scoped_ptr<OutputSurface> output_surface(CreateOutputSurface()); | 5369 scoped_ptr<OutputSurface> output_surface(CreateOutputSurface()); |
5370 ASSERT_TRUE(output_surface->BindToClient(&output_surface_client)); | 5370 ASSERT_TRUE(output_surface->BindToClient(&output_surface_client)); |
5371 ASSERT_TRUE(output_surface->context_provider()); | 5371 ASSERT_TRUE(output_surface->context_provider()); |
5372 | 5372 |
5373 scoped_ptr<ResourceProvider> resource_provider = | 5373 scoped_ptr<ResourceProvider> resource_provider = |
5374 ResourceProvider::Create(output_surface.get(), 0); | 5374 ResourceProvider::Create(output_surface.get(), 0, false); |
5375 | 5375 |
5376 scoped_ptr<TestRenderer> renderer = TestRenderer::Create( | 5376 scoped_ptr<TestRenderer> renderer = TestRenderer::Create( |
5377 &settings, resource_provider.get(), output_surface.get(), &proxy_); | 5377 &settings, resource_provider.get(), output_surface.get(), &proxy_); |
5378 | 5378 |
5379 int test_case_index = 0; | 5379 int test_case_index = 0; |
5380 while (remove_render_passes_cases[test_case_index].name) { | 5380 while (remove_render_passes_cases[test_case_index].name) { |
5381 RenderPassRemovalTestData test_data; | 5381 RenderPassRemovalTestData test_data; |
5382 ConfigureRenderPassTestData( | 5382 ConfigureRenderPassTestData( |
5383 remove_render_passes_cases[test_case_index].init_script, | 5383 remove_render_passes_cases[test_case_index].init_script, |
5384 &test_data, | 5384 &test_data, |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6621 host_impl_.reset(); | 6621 host_impl_.reset(); |
6622 | 6622 |
6623 // The CopyOutputResult's callback was cancelled, the CopyOutputResult | 6623 // The CopyOutputResult's callback was cancelled, the CopyOutputResult |
6624 // released, and the texture deleted. | 6624 // released, and the texture deleted. |
6625 EXPECT_TRUE(context_provider->HasOneRef()); | 6625 EXPECT_TRUE(context_provider->HasOneRef()); |
6626 EXPECT_EQ(0u, context_provider->TestContext3d()->NumTextures()); | 6626 EXPECT_EQ(0u, context_provider->TestContext3d()->NumTextures()); |
6627 } | 6627 } |
6628 | 6628 |
6629 } // namespace | 6629 } // namespace |
6630 } // namespace cc | 6630 } // namespace cc |
OLD | NEW |