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

Side by Side Diff: cc/picture_layer_impl_unittest.cc

Issue 12221077: Fixing tile grid size used by cc:Picture to make it respect current tile configuration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix for picture_layer_impl_unittest Created 7 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/picture_layer_impl.h" 5 #include "cc/picture_layer_impl.h"
6 6
7 #include "cc/layer_tree_impl.h" 7 #include "cc/layer_tree_impl.h"
8 #include "cc/test/fake_content_layer_client.h" 8 #include "cc/test/fake_content_layer_client.h"
9 #include "cc/test/fake_impl_proxy.h" 9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 EXPECT_GE(x, 0); 83 EXPECT_GE(x, 0);
84 EXPECT_GE(y, 0); 84 EXPECT_GE(y, 0);
85 EXPECT_LT(x, tiling_.num_tiles_x()); 85 EXPECT_LT(x, tiling_.num_tiles_x());
86 EXPECT_LT(y, tiling_.num_tiles_y()); 86 EXPECT_LT(y, tiling_.num_tiles_y());
87 87
88 if (HasRecordingAt(x, y)) 88 if (HasRecordingAt(x, y))
89 return; 89 return;
90 gfx::Rect bounds(tiling().TileBounds(x, y)); 90 gfx::Rect bounds(tiling().TileBounds(x, y));
91 scoped_refptr<Picture> picture(Picture::Create(bounds)); 91 scoped_refptr<Picture> picture(Picture::Create(bounds));
92 FakeContentLayerClient client; 92 FakeContentLayerClient client;
93 picture->Record(&client, NULL); 93 picture->Record(&client, NULL, tiling().TileStride());
94 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); 94 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture);
95 EXPECT_TRUE(HasRecordingAt(x, y)); 95 EXPECT_TRUE(HasRecordingAt(x, y));
96 96
97 UpdateRecordedRegion(); 97 UpdateRecordedRegion();
98 } 98 }
99 99
100 void RemoveRecordingAt(int x, int y) { 100 void RemoveRecordingAt(int x, int y) {
101 EXPECT_GE(x, 0); 101 EXPECT_GE(x, 0);
102 EXPECT_GE(y, 0); 102 EXPECT_GE(y, 0);
103 EXPECT_LT(x, tiling_.num_tiles_x()); 103 EXPECT_LT(x, tiling_.num_tiles_x());
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); 599 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings);
600 ASSERT_EQ(3u, active_layer_->tilings().num_tilings()); 600 ASSERT_EQ(3u, active_layer_->tilings().num_tilings());
601 used_tilings.clear(); 601 used_tilings.clear();
602 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); 602 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings);
603 ASSERT_EQ(2u, active_layer_->tilings().num_tilings()); 603 ASSERT_EQ(2u, active_layer_->tilings().num_tilings());
604 604
605 } 605 }
606 606
607 } // namespace 607 } // namespace
608 } // namespace cc 608 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture.cc ('k') | cc/picture_pile.cc » ('j') | cc/picture_pile.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698