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

Unified Diff: ui/views/view_unittest.cc

Issue 1484163002: Raster display item lists via a visual rect RTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 503eead6f6853e79ada14751076bb4c698695a82..0b8cbfeed1104f6f286fb29c2b22761f8e8b8e0c 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -520,7 +520,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
@@ -542,7 +542,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_);
@@ -558,14 +558,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_);
@@ -573,7 +573,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));
@@ -590,7 +590,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),
@@ -620,7 +620,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_);
@@ -637,14 +637,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_);
@@ -652,7 +652,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));
@@ -670,7 +670,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),
@@ -704,14 +704,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_);
@@ -744,14 +744,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_);
@@ -788,14 +788,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_);
@@ -820,14 +820,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_);
@@ -864,14 +864,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_);
@@ -896,14 +896,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_);
@@ -940,14 +940,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_);
@@ -972,14 +972,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_);
@@ -1016,14 +1016,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_);
@@ -1048,7 +1048,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();
@@ -1056,7 +1056,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_);
@@ -1104,7 +1104,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();
@@ -1112,7 +1112,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_);
@@ -1149,7 +1149,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();
@@ -1158,7 +1158,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));
@@ -1170,7 +1170,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.
@@ -1185,7 +1185,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.
@@ -1232,7 +1232,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);
« third_party/WebKit/Source/platform/graphics/paint/PaintController.h ('K') | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698