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

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

Issue 2022563002: Remove display item scope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 7caef02988affdc21dd836d8cacddbf690210d22..b5ef1f7da55f1d936a8a5f0fb9ea7d7406e9d7fe 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -622,7 +622,7 @@ TEST_F(PaintControllerTest, CachedNestedSubsequenceUpdate)
TestDisplayItem(container1, DisplayItem::EndSubsequence));
}
-TEST_F(PaintControllerTest, Scope)
+TEST_F(PaintControllerTest, SkipCache)
{
FakeDisplayItemClient multicol("multicol");
FakeDisplayItemClient content("content");
@@ -634,13 +634,11 @@ TEST_F(PaintControllerTest, Scope)
drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 200, 100, 100));
- getPaintController().beginScope();
+ getPaintController().beginSkippingCache();
drawRect(context, content, foregroundDrawingType, rect1);
- getPaintController().endScope();
-
- getPaintController().beginScope();
drawRect(context, content, foregroundDrawingType, rect2);
- getPaintController().endScope();
+ getPaintController().endSkippingCache();
+
getPaintController().commitNewDisplayItems();
EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 3,
@@ -654,13 +652,11 @@ TEST_F(PaintControllerTest, Scope)
// Draw again with nothing invalidated.
EXPECT_TRUE(getPaintController().clientCacheIsValid(multicol));
drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 200, 100, 100));
- getPaintController().beginScope();
- drawRect(context, content, foregroundDrawingType, rect1);
- getPaintController().endScope();
- getPaintController().beginScope();
+ getPaintController().beginSkippingCache();
+ drawRect(context, content, foregroundDrawingType, rect1);
drawRect(context, content, foregroundDrawingType, rect2);
- getPaintController().endScope();
+ getPaintController().endSkippingCache();
EXPECT_DISPLAY_LIST(getPaintController().newDisplayItemList(), 3,
TestDisplayItem(multicol, DisplayItem::drawingTypeToCachedDrawingType(backgroundDrawingType)),
@@ -680,17 +676,11 @@ TEST_F(PaintControllerTest, Scope)
multicol.setDisplayItemsUncached();
drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 100, 100, 100));
- getPaintController().beginScope();
+ getPaintController().beginSkippingCache();
drawRect(context, content, foregroundDrawingType, rect1);
- getPaintController().endScope();
-
- getPaintController().beginScope();
drawRect(context, content, foregroundDrawingType, rect2);
- getPaintController().endScope();
-
- getPaintController().beginScope();
drawRect(context, content, foregroundDrawingType, rect3);
- getPaintController().endScope();
+ getPaintController().endSkippingCache();
// We should repaint everything on invalidation of the scope container.
EXPECT_DISPLAY_LIST(getPaintController().newDisplayItemList(), 4,
@@ -837,13 +827,12 @@ TEST_F(PaintControllerTest, IsNotSuitableForGpuRasterizationMultiplePicturesSing
{
FakeDisplayItemClient client("test client", LayoutRect(0, 0, 200, 100));
GraphicsContext context(getPaintController());
+ getPaintController().beginSkippingCache();
- for (int i = 0; i < 50; ++i) {
- getPaintController().beginScope();
+ for (int i = 0; i < 50; ++i)
drawPath(context, client, backgroundDrawingType, 50);
- getPaintController().endScope();
- }
+ getPaintController().endSkippingCache();
getPaintController().commitNewDisplayItems(LayoutSize());
EXPECT_FALSE(getPaintController().paintArtifact().isSuitableForGpuRasterization());
}

Powered by Google App Engine
This is Rietveld 408576698