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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp

Issue 2793993003: Make GeometryMapper fully static (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintPropertyTreeBuilderTest.h" 5 #include "core/paint/PaintPropertyTreeBuilderTest.h"
6 6
7 #include "core/html/HTMLIFrameElement.h" 7 #include "core/html/HTMLIFrameElement.h"
8 #include "core/layout/LayoutTreeAsText.h" 8 #include "core/layout/LayoutTreeAsText.h"
9 #include "core/paint/ObjectPaintProperties.h" 9 #include "core/paint/ObjectPaintProperties.h"
10 #include "core/paint/PaintPropertyTreePrinter.h" 10 #include "core/paint/PaintPropertyTreePrinter.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 void PaintPropertyTreeBuilderTest::TearDown() { 72 void PaintPropertyTreeBuilderTest::TearDown() {
73 RenderingTest::TearDown(); 73 RenderingTest::TearDown();
74 74
75 Settings::setMockScrollbarsEnabled(false); 75 Settings::setMockScrollbarsEnabled(false);
76 } 76 }
77 77
78 #define CHECK_VISUAL_RECT(expected, sourceObject, ancestorObject, slopFactor) \ 78 #define CHECK_VISUAL_RECT(expected, sourceObject, ancestorObject, slopFactor) \
79 do { \ 79 do { \
80 if ((sourceObject)->hasLayer() && (ancestorObject)->hasLayer()) { \ 80 if ((sourceObject)->hasLayer() && (ancestorObject)->hasLayer()) { \
81 auto geometryMapper = GeometryMapper::create(); \
82 LayoutRect source((sourceObject)->localVisualRect()); \ 81 LayoutRect source((sourceObject)->localVisualRect()); \
83 source.moveBy((sourceObject)->paintOffset()); \ 82 source.moveBy((sourceObject)->paintOffset()); \
84 const auto& contentsProperties = \ 83 const auto& contentsProperties = \
85 *(ancestorObject)->contentsProperties(); \ 84 *(ancestorObject)->contentsProperties(); \
86 FloatRect actualFloatRect(source); \ 85 FloatRect actualFloatRect(source); \
87 geometryMapper->sourceToDestinationVisualRect( \ 86 GeometryMapper::sourceToDestinationVisualRect( \
88 *(sourceObject)->localBorderBoxProperties(), contentsProperties, \ 87 *(sourceObject)->localBorderBoxProperties(), contentsProperties, \
89 actualFloatRect); \ 88 actualFloatRect); \
90 LayoutRect actual(actualFloatRect); \ 89 LayoutRect actual(actualFloatRect); \
91 actual.moveBy(-(ancestorObject)->paintOffset()); \ 90 actual.moveBy(-(ancestorObject)->paintOffset()); \
92 SCOPED_TRACE("GeometryMapper: "); \ 91 SCOPED_TRACE("GeometryMapper: "); \
93 EXPECT_EQ(expected, actual); \ 92 EXPECT_EQ(expected, actual); \
94 } \ 93 } \
95 \ 94 \
96 if (slopFactor == LayoutUnit::max()) \ 95 if (slopFactor == LayoutUnit::max()) \
97 break; \ 96 break; \
(...skipping 3275 matching lines...) Expand 10 before | Expand all | Expand 10 after
3373 "</svg>"); 3372 "</svg>");
3374 3373
3375 LayoutObject& svgRoot = *document().getElementById("svgroot")->layoutObject(); 3374 LayoutObject& svgRoot = *document().getElementById("svgroot")->layoutObject();
3376 const ObjectPaintProperties* svgRootProperties = svgRoot.paintProperties(); 3375 const ObjectPaintProperties* svgRootProperties = svgRoot.paintProperties();
3377 EXPECT_TRUE(svgRootProperties->effect()); 3376 EXPECT_TRUE(svgRootProperties->effect());
3378 EXPECT_EQ(EffectPaintPropertyNode::root(), 3377 EXPECT_EQ(EffectPaintPropertyNode::root(),
3379 svgRootProperties->effect()->parent()); 3378 svgRootProperties->effect()->parent());
3380 } 3379 }
3381 3380
3382 } // namespace blink 3381 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698