Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 12854010: cc: Chromify animation_test_common (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing, rebased Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/occlusion_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 scoped_ptr<LayerTilingData> tilingData = LayerTilingData::Create(gfx::Si ze(10, 10), LayerTilingData::NO_BORDER_TEXELS); 1033 scoped_ptr<LayerTilingData> tilingData = LayerTilingData::Create(gfx::Si ze(10, 10), LayerTilingData::NO_BORDER_TEXELS);
1034 tilingData->SetBounds(bounds()); 1034 tilingData->SetBounds(bounds());
1035 SetTilingData(*tilingData.get()); 1035 SetTilingData(*tilingData.get());
1036 set_skips_draw(skipsDraw); 1036 set_skips_draw(skipsDraw);
1037 if (!tileMissing) { 1037 if (!tileMissing) {
1038 ResourceProvider::ResourceId resource = resourceProvider->CreateReso urce(gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny); 1038 ResourceProvider::ResourceId resource = resourceProvider->CreateReso urce(gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny);
1039 resourceProvider->AllocateForTesting(resource); 1039 resourceProvider->AllocateForTesting(resource);
1040 PushTileProperties(0, 0, resource, gfx::Rect(), false); 1040 PushTileProperties(0, 0, resource, gfx::Rect(), false);
1041 } 1041 }
1042 if (animating) 1042 if (animating)
1043 addAnimatedTransformToLayer(*this, 10, 3, 0); 1043 AddAnimatedTransformToLayer(this, 10, 3, 0);
1044 } 1044 }
1045 }; 1045 };
1046 1046
1047 TEST_F(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard) 1047 TEST_F(LayerTreeHostImplTest, prepareToDrawFailsWhenAnimationUsesCheckerboard)
1048 { 1048 {
1049 // When the texture is not missing, we draw as usual. 1049 // When the texture is not missing, we draw as usual.
1050 m_hostImpl->active_tree()->SetRootLayer(DidDrawCheckLayer::Create(m_hostImpl ->active_tree(), 1)); 1050 m_hostImpl->active_tree()->SetRootLayer(DidDrawCheckLayer::Create(m_hostImpl ->active_tree(), 1));
1051 DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->active _tree()->root_layer()); 1051 DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(m_hostImpl->active _tree()->root_layer());
1052 root->AddChild(MissingTextureAnimatingLayer::Create(m_hostImpl->active_tree( ), 2, false, false, true, m_hostImpl->resource_provider())); 1052 root->AddChild(MissingTextureAnimatingLayer::Create(m_hostImpl->active_tree( ), 2, false, false, true, m_hostImpl->resource_provider()));
1053 1053
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after
4344 EXPECT_EQ(gfx::Rect(0, 0, 100, 100).ToString(), renderPassQuad->rect.ToS tring()); 4344 EXPECT_EQ(gfx::Rect(0, 0, 100, 100).ToString(), renderPassQuad->rect.ToS tring());
4345 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), renderPassQuad->mas k_uv_rect.ToString()); 4345 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), renderPassQuad->mas k_uv_rect.ToString());
4346 4346
4347 m_hostImpl->DrawLayers(&frame, base::TimeTicks::Now()); 4347 m_hostImpl->DrawLayers(&frame, base::TimeTicks::Now());
4348 m_hostImpl->DidDrawAllLayers(frame); 4348 m_hostImpl->DidDrawAllLayers(frame);
4349 } 4349 }
4350 } 4350 }
4351 4351
4352 } // namespace 4352 } // namespace
4353 } // namespace cc 4353 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/occlusion_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698