| Index: ui/views/view_unittest.cc
|
| diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
|
| index 4b50b319ad2556c1533674235ada984e97361550..5118d17a5e1793a8ea87902112182487ec936c0e 100644
|
| --- a/ui/views/view_unittest.cc
|
| +++ b/ui/views/view_unittest.cc
|
| @@ -525,7 +525,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
|
| @@ -547,7 +547,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_);
|
| @@ -563,14 +563,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_);
|
| @@ -578,7 +578,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));
|
| @@ -595,7 +595,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),
|
| @@ -625,7 +625,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_);
|
| @@ -642,14 +642,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_);
|
| @@ -657,7 +657,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));
|
| @@ -675,7 +675,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),
|
| @@ -709,14 +709,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_);
|
| @@ -749,14 +749,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_);
|
| @@ -793,14 +793,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_);
|
| @@ -825,14 +825,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_);
|
| @@ -869,14 +869,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_);
|
| @@ -901,14 +901,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_);
|
| @@ -945,14 +945,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_);
|
| @@ -977,14 +977,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_);
|
| @@ -1021,14 +1021,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_);
|
| @@ -1053,7 +1053,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();
|
| @@ -1061,7 +1061,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_);
|
| @@ -1109,7 +1109,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();
|
| @@ -1117,7 +1117,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_);
|
| @@ -1154,7 +1154,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();
|
| @@ -1163,7 +1163,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));
|
| @@ -1175,7 +1175,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.
|
| @@ -1190,7 +1190,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.
|
| @@ -1237,7 +1237,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);
|
|
|