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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp

Issue 2876033005: Track slow paths in DisplayItemList (Closed)
Patch Set: danakj review Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
index 1cff8d5208adb8a037e70deeba18147794d5e841..19ac3e00cb962bb64a55a28ec34795ddf25fc7a8 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -1908,8 +1908,7 @@ TEST_F(PaintControllerTestBase, IsSuitableForGpuRasterizationSinglePath) {
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 1);
GetPaintController().CommitNewDisplayItems();
- EXPECT_TRUE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(1, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
TEST_F(PaintControllerTestBase,
@@ -1919,8 +1918,7 @@ TEST_F(PaintControllerTestBase,
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(50, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
TEST_F(PaintControllerTestBase,
@@ -1934,8 +1932,7 @@ TEST_F(PaintControllerTestBase,
GetPaintController().EndSkippingCache();
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(50 * 50, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
TEST_F(PaintControllerTestBase,
@@ -1946,9 +1943,7 @@ TEST_F(PaintControllerTestBase,
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(50, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
client.SetDisplayItemsUncached();
@@ -1957,9 +1952,7 @@ TEST_F(PaintControllerTestBase,
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(50, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
}
@@ -1971,18 +1964,14 @@ TEST_F(PaintControllerTestBase,
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(50, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
{
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(50, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
}
@@ -1998,14 +1987,12 @@ TEST_F(
DrawPath(context, client, kBackgroundDrawingType, 50);
}
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(50, GetPaintController().GetPaintArtifact().NumSlowPaths());
EXPECT_TRUE(
SubsequenceRecorder::UseCachedSubsequenceIfPossible(context, container));
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(50, GetPaintController().GetPaintArtifact().NumSlowPaths());
#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
DisplayItemClient::EndShouldKeepAliveAllClients();
@@ -2035,9 +2022,7 @@ TEST_F(PaintControllerTestBase,
for (int j = 0; j < 50; ++j)
GetPaintController().CreateAndAppend<EndClipPathDisplayItem>(client);
GetPaintController().CommitNewDisplayItems();
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(50 * i, GetPaintController().GetPaintArtifact().NumSlowPaths());
}
}

Powered by Google App Engine
This is Rietveld 408576698