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

Side by Side Diff: Source/core/rendering/shapes/RasterShape.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2013 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 RasterShapeIntervals(unsigned size, int offset = 0) 43 RasterShapeIntervals(unsigned size, int offset = 0)
44 : m_offset(offset) 44 : m_offset(offset)
45 { 45 {
46 m_intervalLists.resize(size); 46 m_intervalLists.resize(size);
47 } 47 }
48 48
49 const IntRect& bounds() const { return m_bounds; } 49 const IntRect& bounds() const { return m_bounds; }
50 bool isEmpty() const { return m_bounds.isEmpty(); } 50 bool isEmpty() const { return m_bounds.isEmpty(); }
51 void appendInterval(int y, int x1, int x2); 51 void appendInterval(int y, int x1, int x2);
52 52
53 void getIncludedIntervals(int y1, int y2, IntShapeIntervals& result) const;
54 void getExcludedIntervals(int y1, int y2, IntShapeIntervals& result) const; 53 void getExcludedIntervals(int y1, int y2, IntShapeIntervals& result) const;
55 bool firstIncludedIntervalY(int minY, const IntSize& minSize, LayoutUnit& re sult) const; 54
56 PassOwnPtr<RasterShapeIntervals> computeShapeMarginIntervals(int shapeMargin ) const; 55 PassOwnPtr<RasterShapeIntervals> computeShapeMarginIntervals(int shapeMargin ) const;
57 56
58 void buildBoundsPath(Path&) const; 57 void buildBoundsPath(Path&) const;
59 58
60 private: 59 private:
61 int size() const { return m_intervalLists.size(); } 60 int size() const { return m_intervalLists.size(); }
62 int offset() const { return m_offset; } 61 int offset() const { return m_offset; }
63 int minY() const { return -m_offset; } 62 int minY() const { return -m_offset; }
64 int maxY() const { return -m_offset + m_intervalLists.size(); } 63 int maxY() const { return -m_offset + m_intervalLists.size(); }
65 64
(...skipping 26 matching lines...) Expand all
92 class RasterShape FINAL : public Shape { 91 class RasterShape FINAL : public Shape {
93 WTF_MAKE_NONCOPYABLE(RasterShape); 92 WTF_MAKE_NONCOPYABLE(RasterShape);
94 public: 93 public:
95 RasterShape(PassOwnPtr<RasterShapeIntervals> intervals, const IntSize& margi nRectSize) 94 RasterShape(PassOwnPtr<RasterShapeIntervals> intervals, const IntSize& margi nRectSize)
96 : m_intervals(intervals) 95 : m_intervals(intervals)
97 , m_marginRectSize(marginRectSize) 96 , m_marginRectSize(marginRectSize)
98 { 97 {
99 } 98 }
100 99
101 virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE { return s tatic_cast<LayoutRect>(marginIntervals().bounds()); } 100 virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE { return s tatic_cast<LayoutRect>(marginIntervals().bounds()); }
102 virtual LayoutRect shapePaddingLogicalBoundingBox() const OVERRIDE { return static_cast<LayoutRect>(paddingIntervals().bounds()); }
103 virtual bool isEmpty() const OVERRIDE { return m_intervals->isEmpty(); } 101 virtual bool isEmpty() const OVERRIDE { return m_intervals->isEmpty(); }
104 virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH eight, SegmentList&) const OVERRIDE; 102 virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH eight, SegmentList&) const OVERRIDE;
105 virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH eight, SegmentList&) const OVERRIDE;
106 virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTo p, const FloatSize& minLogicalIntervalSize, LayoutUnit&) const OVERRIDE;
107 103
108 private: 104 private:
109 const RasterShapeIntervals& marginIntervals() const; 105 const RasterShapeIntervals& marginIntervals() const;
110 const RasterShapeIntervals& paddingIntervals() const;
111 106
112 OwnPtr<RasterShapeIntervals> m_intervals; 107 OwnPtr<RasterShapeIntervals> m_intervals;
113 mutable OwnPtr<RasterShapeIntervals> m_marginIntervals; 108 mutable OwnPtr<RasterShapeIntervals> m_marginIntervals;
114 IntSize m_marginRectSize; 109 IntSize m_marginRectSize;
115 }; 110 };
116 111
117 } // namespace WebCore 112 } // namespace WebCore
118 113
119 #endif // RasterShape_h 114 #endif // RasterShape_h
OLDNEW
« no previous file with comments | « Source/core/rendering/shapes/PolygonShape.cpp ('k') | Source/core/rendering/shapes/RasterShape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698