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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 scoped_ptr<LayerTilingData> tilingData = LayerTilingData::Create(gfx::Si
ze(10, 10), LayerTilingData::NO_BORDER_TEXELS); | 1031 scoped_ptr<LayerTilingData> tilingData = LayerTilingData::Create(gfx::Si
ze(10, 10), LayerTilingData::NO_BORDER_TEXELS); |
1032 tilingData->SetBounds(bounds()); | 1032 tilingData->SetBounds(bounds()); |
1033 SetTilingData(*tilingData.get()); | 1033 SetTilingData(*tilingData.get()); |
1034 set_skips_draw(skipsDraw); | 1034 set_skips_draw(skipsDraw); |
1035 if (!tileMissing) { | 1035 if (!tileMissing) { |
1036 ResourceProvider::ResourceId resource = resourceProvider->CreateReso
urce(gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny); | 1036 ResourceProvider::ResourceId resource = resourceProvider->CreateReso
urce(gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny); |
1037 resourceProvider->AllocateForTesting(resource); | 1037 resourceProvider->AllocateForTesting(resource); |
1038 PushTileProperties(0, 0, resource, gfx::Rect(), false); | 1038 PushTileProperties(0, 0, resource, gfx::Rect(), false); |
1039 } | 1039 } |
1040 if (animating) | 1040 if (animating) |
1041 addAnimatedTransformToLayer(*this, 10, 3, 0); | 1041 AddAnimatedTransformToLayer(this, 10, 3, 0); |
1042 } | 1042 } |
1043 }; | 1043 }; |
1044 | 1044 |
1045 TEST_F(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard) | 1045 TEST_F(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard) |
1046 { | 1046 { |
1047 // When the texture is not missing, we draw as usual. | 1047 // When the texture is not missing, we draw as usual. |
1048 m_hostImpl->active_tree()->SetRootLayer(DidDrawCheckLayer::Create(m_hostImpl
->active_tree(), 1)); | 1048 m_hostImpl->active_tree()->SetRootLayer(DidDrawCheckLayer::Create(m_hostImpl
->active_tree(), 1)); |
1049 DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->active
_tree()->root_layer()); | 1049 DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->active
_tree()->root_layer()); |
1050 root->AddChild(MissingTextureAnimatingLayer::Create(m_hostImpl->active_tree(
), 2, false, false, true, m_hostImpl->resource_provider())); | 1050 root->AddChild(MissingTextureAnimatingLayer::Create(m_hostImpl->active_tree(
), 2, false, false, true, m_hostImpl->resource_provider())); |
1051 | 1051 |
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4342 EXPECT_EQ(gfx::Rect(0, 0, 100, 100).ToString(), renderPassQuad->rect.ToS
tring()); | 4342 EXPECT_EQ(gfx::Rect(0, 0, 100, 100).ToString(), renderPassQuad->rect.ToS
tring()); |
4343 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), renderPassQuad->mas
k_uv_rect.ToString()); | 4343 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), renderPassQuad->mas
k_uv_rect.ToString()); |
4344 | 4344 |
4345 m_hostImpl->DrawLayers(&frame, base::TimeTicks::Now()); | 4345 m_hostImpl->DrawLayers(&frame, base::TimeTicks::Now()); |
4346 m_hostImpl->DidDrawAllLayers(frame); | 4346 m_hostImpl->DidDrawAllLayers(frame); |
4347 } | 4347 } |
4348 } | 4348 } |
4349 | 4349 |
4350 } // namespace | 4350 } // namespace |
4351 } // namespace cc | 4351 } // namespace cc |
OLD | NEW |