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

Unified Diff: Source/core/rendering/exclusions/ExclusionShapeInfo.h

Issue 14892005: [CSS Exclusions] ExclusionShape bounding box methods should return LayoutRects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reverted LineSegment logicalLeft,Right type change Created 7 years, 7 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
Index: Source/core/rendering/exclusions/ExclusionShapeInfo.h
diff --git a/Source/core/rendering/exclusions/ExclusionShapeInfo.h b/Source/core/rendering/exclusions/ExclusionShapeInfo.h
index c81aab85243dd23cc1e8f76b7f941d37b5e38d4c..dc9e35d7baa2db70d320eb7029736596f24618ad 100644
--- a/Source/core/rendering/exclusions/ExclusionShapeInfo.h
+++ b/Source/core/rendering/exclusions/ExclusionShapeInfo.h
@@ -62,7 +62,7 @@ private:
}
};
-template<class RenderType, ExclusionShapeValue* (RenderStyle::*shapeGetter)() const, void (ExclusionShape::*intervalGetter)(float, float, SegmentList&) const>
+template<class RenderType, ExclusionShapeValue* (RenderStyle::*shapeGetter)() const, void (ExclusionShape::*intervalGetter)(LayoutUnit, LayoutUnit, SegmentList&) const>
class ExclusionShapeInfo {
WTF_MAKE_FAST_ALLOCATED;
public:
@@ -84,8 +84,8 @@ public:
virtual bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight);
- LayoutUnit shapeLogicalTop() const { return floatLogicalTopToLayoutUnit(computedShapeLogicalBoundingBox().y()) + logicalTopOffset(); }
- LayoutUnit shapeLogicalBottom() const { return floatLogicalBottomToLayoutUnit(computedShapeLogicalBoundingBox().maxY()) + logicalTopOffset(); }
+ LayoutUnit shapeLogicalTop() const { return computedShapeLogicalBoundingBox().y() + logicalTopOffset(); }
+ LayoutUnit shapeLogicalBottom() const { return computedShapeLogicalBoundingBox().maxY() + logicalTopOffset(); }
LayoutUnit shapeLogicalLeft() const { return computedShapeLogicalBoundingBox().x() + logicalLeftOffset(); }
LayoutUnit shapeLogicalRight() const { return computedShapeLogicalBoundingBox().maxX() + logicalLeftOffset(); }
LayoutUnit shapeLogicalWidth() const { return computedShapeLogicalBoundingBox().width(); }
@@ -104,11 +104,7 @@ protected:
ExclusionShapeInfo(const RenderType* renderer): m_renderer(renderer) { }
const ExclusionShape* computedShape() const;
- virtual FloatRect computedShapeLogicalBoundingBox() const = 0;
-
- // Use ceil and floor to ensure that the returned LayoutUnit value is within the shape's bounds.
- LayoutUnit floatLogicalTopToLayoutUnit(float logicalTop) const { return LayoutUnit::fromFloatCeil(logicalTop); }
- LayoutUnit floatLogicalBottomToLayoutUnit(float logicalBottom) const { return LayoutUnit::fromFloatFloor(logicalBottom); }
+ virtual LayoutRect computedShapeLogicalBoundingBox() const = 0;
LayoutUnit logicalTopOffset() const;
LayoutUnit logicalLeftOffset() const { return m_renderer->style()->boxSizing() == CONTENT_BOX ? m_renderer->borderStart() + m_renderer->paddingStart() : LayoutUnit(); }
« no previous file with comments | « Source/core/rendering/exclusions/ExclusionShape.cpp ('k') | Source/core/rendering/exclusions/ExclusionShapeInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698