OLD | NEW |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int size() const { return m_intervals.size(); } | 70 int size() const { return m_intervals.size(); } |
71 int offset() const { return m_offset; } | 71 int offset() const { return m_offset; } |
72 int minY() const { return -m_offset; } | 72 int minY() const { return -m_offset; } |
73 int maxY() const { return -m_offset + m_intervals.size(); } | 73 int maxY() const { return -m_offset + m_intervals.size(); } |
74 | 74 |
75 IntRect m_bounds; | 75 IntRect m_bounds; |
76 Vector<IntShapeInterval> m_intervals; | 76 Vector<IntShapeInterval> m_intervals; |
77 int m_offset; | 77 int m_offset; |
78 }; | 78 }; |
79 | 79 |
80 class RasterShape FINAL : public Shape { | 80 class RasterShape final : public Shape { |
81 WTF_MAKE_NONCOPYABLE(RasterShape); | 81 WTF_MAKE_NONCOPYABLE(RasterShape); |
82 public: | 82 public: |
83 RasterShape(PassOwnPtr<RasterShapeIntervals> intervals, const IntSize& margi
nRectSize) | 83 RasterShape(PassOwnPtr<RasterShapeIntervals> intervals, const IntSize& margi
nRectSize) |
84 : m_intervals(intervals) | 84 : m_intervals(intervals) |
85 , m_marginRectSize(marginRectSize) | 85 , m_marginRectSize(marginRectSize) |
86 { | 86 { |
87 m_intervals->initializeBounds(); | 87 m_intervals->initializeBounds(); |
88 } | 88 } |
89 | 89 |
90 virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE { return s
tatic_cast<LayoutRect>(marginIntervals().bounds()); } | 90 virtual LayoutRect shapeMarginLogicalBoundingBox() const override { return s
tatic_cast<LayoutRect>(marginIntervals().bounds()); } |
91 virtual bool isEmpty() const OVERRIDE { return m_intervals->isEmpty(); } | 91 virtual bool isEmpty() const override { return m_intervals->isEmpty(); } |
92 virtual LineSegment getExcludedInterval(LayoutUnit logicalTop, LayoutUnit lo
gicalHeight) const OVERRIDE; | 92 virtual LineSegment getExcludedInterval(LayoutUnit logicalTop, LayoutUnit lo
gicalHeight) const override; |
93 virtual void buildDisplayPaths(DisplayPaths& paths) const OVERRIDE | 93 virtual void buildDisplayPaths(DisplayPaths& paths) const override |
94 { | 94 { |
95 m_intervals->buildBoundsPath(paths.shape); | 95 m_intervals->buildBoundsPath(paths.shape); |
96 if (shapeMargin()) | 96 if (shapeMargin()) |
97 marginIntervals().buildBoundsPath(paths.marginShape); | 97 marginIntervals().buildBoundsPath(paths.marginShape); |
98 } | 98 } |
99 | 99 |
100 private: | 100 private: |
101 const RasterShapeIntervals& marginIntervals() const; | 101 const RasterShapeIntervals& marginIntervals() const; |
102 | 102 |
103 OwnPtr<RasterShapeIntervals> m_intervals; | 103 OwnPtr<RasterShapeIntervals> m_intervals; |
104 mutable OwnPtr<RasterShapeIntervals> m_marginIntervals; | 104 mutable OwnPtr<RasterShapeIntervals> m_marginIntervals; |
105 IntSize m_marginRectSize; | 105 IntSize m_marginRectSize; |
106 }; | 106 }; |
107 | 107 |
108 } // namespace blink | 108 } // namespace blink |
109 | 109 |
110 #endif // RasterShape_h | 110 #endif // RasterShape_h |
OLD | NEW |