| Index: ui/views/view_unittest.cc
|
| diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
|
| index 38f55bd11bda6778d8f6f43e028191d443c64df6..e9af12ad5a964d0a67207326d15e99dbd2163f12 100644
|
| --- a/ui/views/view_unittest.cc
|
| +++ b/ui/views/view_unittest.cc
|
| @@ -526,7 +526,7 @@ TEST_F(ViewTest, PaintEmptyView) {
|
| // Paint "everything".
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
|
|
| // The empty view has nothing to paint so it doesn't try build a cache, nor do
|
| @@ -548,7 +548,7 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCache) {
|
| gfx::Rect pixel_rect = gfx::Rect(1, 1);
|
| float device_scale_factor = 1.f;
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect));
|
| EXPECT_TRUE(v1->did_paint_);
|
| @@ -564,14 +564,14 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCache) {
|
| list->VisualRectForTesting(item_index));
|
|
|
| // If invalidation doesn't intersect v1, we paint with the cache.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect));
|
| EXPECT_FALSE(v1->did_paint_);
|
| v1->Reset();
|
|
|
| // If invalidation does intersect v1, we don't paint with the cache.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, v1->bounds()));
|
| EXPECT_TRUE(v1->did_paint_);
|
| @@ -579,7 +579,7 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCache) {
|
|
|
| // Moving the view should still use the cache when the invalidation doesn't
|
| // intersect v1.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| v1->SetX(9);
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect));
|
| @@ -596,7 +596,7 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCache) {
|
|
|
| // Moving the view should not use the cache when painting without
|
| // invalidation.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| v1->SetX(8);
|
| root_view->Paint(ui::PaintContext(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect),
|
| @@ -626,7 +626,7 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCacheInRTL) {
|
| gfx::Rect pixel_rect = gfx::Rect(1, 1);
|
| float device_scale_factor = 1.f;
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect));
|
| EXPECT_TRUE(v1->did_paint_);
|
| @@ -643,14 +643,14 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCacheInRTL) {
|
| list->VisualRectForTesting(item_index));
|
|
|
| // If invalidation doesn't intersect v1, we paint with the cache.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect));
|
| EXPECT_FALSE(v1->did_paint_);
|
| v1->Reset();
|
|
|
| // If invalidation does intersect v1, we don't paint with the cache.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, v1->bounds()));
|
| EXPECT_TRUE(v1->did_paint_);
|
| @@ -658,7 +658,7 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCacheInRTL) {
|
|
|
| // Moving the view should still use the cache when the invalidation doesn't
|
| // intersect v1.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| v1->SetX(9);
|
| root_view->Paint(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect));
|
| @@ -676,7 +676,7 @@ TEST_F(ViewTest, PaintWithMovedViewUsesCacheInRTL) {
|
|
|
| // Moving the view should not use the cache when painting without
|
| // invalidation.
|
| - list = cc::DisplayItemList::Create(pixel_rect, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| v1->SetX(8);
|
| root_view->Paint(ui::PaintContext(
|
| ui::PaintContext(list.get(), device_scale_factor, pixel_rect),
|
| @@ -710,14 +710,14 @@ TEST_F(ViewTest, PaintWithUnknownInvalidation) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(1, 1);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| // With a known invalidation, v1 and v2 are not painted.
|
| EXPECT_FALSE(v1->did_paint_);
|
| @@ -750,14 +750,14 @@ TEST_F(ViewTest, PaintContainsChildren) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(25, 26);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -794,14 +794,14 @@ TEST_F(ViewTest, PaintContainsChildrenInRTL) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(25, 26);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -826,14 +826,14 @@ TEST_F(ViewTest, PaintIntersectsChildren) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(9, 10, 5, 6);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -870,14 +870,14 @@ TEST_F(ViewTest, PaintIntersectsChildrenInRTL) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(2, 10, 5, 6);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -902,14 +902,14 @@ TEST_F(ViewTest, PaintIntersectsChildButNotGrandChild) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(9, 10, 2, 3);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -946,14 +946,14 @@ TEST_F(ViewTest, PaintIntersectsChildButNotGrandChildInRTL) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(2, 10, 2, 3);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -978,14 +978,14 @@ TEST_F(ViewTest, PaintIntersectsNoChildren) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(9, 10, 2, 1);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -1022,14 +1022,14 @@ TEST_F(ViewTest, PaintIntersectsNoChildrenInRTL) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
|
|
| gfx::Rect paint_area(2, 10, 2, 1);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -1054,7 +1054,7 @@ TEST_F(ViewTest, PaintIntersectsOneChild) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
| @@ -1062,7 +1062,7 @@ TEST_F(ViewTest, PaintIntersectsOneChild) {
|
| // Intersects with the second child only.
|
| gfx::Rect paint_area(3, 3, 1, 2);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -1110,7 +1110,7 @@ TEST_F(ViewTest, PaintIntersectsOneChildInRTL) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
| @@ -1118,7 +1118,7 @@ TEST_F(ViewTest, PaintIntersectsOneChildInRTL) {
|
| // Intersects with the first child only.
|
| gfx::Rect paint_area(3, 10, 1, 2);
|
| gfx::Rect root_area(root_view->size());
|
| - list = cc::DisplayItemList::Create(root_area, cc::DisplayItemListSettings());
|
| + list = cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| EXPECT_FALSE(v1->did_paint_);
|
| EXPECT_FALSE(v2->did_paint_);
|
| @@ -1155,7 +1155,7 @@ TEST_F(ViewTest, PaintInPromotedToLayer) {
|
| // invalidation.
|
| gfx::Rect first_paint(1, 1);
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(first_paint, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| v1->Paint(ui::PaintContext(list.get(), 1.f, first_paint));
|
| v1->Reset();
|
| v2->Reset();
|
| @@ -1164,7 +1164,7 @@ TEST_F(ViewTest, PaintInPromotedToLayer) {
|
| gfx::Rect paint_area(25, 26);
|
| gfx::Rect view_area(root_view->size());
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(view_area, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| // The promoted views are not painted as they are separate paint roots.
|
| root_view->Paint(ui::PaintContext(list.get(), 1.f, paint_area));
|
| @@ -1176,7 +1176,7 @@ TEST_F(ViewTest, PaintInPromotedToLayer) {
|
| gfx::Rect paint_area(1, 1);
|
| gfx::Rect view_area(v1->size());
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(view_area, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| // The |v1| view is painted. If it used its offset incorrect, it would think
|
| // its at (10,11) instead of at (0,0) since it is the paint root.
|
| @@ -1191,7 +1191,7 @@ TEST_F(ViewTest, PaintInPromotedToLayer) {
|
| gfx::Rect paint_area(3, 3, 1, 2);
|
| gfx::Rect view_area(v1->size());
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(view_area, cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
|
|
| // The |v2| view is painted also. If it used its offset incorrect, it would
|
| // think its at (13,15) instead of at (3,4) since |v1| is the paint root.
|
| @@ -1238,7 +1238,7 @@ TEST_F(ViewTest, PaintLocalBounds) {
|
| EXPECT_EQ(gfx::Rect(0, 1000, 100, 100), v1->GetVisibleBounds());
|
|
|
| scoped_refptr<cc::DisplayItemList> list =
|
| - cc::DisplayItemList::Create(gfx::Rect(), cc::DisplayItemListSettings());
|
| + cc::DisplayItemList::Create(cc::DisplayItemListSettings());
|
| ui::PaintContext context(list.get(), 1.f, gfx::Rect());
|
|
|
| v1->Paint(context);
|
|
|