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

Side by Side Diff: Source/core/rendering/shapes/Shape.h

Issue 216793009: Remove shape-padding (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove m_padding Created 6 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
« no previous file with comments | « Source/core/rendering/shapes/RectangleShape.cpp ('k') | Source/core/rendering/shapes/Shape.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 typedef Vector<LineSegment> SegmentList; 54 typedef Vector<LineSegment> SegmentList;
55 55
56 56
57 // A representation of a BasicShape that enables layout code to determine how to break a line up into segments 57 // A representation of a BasicShape that enables layout code to determine how to break a line up into segments
58 // that will fit within or around a shape. The line is defined by a pair of logi cal Y coordinates and the 58 // that will fit within or around a shape. The line is defined by a pair of logi cal Y coordinates and the
59 // computed segments are returned as pairs of logical X coordinates. The BasicSh ape itself is defined in 59 // computed segments are returned as pairs of logical X coordinates. The BasicSh ape itself is defined in
60 // physical coordinates. 60 // physical coordinates.
61 61
62 class Shape { 62 class Shape {
63 public: 63 public:
64 static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& lo gicalBoxSize, WritingMode, Length margin, Length padding); 64 static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& lo gicalBoxSize, WritingMode, Length margin);
65 static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const La youtRect& imageRect, const LayoutRect& marginRect, WritingMode, Length margin, L ength padding); 65 static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const La youtRect& imageRect, const LayoutRect& marginRect, WritingMode, Length margin);
66 static PassOwnPtr<Shape> createBoxShape(const RoundedRect&, WritingMode, con st Length& margin, const Length& padding); 66 static PassOwnPtr<Shape> createLayoutBoxShape(const RoundedRect&, WritingMod e, const Length& margin);
67 67
68 virtual ~Shape() { } 68 virtual ~Shape() { }
69 69
70 virtual LayoutRect shapeMarginLogicalBoundingBox() const = 0; 70 virtual LayoutRect shapeMarginLogicalBoundingBox() const = 0;
71 virtual LayoutRect shapePaddingLogicalBoundingBox() const = 0;
72 virtual bool isEmpty() const = 0; 71 virtual bool isEmpty() const = 0;
73 virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH eight, SegmentList&) const = 0;
74 virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH eight, SegmentList&) const = 0; 72 virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH eight, SegmentList&) const = 0;
75 virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTo p, const FloatSize& minLogicalIntervalSize, LayoutUnit& result) const = 0; 73
76 bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight ) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogical BoundingBox()); } 74 bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight ) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogical BoundingBox()); }
77 bool lineOverlapsShapePaddingBounds(LayoutUnit lineTop, LayoutUnit lineHeigh t) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapePaddingLogic alBoundingBox()); }
78 75
79 protected: 76 protected:
80 float shapeMargin() const { return m_margin; } 77 float shapeMargin() const { return m_margin; }
81 float shapePadding() const { return m_padding; }
82 78
83 private: 79 private:
84 bool lineOverlapsBoundingBox(LayoutUnit lineTop, LayoutUnit lineHeight, cons t LayoutRect& rect) const 80 bool lineOverlapsBoundingBox(LayoutUnit lineTop, LayoutUnit lineHeight, cons t LayoutRect& rect) const
85 { 81 {
86 if (rect.isEmpty()) 82 if (rect.isEmpty())
87 return false; 83 return false;
88 return (lineTop < rect.maxY() && lineTop + lineHeight > rect.y()) || (!l ineHeight && lineTop == rect.y()); 84 return (lineTop < rect.maxY() && lineTop + lineHeight > rect.y()) || (!l ineHeight && lineTop == rect.y());
89 } 85 }
90 86
91 WritingMode m_writingMode; 87 WritingMode m_writingMode;
92 float m_margin; 88 float m_margin;
93 float m_padding;
94 }; 89 };
95 90
96 } // namespace WebCore 91 } // namespace WebCore
97 92
98 #endif // Shape_h 93 #endif // Shape_h
OLDNEW
« no previous file with comments | « Source/core/rendering/shapes/RectangleShape.cpp ('k') | Source/core/rendering/shapes/Shape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698