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

Unified Diff: Source/core/paint/RenderDrawingRecorderTest.cpp

Issue 892293002: First version of new merge algorithm (not enabled yet) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase again again Created 5 years, 10 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 | « Source/core/paint/BlockPainter.cpp ('k') | Source/core/paint/SubtreeRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/RenderDrawingRecorderTest.cpp
diff --git a/Source/core/paint/RenderDrawingRecorderTest.cpp b/Source/core/paint/RenderDrawingRecorderTest.cpp
index f184b06a721d60ca65e07eb7024047551820ef58..7ed032879efdc4298f175d3f4672b6452d33db08 100644
--- a/Source/core/paint/RenderDrawingRecorderTest.cpp
+++ b/Source/core/paint/RenderDrawingRecorderTest.cpp
@@ -14,7 +14,6 @@
#include <gtest/gtest.h>
namespace blink {
-namespace {
class RenderDrawingRecorderTest : public RenderingTest {
public:
@@ -23,6 +22,7 @@ public:
protected:
RenderView* renderView() { return m_renderView; }
DisplayItemList& rootDisplayItemList() { return *renderView()->layer()->graphicsLayerBacking()->displayItemList(); }
+ const Vector<OwnPtr<DisplayItem>>& newPaintListBeforeUpdate() { return rootDisplayItemList().m_newPaints; }
private:
virtual void SetUp() override
@@ -36,6 +36,12 @@ private:
ASSERT_TRUE(m_renderView);
}
+ virtual void TearDown() override
+ {
+ RuntimeEnabledFeatures::setSlimmingPaintEnabled(false);
+ RuntimeEnabledFeatures::setSlimmingPaintDisplayItemCacheEnabled(false);
+ }
+
RenderView* m_renderView;
};
@@ -54,7 +60,7 @@ void drawRect(GraphicsContext* context, RenderView* renderer, PaintPhase phase,
}
-TEST_F(RenderDrawingRecorderTest, RenderDrawingRecorderTest_Nothing)
+TEST_F(RenderDrawingRecorderTest, Nothing)
{
GraphicsContext context(nullptr, &rootDisplayItemList());
FloatRect bound = renderView()->viewRect();
@@ -62,10 +68,10 @@ TEST_F(RenderDrawingRecorderTest, RenderDrawingRecorderTest_Nothing)
drawNothing(&context, renderView(), PaintPhaseForeground, bound);
rootDisplayItemList().endNewPaints();
- EXPECT_EQ((size_t)1, rootDisplayItemList().paintList().size());
+ EXPECT_EQ((size_t)0, rootDisplayItemList().paintList().size());
}
-TEST_F(RenderDrawingRecorderTest, RenderDrawingRecorderTest_Rect)
+TEST_F(RenderDrawingRecorderTest, Rect)
{
GraphicsContext context(nullptr, &rootDisplayItemList());
FloatRect bound = renderView()->viewRect();
@@ -75,22 +81,26 @@ TEST_F(RenderDrawingRecorderTest, RenderDrawingRecorderTest_Rect)
EXPECT_TRUE(rootDisplayItemList().paintList()[0]->isDrawing());
}
-TEST_F(RenderDrawingRecorderTest, RenderDrawingRecorderTest_Cached)
+TEST_F(RenderDrawingRecorderTest, Cached)
{
+ RuntimeEnabledFeatures::setSlimmingPaintDisplayItemCacheEnabled(true);
+
GraphicsContext context(nullptr, &rootDisplayItemList());
FloatRect bound = renderView()->viewRect();
drawNothing(&context, renderView(), PaintPhaseBlockBackground, bound);
drawRect(&context, renderView(), PaintPhaseForeground, bound);
rootDisplayItemList().endNewPaints();
- EXPECT_EQ((size_t)2, rootDisplayItemList().paintList().size());
- EXPECT_TRUE(rootDisplayItemList().paintList()[1]->isDrawing());
+ EXPECT_EQ((size_t)1, rootDisplayItemList().paintList().size());
+ EXPECT_TRUE(rootDisplayItemList().paintList()[0]->isDrawing());
drawNothing(&context, renderView(), PaintPhaseBlockBackground, bound);
drawRect(&context, renderView(), PaintPhaseForeground, bound);
+ EXPECT_EQ((size_t)2, newPaintListBeforeUpdate().size());
+ EXPECT_TRUE(newPaintListBeforeUpdate()[0]->isCached());
+ EXPECT_TRUE(newPaintListBeforeUpdate()[1]->isCached());
rootDisplayItemList().endNewPaints();
- EXPECT_EQ((size_t)2, rootDisplayItemList().paintList().size());
- EXPECT_TRUE(rootDisplayItemList().paintList()[1]->isDrawing());
+ EXPECT_EQ((size_t)1, rootDisplayItemList().paintList().size());
+ EXPECT_TRUE(rootDisplayItemList().paintList()[0]->isDrawing());
}
}
-}
« no previous file with comments | « Source/core/paint/BlockPainter.cpp ('k') | Source/core/paint/SubtreeRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698