| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 void setTopRight(const IntSize& size) { m_topRight = size; } | 52 void setTopRight(const IntSize& size) { m_topRight = size; } |
| 53 void setBottomLeft(const IntSize& size) { m_bottomLeft = size; } | 53 void setBottomLeft(const IntSize& size) { m_bottomLeft = size; } |
| 54 void setBottomRight(const IntSize& size) { m_bottomRight = size; } | 54 void setBottomRight(const IntSize& size) { m_bottomRight = size; } |
| 55 const IntSize& topLeft() const { return m_topLeft; } | 55 const IntSize& topLeft() const { return m_topLeft; } |
| 56 const IntSize& topRight() const { return m_topRight; } | 56 const IntSize& topRight() const { return m_topRight; } |
| 57 const IntSize& bottomLeft() const { return m_bottomLeft; } | 57 const IntSize& bottomLeft() const { return m_bottomLeft; } |
| 58 const IntSize& bottomRight() const { return m_bottomRight; } | 58 const IntSize& bottomRight() const { return m_bottomRight; } |
| 59 | 59 |
| 60 bool isZero() const; | 60 bool isZero() const; |
| 61 | 61 |
| 62 void includeLogicalEdges(const Radii& edges, bool isHorizontal, bool inc
ludeLogicalLeftEdge, bool includeLogicalRightEdge); | 62 void includeLogicalEdges(const Radii& edges, bool includeLogicalLeftEdge
, bool includeLogicalRightEdge); |
| 63 void excludeLogicalEdges(bool isHorizontal, bool excludeLogicalLeftEdge,
bool excludeLogicalRightEdge); | |
| 64 | 63 |
| 65 void scale(float factor); | 64 void scale(float factor); |
| 66 void expand(int topWidth, int bottomWidth, int leftWidth, int rightWidth
); | 65 void expand(int topWidth, int bottomWidth, int leftWidth, int rightWidth
); |
| 67 void expand(int size) { expand(size, size, size, size); } | 66 void expand(int size) { expand(size, size, size, size); } |
| 68 void shrink(int topWidth, int bottomWidth, int leftWidth, int rightWidth
) { expand(-topWidth, -bottomWidth, -leftWidth, -rightWidth); } | 67 void shrink(int topWidth, int bottomWidth, int leftWidth, int rightWidth
) { expand(-topWidth, -bottomWidth, -leftWidth, -rightWidth); } |
| 69 void shrink(int size) { shrink(size, size, size, size); } | 68 void shrink(int size) { shrink(size, size, size, size); } |
| 70 | 69 |
| 71 private: | 70 private: |
| 72 IntSize m_topLeft; | 71 IntSize m_topLeft; |
| 73 IntSize m_topRight; | 72 IntSize m_topRight; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 89 | 88 |
| 90 void setRect(const IntRect& rect) { m_rect = rect; } | 89 void setRect(const IntRect& rect) { m_rect = rect; } |
| 91 void setRadii(const Radii& radii) { m_radii = radii; } | 90 void setRadii(const Radii& radii) { m_radii = radii; } |
| 92 | 91 |
| 93 void move(const IntSize& size) { m_rect.move(size); } | 92 void move(const IntSize& size) { m_rect.move(size); } |
| 94 void inflate(int size) { m_rect.inflate(size); } | 93 void inflate(int size) { m_rect.inflate(size); } |
| 95 void inflateWithRadii(int size); | 94 void inflateWithRadii(int size); |
| 96 void expandRadii(int size) { m_radii.expand(size); } | 95 void expandRadii(int size) { m_radii.expand(size); } |
| 97 void shrinkRadii(int size) { m_radii.shrink(size); } | 96 void shrinkRadii(int size) { m_radii.shrink(size); } |
| 98 | 97 |
| 99 void includeLogicalEdges(const Radii& edges, bool isHorizontal, bool include
LogicalLeftEdge, bool includeLogicalRightEdge); | 98 void includeLogicalEdges(const Radii& edges, bool includeLogicalLeftEdge, bo
ol includeLogicalRightEdge); |
| 100 void excludeLogicalEdges(bool isHorizontal, bool excludeLogicalLeftEdge, boo
l excludeLogicalRightEdge); | |
| 101 | 99 |
| 102 bool isRenderable() const; | 100 bool isRenderable() const; |
| 103 void adjustRadii(); | 101 void adjustRadii(); |
| 104 | 102 |
| 105 // Tests whether the quad intersects any part of this rounded rectangle. | 103 // Tests whether the quad intersects any part of this rounded rectangle. |
| 106 // This only works for convex quads. | 104 // This only works for convex quads. |
| 107 bool intersectsQuad(const FloatQuad&) const; | 105 bool intersectsQuad(const FloatQuad&) const; |
| 108 | 106 |
| 109 private: | 107 private: |
| 110 IntRect m_rect; | 108 IntRect m_rect; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 123 | 121 |
| 124 inline bool operator==(const RoundedRect& a, const RoundedRect& b) | 122 inline bool operator==(const RoundedRect& a, const RoundedRect& b) |
| 125 { | 123 { |
| 126 return a.rect() == b.rect() && a.radii() == b.radii(); | 124 return a.rect() == b.rect() && a.radii() == b.radii(); |
| 127 } | 125 } |
| 128 | 126 |
| 129 | 127 |
| 130 } // namespace blink | 128 } // namespace blink |
| 131 | 129 |
| 132 #endif // RoundedRect_h | 130 #endif // RoundedRect_h |
| OLD | NEW |