Chromium Code Reviews| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 | 75 |
| 76 explicit RoundedRect(const IntRect&, const Radii& = Radii()); | 76 explicit RoundedRect(const IntRect&, const Radii& = Radii()); |
| 77 RoundedRect(int x, int y, int width, int height); | 77 RoundedRect(int x, int y, int width, int height); |
| 78 RoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight); | 78 RoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight); |
| 79 | 79 |
| 80 const IntRect& rect() const { return m_rect; } | 80 const IntRect& rect() const { return m_rect; } |
| 81 const Radii& radii() const { return m_radii; } | 81 const Radii& radii() const { return m_radii; } |
| 82 bool isRounded() const { return !m_radii.isZero(); } | 82 bool isRounded() const { return !m_radii.isZero(); } |
| 83 bool isEmpty() const { return m_rect.isEmpty(); } | 83 bool isEmpty() const { return m_rect.isEmpty(); } |
| 84 | 84 |
| 85 // Return a quickly computed rect enclosed by the rounded rect. | |
| 86 IntRect enclosedRect() const; | |
|
Julien - ping for review
2013/08/08 21:36:50
I really think we should specify what we return as
jbroman
2013/08/09 15:34:35
Changed to radiusCenterRect().
| |
| 87 | |
| 85 void setRect(const IntRect& rect) { m_rect = rect; } | 88 void setRect(const IntRect& rect) { m_rect = rect; } |
| 86 void setRadii(const Radii& radii) { m_radii = radii; } | 89 void setRadii(const Radii& radii) { m_radii = radii; } |
| 87 | 90 |
| 88 void move(const IntSize& size) { m_rect.move(size); } | 91 void move(const IntSize& size) { m_rect.move(size); } |
| 89 void inflate(int size) { m_rect.inflate(size); } | 92 void inflate(int size) { m_rect.inflate(size); } |
| 90 void inflateWithRadii(int size); | 93 void inflateWithRadii(int size); |
| 91 void expandRadii(int size) { m_radii.expand(size); } | 94 void expandRadii(int size) { m_radii.expand(size); } |
| 92 void shrinkRadii(int size) { m_radii.shrink(size); } | 95 void shrinkRadii(int size) { m_radii.shrink(size); } |
| 93 | 96 |
| 94 void includeLogicalEdges(const Radii& edges, bool isHorizontal, bool include LogicalLeftEdge, bool includeLogicalRightEdge); | 97 void includeLogicalEdges(const Radii& edges, bool isHorizontal, bool include LogicalLeftEdge, bool includeLogicalRightEdge); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 118 | 121 |
| 119 inline bool operator==(const RoundedRect& a, const RoundedRect& b) | 122 inline bool operator==(const RoundedRect& a, const RoundedRect& b) |
| 120 { | 123 { |
| 121 return a.rect() == b.rect() && a.radii() == b.radii(); | 124 return a.rect() == b.rect() && a.radii() == b.radii(); |
| 122 } | 125 } |
| 123 | 126 |
| 124 | 127 |
| 125 } // namespace WebCore | 128 } // namespace WebCore |
| 126 | 129 |
| 127 #endif // RoundedRect_h | 130 #endif // RoundedRect_h |
| OLD | NEW |