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

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

Issue 2621193006: Reduce PropertyTreeState construction and copies (Closed)
Patch Set: Created 3 years, 11 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 | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
index 195f5a9b6c1b9f40696a6e092a5554d94ed17a0b..b66051133358b7eef5c5d95627e5bbc24c110338 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -77,8 +77,8 @@ void PaintPropertyTreeBuilderTest::TearDown() {
LayoutRect source((sourceLayoutObject)->localVisualRect()); \
source.moveBy((sourceLayoutObject)->paintOffset()); \
bool success = false; \
- auto contentsProperties = \
- (ancestorLayoutObject)->paintProperties()->contentsProperties(); \
+ const auto& contentsProperties = \
+ *(ancestorLayoutObject)->paintProperties()->contentsProperties(); \
LayoutRect actual = \
LayoutRect(geometryMapper.sourceToDestinationVisualRect( \
FloatRect(source), *(sourceLayoutObject) \
@@ -2350,7 +2350,7 @@ TEST_P(PaintPropertyTreeBuilderTest, OverflowClipContentsTreeState) {
EXPECT_EQ(frameContentClip(),
clipProperties->localBorderBoxProperties()->clip());
- auto contentsProperties = clipProperties->contentsProperties();
+ const auto& contentsProperties = *clipProperties->contentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), clipper->paintOffset());
EXPECT_EQ(framePreTranslation(), contentsProperties.transform());
EXPECT_EQ(clipProperties->overflowClip(), contentsProperties.clip());
@@ -2387,7 +2387,7 @@ TEST_P(PaintPropertyTreeBuilderTest, ContainsPaintContentsTreeState) {
EXPECT_EQ(frameContentClip(),
clipProperties->localBorderBoxProperties()->clip());
- auto contentsProperties = clipProperties->contentsProperties();
+ const auto& contentsProperties = *clipProperties->contentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), clipper->paintOffset());
EXPECT_EQ(framePreTranslation(), contentsProperties.transform());
EXPECT_EQ(clipProperties->overflowClip(), contentsProperties.clip());
@@ -2428,7 +2428,7 @@ TEST_P(PaintPropertyTreeBuilderTest, OverflowScrollContentsTreeState) {
EXPECT_EQ(frameContentClip(),
clipProperties->localBorderBoxProperties()->clip());
- auto contentsProperties = clipProperties->contentsProperties();
+ const auto& contentsProperties = *clipProperties->contentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), clipper->paintOffset());
EXPECT_EQ(clipProperties->scrollTranslation(),
contentsProperties.transform());
@@ -2513,7 +2513,7 @@ TEST_P(PaintPropertyTreeBuilderTest, CssClipContentsTreeState) {
EXPECT_EQ(clipProperties->cssClip(),
clipProperties->localBorderBoxProperties()->clip());
- auto contentsProperties = clipProperties->contentsProperties();
+ const auto& contentsProperties = *clipProperties->contentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), clipper->paintOffset());
EXPECT_EQ(framePreTranslation(), contentsProperties.transform());
EXPECT_EQ(clipProperties->cssClip(), contentsProperties.clip());
@@ -2548,7 +2548,8 @@ TEST_P(PaintPropertyTreeBuilderTest,
EXPECT_EQ(framePreTranslation(),
svgWithViewBoxProperties->localBorderBoxProperties()->transform());
- auto contentsProperties = svgWithViewBoxProperties->contentsProperties();
+ const auto& contentsProperties =
+ *svgWithViewBoxProperties->contentsProperties();
EXPECT_EQ(LayoutPoint(30, 20), svgWithViewBox.paintOffset());
EXPECT_EQ(framePreTranslation(), contentsProperties.transform());
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698