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

Side by Side Diff: cc/resources/picture_layer_tiling_unittest.cc

Issue 13051003: cpplint.py pass on cc/(base|debug|quads|resources)/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix prioritized_resource_unittest 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/resources/picture_layer_tiling_set_unittest.cc ('k') | cc/resources/picture_pile.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 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/resources/picture_layer_tiling.h" 5 #include "cc/resources/picture_layer_tiling.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/rect_conversions.h" 9 #include "ui/gfx/rect_conversions.h"
10 #include "ui/gfx/size_conversions.h" 10 #include "ui/gfx/size_conversions.h"
(...skipping 27 matching lines...) Expand all
38 // back to floating point texture coordinates. 38 // back to floating point texture coordinates.
39 float dest_to_contents_scale = tiling_->contents_scale() / rect_scale; 39 float dest_to_contents_scale = tiling_->contents_scale() / rect_scale;
40 ASSERT_LE(dest_to_contents_scale, 2.0); 40 ASSERT_LE(dest_to_contents_scale, 2.0);
41 41
42 Region remaining = expect_rect; 42 Region remaining = expect_rect;
43 for (PictureLayerTiling::Iterator iter(tiling_.get(), 43 for (PictureLayerTiling::Iterator iter(tiling_.get(),
44 rect_scale, 44 rect_scale,
45 request_rect); 45 request_rect);
46 iter; 46 iter;
47 ++iter) { 47 ++iter) {
48
49 // Geometry cannot overlap previous geometry at all 48 // Geometry cannot overlap previous geometry at all
50 gfx::Rect geometry = iter.geometry_rect(); 49 gfx::Rect geometry = iter.geometry_rect();
51 EXPECT_TRUE(expect_rect.Contains(geometry)); 50 EXPECT_TRUE(expect_rect.Contains(geometry));
52 EXPECT_TRUE(remaining.Contains(geometry)); 51 EXPECT_TRUE(remaining.Contains(geometry));
53 remaining.Subtract(geometry); 52 remaining.Subtract(geometry);
54 53
55 // Sanity check that texture coords are within the texture rect. 54 // Sanity check that texture coords are within the texture rect.
56 gfx::RectF texture_rect = iter.texture_rect(); 55 gfx::RectF texture_rect = iter.texture_rect();
57 EXPECT_GE(texture_rect.x(), 0); 56 EXPECT_GE(texture_rect.x(), 0);
58 EXPECT_GE(texture_rect.y(), 0); 57 EXPECT_GE(texture_rect.y(), 0);
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 gfx::Rect in(40, 50, 100, 200); 354 gfx::Rect in(40, 50, 100, 200);
356 gfx::Rect bounds(0, 0, 10, 10); 355 gfx::Rect bounds(0, 0, 10, 10);
357 int64 target_area = 400 * 400; 356 int64 target_area = 400 * 400;
358 gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( 357 gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy(
359 in, target_area, bounds); 358 in, target_area, bounds);
360 EXPECT_TRUE(out.IsEmpty()); 359 EXPECT_TRUE(out.IsEmpty());
361 } 360 }
362 361
363 } // namespace 362 } // namespace
364 } // namespace cc 363 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_set_unittest.cc ('k') | cc/resources/picture_pile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698