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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 m_maskSourceTypeSet = o.m_maskSourceTypeSet; | 157 m_maskSourceTypeSet = o.m_maskSourceTypeSet; |
158 | 158 |
159 m_type = o.m_type; | 159 m_type = o.m_type; |
160 | 160 |
161 m_cachedPropertiesComputed = false; | 161 m_cachedPropertiesComputed = false; |
162 | 162 |
163 return *this; | 163 return *this; |
164 } | 164 } |
165 | 165 |
166 bool FillLayer::operator==(const FillLayer& o) const { | 166 bool FillLayer::operator==(const FillLayer& o) const { |
167 // We do not check the "isSet" booleans for each property, since those are onl
y used during initial construction | 167 // We do not check the "isSet" booleans for each property, since those are |
168 // to propagate patterns into layers. All layer comparisons happen after valu
es have all been filled in anyway. | 168 // only used during initial construction to propagate patterns into layers. |
| 169 // All layer comparisons happen after values have all been filled in anyway. |
169 return dataEquivalent(m_image, o.m_image) && m_xPosition == o.m_xPosition && | 170 return dataEquivalent(m_image, o.m_image) && m_xPosition == o.m_xPosition && |
170 m_yPosition == o.m_yPosition && | 171 m_yPosition == o.m_yPosition && |
171 m_backgroundXOrigin == o.m_backgroundXOrigin && | 172 m_backgroundXOrigin == o.m_backgroundXOrigin && |
172 m_backgroundYOrigin == o.m_backgroundYOrigin && | 173 m_backgroundYOrigin == o.m_backgroundYOrigin && |
173 m_attachment == o.m_attachment && m_clip == o.m_clip && | 174 m_attachment == o.m_attachment && m_clip == o.m_clip && |
174 m_composite == o.m_composite && m_blendMode == o.m_blendMode && | 175 m_composite == o.m_composite && m_blendMode == o.m_blendMode && |
175 m_origin == o.m_origin && m_repeatX == o.m_repeatX && | 176 m_origin == o.m_origin && m_repeatX == o.m_repeatX && |
176 m_repeatY == o.m_repeatY && m_sizeType == o.m_sizeType && | 177 m_repeatY == o.m_repeatY && m_sizeType == o.m_sizeType && |
177 m_maskSourceType == o.m_maskSourceType && | 178 m_maskSourceType == o.m_maskSourceType && |
178 m_sizeLength == o.m_sizeLength && m_type == o.m_type && | 179 m_sizeLength == o.m_sizeLength && m_type == o.m_type && |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 // m_composite == CompositeSourceOver && m_blendMode == WebBlendModeNormal. | 373 // m_composite == CompositeSourceOver && m_blendMode == WebBlendModeNormal. |
373 // Otherwise false. | 374 // Otherwise false. |
374 return m_image->knownToBeOpaque(layoutObject) && | 375 return m_image->knownToBeOpaque(layoutObject) && |
375 !m_image | 376 !m_image |
376 ->imageSize(layoutObject, layoutObject.style()->effectiveZoom(), | 377 ->imageSize(layoutObject, layoutObject.style()->effectiveZoom(), |
377 LayoutSize()) | 378 LayoutSize()) |
378 .isEmpty(); | 379 .isEmpty(); |
379 } | 380 } |
380 | 381 |
381 bool FillLayer::imageTilesLayer() const { | 382 bool FillLayer::imageTilesLayer() const { |
382 // Returns true if an image will be tiled such that it covers any sized rectan
gle. | 383 // Returns true if an image will be tiled such that it covers any sized |
383 // TODO(schenney) We could relax the repeat mode requirement if we also knew t
he rect we | 384 // rectangle. |
384 // had to fill, and the portion of the image we need to use, and know that the
latter | 385 // TODO(schenney) We could relax the repeat mode requirement if we also knew |
385 // covers the former | 386 // the rect we had to fill, and the portion of the image we need to use, and |
| 387 // know that the latter covers the former. |
386 return (m_repeatX == RepeatFill || m_repeatX == RoundFill) && | 388 return (m_repeatX == RepeatFill || m_repeatX == RoundFill) && |
387 (m_repeatY == RepeatFill || m_repeatY == RoundFill); | 389 (m_repeatY == RepeatFill || m_repeatY == RoundFill); |
388 } | 390 } |
389 | 391 |
390 bool FillLayer::imageOccludesNextLayers( | 392 bool FillLayer::imageOccludesNextLayers( |
391 const LayoutObject& layoutObject) const { | 393 const LayoutObject& layoutObject) const { |
392 // We can't cover without an image, regardless of other parameters | 394 // We can't cover without an image, regardless of other parameters |
393 if (!m_image || !m_image->canRender()) | 395 if (!m_image || !m_image->canRender()) |
394 return false; | 396 return false; |
395 | 397 |
(...skipping 20 matching lines...) Expand all Loading... |
416 const FillLayer* layer2) { | 418 const FillLayer* layer2) { |
417 for (; layer1 && layer2; layer1 = layer1->next(), layer2 = layer2->next()) { | 419 for (; layer1 && layer2; layer1 = layer1->next(), layer2 = layer2->next()) { |
418 if (!layerImagesIdentical(*layer1, *layer2)) | 420 if (!layerImagesIdentical(*layer1, *layer2)) |
419 return false; | 421 return false; |
420 } | 422 } |
421 | 423 |
422 return !layer1 && !layer2; | 424 return !layer1 && !layer2; |
423 } | 425 } |
424 | 426 |
425 } // namespace blink | 427 } // namespace blink |
OLD | NEW |