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

Side by Side Diff: cc/picture_layer_tiling_set_unittest.cc

Issue 11704002: cc: Generate tilings at other scales for impl-side painting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Create tilings during pinch Created 7 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_tiling_set.h" 5 #include "cc/picture_layer_tiling_set.h"
6 6
7 #include "cc/test/fake_picture_layer_tiling_client.h" 7 #include "cc/test/fake_picture_layer_tiling_client.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/size_conversions.h" 9 #include "ui/gfx/size_conversions.h"
10 10
(...skipping 11 matching lines...) Expand all
22 set.AddTiling(1.0, default_tile_size); 22 set.AddTiling(1.0, default_tile_size);
23 set.AddTiling(1.5, default_tile_size); 23 set.AddTiling(1.5, default_tile_size);
24 set.AddTiling(2.0, default_tile_size); 24 set.AddTiling(2.0, default_tile_size);
25 25
26 float contents_scale = 2.0; 26 float contents_scale = 2.0;
27 gfx::Size content_bounds( 27 gfx::Size content_bounds(
28 gfx::ToCeiledSize(gfx::ScaleSize(layer_bounds, contents_scale))); 28 gfx::ToCeiledSize(gfx::ScaleSize(layer_bounds, contents_scale)));
29 gfx::Rect content_rect(gfx::Point(), content_bounds); 29 gfx::Rect content_rect(gfx::Point(), content_bounds);
30 30
31 Region remaining(content_rect); 31 Region remaining(content_rect);
32 PictureLayerTilingSet::Iterator iter(&set, contents_scale, content_rect); 32 PictureLayerTilingSet::Iterator iter(
33 &set,
34 contents_scale,
35 content_rect,
36 contents_scale);
33 for (; iter; ++iter) { 37 for (; iter; ++iter) {
34 gfx::Rect geometry_rect = iter.geometry_rect(); 38 gfx::Rect geometry_rect = iter.geometry_rect();
35 EXPECT_TRUE(content_rect.Contains(geometry_rect)); 39 EXPECT_TRUE(content_rect.Contains(geometry_rect));
36 ASSERT_TRUE(remaining.Contains(geometry_rect)); 40 ASSERT_TRUE(remaining.Contains(geometry_rect));
37 remaining.Subtract(geometry_rect); 41 remaining.Subtract(geometry_rect);
38 42
39 // No tiles have resources, so no iter represents a real tile. 43 // No tiles have resources, so no iter represents a real tile.
40 EXPECT_FALSE(*iter); 44 EXPECT_FALSE(*iter);
41 } 45 }
42 EXPECT_TRUE(remaining.IsEmpty()); 46 EXPECT_TRUE(remaining.IsEmpty());
43 } 47 }
44 48
45 } // namespace 49 } // namespace
46 } // namespace cc 50 } // namespace cc
OLDNEW
« cc/picture_layer_tiling_set.cc ('K') | « cc/picture_layer_tiling_set.cc ('k') | cc/tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698