| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 ClipRects() | 46 ClipRects() |
| 47 : m_refCnt(1) | 47 : m_refCnt(1) |
| 48 , m_fixed(0) | 48 , m_fixed(0) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 void reset(const LayoutRect& r) | 52 void reset(const LayoutRect& r) |
| 53 { | 53 { |
| 54 m_overflowClipRect = r; | 54 m_overflowClipRect = r; |
| 55 m_fixedClipRect = r; | |
| 56 m_posClipRect = r; | 55 m_posClipRect = r; |
| 57 m_fixed = 0; | 56 m_fixed = 0; |
| 58 } | 57 } |
| 59 | 58 |
| 60 const ClipRect& overflowClipRect() const { return m_overflowClipRect; } | 59 const ClipRect& overflowClipRect() const { return m_overflowClipRect; } |
| 61 void setOverflowClipRect(const ClipRect& r) { m_overflowClipRect = r; } | 60 void setOverflowClipRect(const ClipRect& r) { m_overflowClipRect = r; } |
| 62 | 61 |
| 63 const ClipRect& fixedClipRect() const { return m_fixedClipRect; } | |
| 64 void setFixedClipRect(const ClipRect&r) { m_fixedClipRect = r; } | |
| 65 | |
| 66 const ClipRect& posClipRect() const { return m_posClipRect; } | 62 const ClipRect& posClipRect() const { return m_posClipRect; } |
| 67 void setPosClipRect(const ClipRect& r) { m_posClipRect = r; } | 63 void setPosClipRect(const ClipRect& r) { m_posClipRect = r; } |
| 68 | 64 |
| 69 bool fixed() const { return static_cast<bool>(m_fixed); } | 65 bool fixed() const { return static_cast<bool>(m_fixed); } |
| 70 void setFixed(bool fixed) { m_fixed = fixed ? 1 : 0; } | 66 void setFixed(bool fixed) { m_fixed = fixed ? 1 : 0; } |
| 71 | 67 |
| 72 void ref() { m_refCnt++; } | 68 void ref() { m_refCnt++; } |
| 73 void deref() | 69 void deref() |
| 74 { | 70 { |
| 75 if (!--m_refCnt) | 71 if (!--m_refCnt) |
| 76 delete this; | 72 delete this; |
| 77 } | 73 } |
| 78 | 74 |
| 79 bool operator==(const ClipRects& other) const | 75 bool operator==(const ClipRects& other) const |
| 80 { | 76 { |
| 81 return m_overflowClipRect == other.overflowClipRect() | 77 return m_overflowClipRect == other.overflowClipRect() |
| 82 && m_fixedClipRect == other.fixedClipRect() | |
| 83 && m_posClipRect == other.posClipRect() | 78 && m_posClipRect == other.posClipRect() |
| 84 && fixed() == other.fixed(); | 79 && fixed() == other.fixed(); |
| 85 } | 80 } |
| 86 | 81 |
| 87 ClipRects& operator=(const ClipRects& other) | 82 ClipRects& operator=(const ClipRects& other) |
| 88 { | 83 { |
| 89 m_overflowClipRect = other.overflowClipRect(); | 84 m_overflowClipRect = other.overflowClipRect(); |
| 90 m_fixedClipRect = other.fixedClipRect(); | |
| 91 m_posClipRect = other.posClipRect(); | 85 m_posClipRect = other.posClipRect(); |
| 92 m_fixed = other.fixed(); | 86 m_fixed = other.fixed(); |
| 93 return *this; | 87 return *this; |
| 94 } | 88 } |
| 95 | 89 |
| 96 private: | 90 private: |
| 97 ClipRects(const LayoutRect& r) | 91 ClipRects(const LayoutRect& r) |
| 98 : m_overflowClipRect(r) | 92 : m_overflowClipRect(r) |
| 99 , m_fixedClipRect(r) | |
| 100 , m_posClipRect(r) | 93 , m_posClipRect(r) |
| 101 , m_refCnt(1) | 94 , m_refCnt(1) |
| 102 , m_fixed(0) | 95 , m_fixed(0) |
| 103 { | 96 { |
| 104 } | 97 } |
| 105 | 98 |
| 106 ClipRects(const ClipRects& other) | 99 ClipRects(const ClipRects& other) |
| 107 : m_overflowClipRect(other.overflowClipRect()) | 100 : m_overflowClipRect(other.overflowClipRect()) |
| 108 , m_fixedClipRect(other.fixedClipRect()) | |
| 109 , m_posClipRect(other.posClipRect()) | 101 , m_posClipRect(other.posClipRect()) |
| 110 , m_refCnt(1) | 102 , m_refCnt(1) |
| 111 , m_fixed(other.fixed()) | 103 , m_fixed(other.fixed()) |
| 112 { | 104 { |
| 113 } | 105 } |
| 114 | 106 |
| 115 ClipRect m_overflowClipRect; | 107 ClipRect m_overflowClipRect; |
| 116 ClipRect m_fixedClipRect; | |
| 117 ClipRect m_posClipRect; | 108 ClipRect m_posClipRect; |
| 118 unsigned m_refCnt : 31; | 109 unsigned m_refCnt : 31; |
| 119 unsigned m_fixed : 1; | 110 unsigned m_fixed : 1; |
| 120 }; | 111 }; |
| 121 | 112 |
| 122 } // namespace blink | 113 } // namespace blink |
| 123 | 114 |
| 124 #endif // ClipRects_h | 115 #endif // ClipRects_h |
| OLD | NEW |