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

Unified Diff: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp

Issue 2185933003: Fix issues of display item client cache flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
index 6f0e06e53564bcb6c90491d8103468fb997f45af..13148f5d0160a27b84af428b528ccc8b5e4b1ff8 100644
--- a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
@@ -8,6 +8,7 @@
#include "core/layout/line/InlineTextBox.h"
#include "core/page/FocusController.h"
#include "core/paint/LayoutObjectDrawingRecorder.h"
+#include "core/paint/ObjectPaintProperties.h"
#include "core/paint/PaintLayerPainter.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/paint/DrawingDisplayItem.h"
@@ -63,4 +64,36 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout)
TestDisplayItem(secondTextBox, foregroundType));
}
+TEST_F(PaintControllerPaintTestForSlimmingPaintV2, ChunkIdClientCacheFlag)
+{
+ setBodyInnerHTML(
+ "<div id='div' style='width: 200px; height: 200px; opacity: 0.5'>"
+ " <div style='width: 100px; height: 100px; background-color: blue'></div>"
+ "</div>");
+ PaintLayer& htmlLayer = *toLayoutBoxModelObject(document().documentElement()->layoutObject())->layer();
+ LayoutBlock& div = *toLayoutBlock(getLayoutObjectByElementId("div"));
+ LayoutObject& subDiv = *div.firstChild();
+
+ EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 6,
+ TestDisplayItem(layoutView(), documentBackgroundType),
+ TestDisplayItem(htmlLayer, DisplayItem::Subsequence),
+ TestDisplayItem(div, DisplayItem::BeginCompositing),
+ TestDisplayItem(subDiv, backgroundType),
+ TestDisplayItem(div, DisplayItem::EndCompositing),
+ TestDisplayItem(htmlLayer, DisplayItem::EndSubsequence));
+
+ const EffectPaintPropertyNode* effectNode = div.objectPaintProperties()->effect();
+ EXPECT_EQ(0.5f, effectNode->opacity());
+ const PaintChunk& chunk = rootPaintController().paintChunks()[1];
+ EXPECT_EQ(*div.layer(), chunk.id->client);
+ EXPECT_EQ(effectNode, chunk.properties.effect.get());
+
+ EXPECT_FALSE(div.layer()->isJustCreated());
+ // Client used by only paint chunks and non-cachaeable display items but not by any
+ // cacheable display items won't be marked as validly cached.
+ EXPECT_FALSE(rootPaintController().clientCacheIsValid(*div.layer()));
+ EXPECT_FALSE(rootPaintController().clientCacheIsValid(div));
+ EXPECT_TRUE(rootPaintController().clientCacheIsValid(subDiv));
+}
+
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698