OLD | NEW |
---|---|
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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 | 351 |
352 TEST(PictureLayerTilingTest, ExpandRectOutOfBounds) { | 352 TEST(PictureLayerTilingTest, ExpandRectOutOfBounds) { |
353 gfx::Rect in(40, 50, 100, 200); | 353 gfx::Rect in(40, 50, 100, 200); |
354 gfx::Rect bounds(0, 0, 10, 10); | 354 gfx::Rect bounds(0, 0, 10, 10); |
355 int64 target_area = 400 * 400; | 355 int64 target_area = 400 * 400; |
356 gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( | 356 gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
357 in, target_area, bounds); | 357 in, target_area, bounds); |
358 EXPECT_TRUE(out.IsEmpty()); | 358 EXPECT_TRUE(out.IsEmpty()); |
359 } | 359 } |
360 | 360 |
361 TEST(PictureLayerTilingTest, EmptyStartingRect) { | |
enne (OOO)
2013/04/09 02:08:38
WTB unit test that makes sure this layer also has
danakj
2013/04/09 02:42:17
OK will do!
| |
362 // If a layer has a non-invertible transform, then the starting rect | |
363 // for the layer would be empty. | |
364 gfx::Rect in(40, 40, 0, 0); | |
365 gfx::Rect bounds(0, 0, 10, 10); | |
366 int64 target_area = 400 * 400; | |
367 gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( | |
368 in, target_area, bounds); | |
369 EXPECT_TRUE(out.IsEmpty()); | |
370 } | |
371 | |
361 } // namespace | 372 } // namespace |
362 } // namespace cc | 373 } // namespace cc |
OLD | NEW |