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

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

Issue 2876033005: Track slow paths in DisplayItemList (Closed)
Patch Set: 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 9904efebe90c1d1137e7c3922762ffbd90d109f1..97f539a71ac250410aa13444ac33a4c3f6610af3 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -1923,8 +1923,7 @@ TEST_F(PaintControllerTestBase, IsSuitableForGpuRasterizationSinglePath) {
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 1);
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_TRUE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 1);
}
TEST_F(PaintControllerTestBase,
@@ -1934,8 +1933,7 @@ TEST_F(PaintControllerTestBase,
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50);
}
TEST_F(PaintControllerTestBase,
@@ -1949,8 +1947,7 @@ TEST_F(PaintControllerTestBase,
GetPaintController().EndSkippingCache();
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50 * 50);
}
TEST_F(PaintControllerTestBase,
@@ -1961,9 +1958,7 @@ TEST_F(PaintControllerTestBase,
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50);
}
client.SetDisplayItemsUncached();
@@ -1972,9 +1967,7 @@ TEST_F(PaintControllerTestBase,
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50);
}
}
@@ -1986,18 +1979,14 @@ TEST_F(PaintControllerTestBase,
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50);
}
{
GraphicsContext context(GetPaintController());
DrawPath(context, client, kBackgroundDrawingType, 50);
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50);
}
}
@@ -2013,14 +2002,12 @@ TEST_F(
DrawPath(context, client, kBackgroundDrawingType, 50);
}
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50);
EXPECT_TRUE(
SubsequenceRecorder::UseCachedSubsequenceIfPossible(context, container));
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(
- GetPaintController().GetPaintArtifact().IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50);
#if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
DisplayItemClient::EndShouldKeepAliveAllClients();
@@ -2050,9 +2037,7 @@ TEST_F(PaintControllerTestBase,
for (int j = 0; j < 50; ++j)
GetPaintController().CreateAndAppend<EndClipPathDisplayItem>(client);
GetPaintController().CommitNewDisplayItems(LayoutSize());
- EXPECT_FALSE(GetPaintController()
- .GetPaintArtifact()
- .IsSuitableForGpuRasterization());
+ EXPECT_EQ(GetPaintController().GetPaintArtifact().NumSlowPaths(), 50 * i);
}
}

Powered by Google App Engine
This is Rietveld 408576698