| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // re-layout the float. | 100 // re-layout the float. |
| 101 // This hack can be removed after SPv2. | 101 // This hack can be removed after SPv2. |
| 102 return m_layoutObject->layer() && | 102 return m_layoutObject->layer() && |
| 103 m_layoutObject->layer()->isSelfPaintingOnlyBecauseIsCompositedPart() && | 103 m_layoutObject->layer()->isSelfPaintingOnlyBecauseIsCompositedPart() && |
| 104 !RuntimeEnabledFeatures::slimmingPaintV2Enabled(); | 104 !RuntimeEnabledFeatures::slimmingPaintV2Enabled(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 std::unique_ptr<FloatingObject> FloatingObject::create( | 107 std::unique_ptr<FloatingObject> FloatingObject::create( |
| 108 LayoutBox* layoutObject) { | 108 LayoutBox* layoutObject) { |
| 109 std::unique_ptr<FloatingObject> newObj = | 109 std::unique_ptr<FloatingObject> newObj = |
| 110 wrapUnique(new FloatingObject(layoutObject)); | 110 WTF::wrapUnique(new FloatingObject(layoutObject)); |
| 111 | 111 |
| 112 // If a layer exists, the float will paint itself. Otherwise someone else | 112 // If a layer exists, the float will paint itself. Otherwise someone else |
| 113 // will. | 113 // will. |
| 114 newObj->setShouldPaint(!layoutObject->hasSelfPaintingLayer() || | 114 newObj->setShouldPaint(!layoutObject->hasSelfPaintingLayer() || |
| 115 newObj->shouldPaintForCompositedLayoutPart()); | 115 newObj->shouldPaintForCompositedLayoutPart()); |
| 116 | 116 |
| 117 newObj->setIsDescendant(true); | 117 newObj->setIsDescendant(true); |
| 118 | 118 |
| 119 return newObj; | 119 return newObj; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool FloatingObject::shouldPaint() const { | 122 bool FloatingObject::shouldPaint() const { |
| 123 return m_shouldPaint && !m_layoutObject->hasSelfPaintingLayer(); | 123 return m_shouldPaint && !m_layoutObject->hasSelfPaintingLayer(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 std::unique_ptr<FloatingObject> FloatingObject::copyToNewContainer( | 126 std::unique_ptr<FloatingObject> FloatingObject::copyToNewContainer( |
| 127 LayoutSize offset, | 127 LayoutSize offset, |
| 128 bool shouldPaint, | 128 bool shouldPaint, |
| 129 bool isDescendant) const { | 129 bool isDescendant) const { |
| 130 return wrapUnique(new FloatingObject( | 130 return WTF::wrapUnique(new FloatingObject( |
| 131 layoutObject(), getType(), | 131 layoutObject(), getType(), |
| 132 LayoutRect(frameRect().location() - offset, frameRect().size()), | 132 LayoutRect(frameRect().location() - offset, frameRect().size()), |
| 133 shouldPaint, isDescendant, isLowestNonOverhangingFloatInChild())); | 133 shouldPaint, isDescendant, isLowestNonOverhangingFloatInChild())); |
| 134 } | 134 } |
| 135 | 135 |
| 136 std::unique_ptr<FloatingObject> FloatingObject::unsafeClone() const { | 136 std::unique_ptr<FloatingObject> FloatingObject::unsafeClone() const { |
| 137 std::unique_ptr<FloatingObject> cloneObject = | 137 std::unique_ptr<FloatingObject> cloneObject = |
| 138 wrapUnique(new FloatingObject(layoutObject(), getType(), m_frameRect, | 138 WTF::wrapUnique(new FloatingObject(layoutObject(), getType(), m_frameRect, |
| 139 m_shouldPaint, m_isDescendant, false)); | 139 m_shouldPaint, m_isDescendant, false)); |
| 140 cloneObject->m_isPlaced = m_isPlaced; | 140 cloneObject->m_isPlaced = m_isPlaced; |
| 141 return cloneObject; | 141 return cloneObject; |
| 142 } | 142 } |
| 143 | 143 |
| 144 template <FloatingObject::Type FloatTypeValue> | 144 template <FloatingObject::Type FloatTypeValue> |
| 145 class ComputeFloatOffsetAdapter { | 145 class ComputeFloatOffsetAdapter { |
| 146 public: | 146 public: |
| 147 typedef FloatingObjectInterval IntervalType; | 147 typedef FloatingObjectInterval IntervalType; |
| 148 | 148 |
| 149 ComputeFloatOffsetAdapter(const LayoutBlockFlow* layoutObject, | 149 ComputeFloatOffsetAdapter(const LayoutBlockFlow* layoutObject, |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 #if ENABLE(ASSERT) | 546 #if ENABLE(ASSERT) |
| 547 floatingObject.setIsInPlacedTree(false); | 547 floatingObject.setIsInPlacedTree(false); |
| 548 #endif | 548 #endif |
| 549 markLowestFloatLogicalBottomCacheAsDirty(); | 549 markLowestFloatLogicalBottomCacheAsDirty(); |
| 550 } | 550 } |
| 551 | 551 |
| 552 FloatingObject* FloatingObjects::add( | 552 FloatingObject* FloatingObjects::add( |
| 553 std::unique_ptr<FloatingObject> floatingObject) { | 553 std::unique_ptr<FloatingObject> floatingObject) { |
| 554 FloatingObject* newObject = floatingObject.release(); | 554 FloatingObject* newObject = floatingObject.release(); |
| 555 increaseObjectsCount(newObject->getType()); | 555 increaseObjectsCount(newObject->getType()); |
| 556 m_set.add(wrapUnique(newObject)); | 556 m_set.add(WTF::wrapUnique(newObject)); |
| 557 if (newObject->isPlaced()) | 557 if (newObject->isPlaced()) |
| 558 addPlacedObject(*newObject); | 558 addPlacedObject(*newObject); |
| 559 markLowestFloatLogicalBottomCacheAsDirty(); | 559 markLowestFloatLogicalBottomCacheAsDirty(); |
| 560 return newObject; | 560 return newObject; |
| 561 } | 561 } |
| 562 | 562 |
| 563 void FloatingObjects::remove(FloatingObject* toBeRemoved) { | 563 void FloatingObjects::remove(FloatingObject* toBeRemoved) { |
| 564 decreaseObjectsCount(toBeRemoved->getType()); | 564 decreaseObjectsCount(toBeRemoved->getType()); |
| 565 std::unique_ptr<FloatingObject> floatingObject = m_set.take(toBeRemoved); | 565 std::unique_ptr<FloatingObject> floatingObject = m_set.take(toBeRemoved); |
| 566 ASSERT(floatingObject->isPlaced() || !floatingObject->isInPlacedTree()); | 566 ASSERT(floatingObject->isPlaced() || !floatingObject->isInPlacedTree()); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 const FloatingObject* floatingObject) { | 748 const FloatingObject* floatingObject) { |
| 749 return String::format("%p (%gx%g %gx%g)", floatingObject, | 749 return String::format("%p (%gx%g %gx%g)", floatingObject, |
| 750 floatingObject->frameRect().x().toFloat(), | 750 floatingObject->frameRect().x().toFloat(), |
| 751 floatingObject->frameRect().y().toFloat(), | 751 floatingObject->frameRect().y().toFloat(), |
| 752 floatingObject->frameRect().maxX().toFloat(), | 752 floatingObject->frameRect().maxX().toFloat(), |
| 753 floatingObject->frameRect().maxY().toFloat()); | 753 floatingObject->frameRect().maxY().toFloat()); |
| 754 } | 754 } |
| 755 #endif | 755 #endif |
| 756 | 756 |
| 757 } // namespace blink | 757 } // namespace blink |
| OLD | NEW |