OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 , m_blendMode(FillLayer::initialFillBlendMode(type)) | 56 , m_blendMode(FillLayer::initialFillBlendMode(type)) |
57 , m_maskSourceType(FillLayer::initialFillMaskSourceType(type)) | 57 , m_maskSourceType(FillLayer::initialFillMaskSourceType(type)) |
58 , m_imageSet(false) | 58 , m_imageSet(false) |
59 , m_attachmentSet(false) | 59 , m_attachmentSet(false) |
60 , m_clipSet(false) | 60 , m_clipSet(false) |
61 , m_originSet(false) | 61 , m_originSet(false) |
62 , m_repeatXSet(false) | 62 , m_repeatXSet(false) |
63 , m_repeatYSet(false) | 63 , m_repeatYSet(false) |
64 , m_xPosSet(false) | 64 , m_xPosSet(false) |
65 , m_yPosSet(false) | 65 , m_yPosSet(false) |
66 , m_backgroundOriginSet(false) | 66 , m_backgroundXOriginSet(false) |
| 67 , m_backgroundYOriginSet(false) |
67 , m_backgroundXOrigin(LeftEdge) | 68 , m_backgroundXOrigin(LeftEdge) |
68 , m_backgroundYOrigin(TopEdge) | 69 , m_backgroundYOrigin(TopEdge) |
69 , m_compositeSet(type == MaskFillLayer) | 70 , m_compositeSet(type == MaskFillLayer) |
70 , m_blendModeSet(false) | 71 , m_blendModeSet(false) |
71 , m_maskSourceTypeSet(false) | 72 , m_maskSourceTypeSet(false) |
72 , m_type(type) | 73 , m_type(type) |
73 { | 74 { |
74 } | 75 } |
75 | 76 |
76 FillLayer::FillLayer(const FillLayer& o) | 77 FillLayer::FillLayer(const FillLayer& o) |
(...skipping 12 matching lines...) Expand all Loading... |
89 , m_blendMode(o.m_blendMode) | 90 , m_blendMode(o.m_blendMode) |
90 , m_maskSourceType(o.m_maskSourceType) | 91 , m_maskSourceType(o.m_maskSourceType) |
91 , m_imageSet(o.m_imageSet) | 92 , m_imageSet(o.m_imageSet) |
92 , m_attachmentSet(o.m_attachmentSet) | 93 , m_attachmentSet(o.m_attachmentSet) |
93 , m_clipSet(o.m_clipSet) | 94 , m_clipSet(o.m_clipSet) |
94 , m_originSet(o.m_originSet) | 95 , m_originSet(o.m_originSet) |
95 , m_repeatXSet(o.m_repeatXSet) | 96 , m_repeatXSet(o.m_repeatXSet) |
96 , m_repeatYSet(o.m_repeatYSet) | 97 , m_repeatYSet(o.m_repeatYSet) |
97 , m_xPosSet(o.m_xPosSet) | 98 , m_xPosSet(o.m_xPosSet) |
98 , m_yPosSet(o.m_yPosSet) | 99 , m_yPosSet(o.m_yPosSet) |
99 , m_backgroundOriginSet(o.m_backgroundOriginSet) | 100 , m_backgroundXOriginSet(o.m_backgroundXOriginSet) |
| 101 , m_backgroundYOriginSet(o.m_backgroundYOriginSet) |
100 , m_backgroundXOrigin(o.m_backgroundXOrigin) | 102 , m_backgroundXOrigin(o.m_backgroundXOrigin) |
101 , m_backgroundYOrigin(o.m_backgroundYOrigin) | 103 , m_backgroundYOrigin(o.m_backgroundYOrigin) |
102 , m_compositeSet(o.m_compositeSet) | 104 , m_compositeSet(o.m_compositeSet) |
103 , m_blendModeSet(o.m_blendModeSet) | 105 , m_blendModeSet(o.m_blendModeSet) |
104 , m_maskSourceTypeSet(o.m_maskSourceTypeSet) | 106 , m_maskSourceTypeSet(o.m_maskSourceTypeSet) |
105 , m_type(o.m_type) | 107 , m_type(o.m_type) |
106 { | 108 { |
107 } | 109 } |
108 | 110 |
109 FillLayer::~FillLayer() | 111 FillLayer::~FillLayer() |
110 { | 112 { |
111 delete m_next; | 113 delete m_next; |
112 } | 114 } |
113 | 115 |
114 FillLayer& FillLayer::operator=(const FillLayer& o) | 116 FillLayer& FillLayer::operator=(const FillLayer& o) |
115 { | 117 { |
116 if (m_next != o.m_next) { | 118 if (m_next != o.m_next) { |
117 delete m_next; | 119 delete m_next; |
118 m_next = o.m_next ? new FillLayer(*o.m_next) : 0; | 120 m_next = o.m_next ? new FillLayer(*o.m_next) : 0; |
119 } | 121 } |
120 | 122 |
121 m_image = o.m_image; | 123 m_image = o.m_image; |
122 m_xPosition = o.m_xPosition; | 124 m_xPosition = o.m_xPosition; |
123 m_yPosition = o.m_yPosition; | 125 m_yPosition = o.m_yPosition; |
124 m_backgroundXOrigin = o.m_backgroundXOrigin; | 126 m_backgroundXOrigin = o.m_backgroundXOrigin; |
125 m_backgroundYOrigin = o.m_backgroundYOrigin; | 127 m_backgroundYOrigin = o.m_backgroundYOrigin; |
126 m_backgroundOriginSet = o.m_backgroundOriginSet; | 128 m_backgroundXOriginSet = o.m_backgroundXOriginSet; |
| 129 m_backgroundYOriginSet = o.m_backgroundYOriginSet; |
127 m_sizeLength = o.m_sizeLength; | 130 m_sizeLength = o.m_sizeLength; |
128 m_attachment = o.m_attachment; | 131 m_attachment = o.m_attachment; |
129 m_clip = o.m_clip; | 132 m_clip = o.m_clip; |
130 m_composite = o.m_composite; | 133 m_composite = o.m_composite; |
131 m_blendMode = o.m_blendMode; | 134 m_blendMode = o.m_blendMode; |
132 m_origin = o.m_origin; | 135 m_origin = o.m_origin; |
133 m_repeatX = o.m_repeatX; | 136 m_repeatX = o.m_repeatX; |
134 m_repeatY = o.m_repeatY; | 137 m_repeatY = o.m_repeatY; |
135 m_sizeType = o.m_sizeType; | 138 m_sizeType = o.m_sizeType; |
136 m_maskSourceType = o.m_maskSourceType; | 139 m_maskSourceType = o.m_maskSourceType; |
(...skipping 29 matching lines...) Expand all Loading... |
166 } | 169 } |
167 | 170 |
168 void FillLayer::fillUnsetProperties() | 171 void FillLayer::fillUnsetProperties() |
169 { | 172 { |
170 FillLayer* curr; | 173 FillLayer* curr; |
171 for (curr = this; curr && curr->isXPositionSet(); curr = curr->next()) { } | 174 for (curr = this; curr && curr->isXPositionSet(); curr = curr->next()) { } |
172 if (curr && curr != this) { | 175 if (curr && curr != this) { |
173 // We need to fill in the remaining values with the pattern specified. | 176 // We need to fill in the remaining values with the pattern specified. |
174 for (FillLayer* pattern = this; curr; curr = curr->next()) { | 177 for (FillLayer* pattern = this; curr; curr = curr->next()) { |
175 curr->m_xPosition = pattern->m_xPosition; | 178 curr->m_xPosition = pattern->m_xPosition; |
176 if (pattern->isBackgroundOriginSet()) { | 179 if (pattern->isBackgroundXOriginSet()) |
177 curr->m_backgroundXOrigin = pattern->m_backgroundXOrigin; | 180 curr->m_backgroundXOrigin = pattern->m_backgroundXOrigin; |
| 181 if (pattern->isBackgroundYOriginSet()) |
178 curr->m_backgroundYOrigin = pattern->m_backgroundYOrigin; | 182 curr->m_backgroundYOrigin = pattern->m_backgroundYOrigin; |
179 } | |
180 pattern = pattern->next(); | 183 pattern = pattern->next(); |
181 if (pattern == curr || !pattern) | 184 if (pattern == curr || !pattern) |
182 pattern = this; | 185 pattern = this; |
183 } | 186 } |
184 } | 187 } |
185 | 188 |
186 for (curr = this; curr && curr->isYPositionSet(); curr = curr->next()) { } | 189 for (curr = this; curr && curr->isYPositionSet(); curr = curr->next()) { } |
187 if (curr && curr != this) { | 190 if (curr && curr != this) { |
188 // We need to fill in the remaining values with the pattern specified. | 191 // We need to fill in the remaining values with the pattern specified. |
189 for (FillLayer* pattern = this; curr; curr = curr->next()) { | 192 for (FillLayer* pattern = this; curr; curr = curr->next()) { |
190 curr->m_yPosition = pattern->m_yPosition; | 193 curr->m_yPosition = pattern->m_yPosition; |
191 if (pattern->isBackgroundOriginSet()) { | 194 if (pattern->isBackgroundXOriginSet()) |
192 curr->m_backgroundXOrigin = pattern->m_backgroundXOrigin; | 195 curr->m_backgroundXOrigin = pattern->m_backgroundXOrigin; |
| 196 if (pattern->isBackgroundYOriginSet()) |
193 curr->m_backgroundYOrigin = pattern->m_backgroundYOrigin; | 197 curr->m_backgroundYOrigin = pattern->m_backgroundYOrigin; |
194 } | |
195 pattern = pattern->next(); | 198 pattern = pattern->next(); |
196 if (pattern == curr || !pattern) | 199 if (pattern == curr || !pattern) |
197 pattern = this; | 200 pattern = this; |
198 } | 201 } |
199 } | 202 } |
200 | 203 |
201 for (curr = this; curr && curr->isAttachmentSet(); curr = curr->next()) { } | 204 for (curr = this; curr && curr->isAttachmentSet(); curr = curr->next()) { } |
202 if (curr && curr != this) { | 205 if (curr && curr != this) { |
203 // We need to fill in the remaining values with the pattern specified. | 206 // We need to fill in the remaining values with the pattern specified. |
204 for (FillLayer* pattern = this; curr; curr = curr->next()) { | 207 for (FillLayer* pattern = this; curr; curr = curr->next()) { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 369 |
367 return false; | 370 return false; |
368 } | 371 } |
369 | 372 |
370 bool FillLayer::hasRepeatXY() const | 373 bool FillLayer::hasRepeatXY() const |
371 { | 374 { |
372 return m_repeatX == RepeatFill && m_repeatY == RepeatFill; | 375 return m_repeatX == RepeatFill && m_repeatY == RepeatFill; |
373 } | 376 } |
374 | 377 |
375 } // namespace WebCore | 378 } // namespace WebCore |
OLD | NEW |