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

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

Issue 2802443002: Compute rounded-ness of visual rects (Closed)
Patch Set: none 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 LayoutRect source((sourceObject)->localVisualRect()); \ 81 LayoutRect source((sourceObject)->localVisualRect()); \
82 source.moveBy((sourceObject)->paintOffset()); \ 82 source.moveBy((sourceObject)->paintOffset()); \
83 const auto& contentsProperties = \ 83 const auto& contentsProperties = \
84 *(ancestorObject)->contentsProperties(); \ 84 *(ancestorObject)->contentsProperties(); \
85 FloatRect actualFloatRect(source); \ 85 FloatClipRect actualFloatRect((FloatRect(source))); \
86 GeometryMapper::sourceToDestinationVisualRect( \ 86 GeometryMapper::sourceToDestinationVisualRect( \
87 *(sourceObject)->localBorderBoxProperties(), contentsProperties, \ 87 *(sourceObject)->localBorderBoxProperties(), contentsProperties, \
88 actualFloatRect); \ 88 actualFloatRect); \
89 LayoutRect actual(actualFloatRect); \ 89 LayoutRect actual(actualFloatRect.rect()); \
90 actual.moveBy(-(ancestorObject)->paintOffset()); \ 90 actual.moveBy(-(ancestorObject)->paintOffset()); \
91 SCOPED_TRACE("GeometryMapper: "); \ 91 SCOPED_TRACE("GeometryMapper: "); \
92 EXPECT_EQ(expected, actual); \ 92 EXPECT_EQ(expected, actual); \
93 } \ 93 } \
94 \ 94 \
95 if (slopFactor == LayoutUnit::max()) \ 95 if (slopFactor == LayoutUnit::max()) \
96 break; \ 96 break; \
97 LayoutRect slowPathRect = (sourceObject)->localVisualRect(); \ 97 LayoutRect slowPathRect = (sourceObject)->localVisualRect(); \
98 (sourceObject) \ 98 (sourceObject) \
99 ->mapToVisualRectInAncestorSpace(ancestorObject, slowPathRect); \ 99 ->mapToVisualRectInAncestorSpace(ancestorObject, slowPathRect); \
(...skipping 3272 matching lines...) Expand 10 before | Expand all | Expand 10 after
3372 "</svg>"); 3372 "</svg>");
3373 3373
3374 LayoutObject& svgRoot = *document().getElementById("svgroot")->layoutObject(); 3374 LayoutObject& svgRoot = *document().getElementById("svgroot")->layoutObject();
3375 const ObjectPaintProperties* svgRootProperties = svgRoot.paintProperties(); 3375 const ObjectPaintProperties* svgRootProperties = svgRoot.paintProperties();
3376 EXPECT_TRUE(svgRootProperties->effect()); 3376 EXPECT_TRUE(svgRootProperties->effect());
3377 EXPECT_EQ(EffectPaintPropertyNode::root(), 3377 EXPECT_EQ(EffectPaintPropertyNode::root(),
3378 svgRootProperties->effect()->parent()); 3378 svgRootProperties->effect()->parent());
3379 } 3379 }
3380 3380
3381 } // namespace blink 3381 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698