| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. | 7 * Copyright (C) 2010, 2012 Google Inc. 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 if (layer()) { | 115 if (layer()) { |
| 116 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer | 116 // FIXME: Ideally we shouldn't need this setter but we can't easily infe
r an overflow-only layer |
| 117 // from the style. | 117 // from the style. |
| 118 layer()->setLayerType(type); | 118 layer()->setLayerType(type); |
| 119 layer()->styleChanged(diff, oldStyle); | 119 layer()->styleChanged(diff, oldStyle); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 void RenderLayerModelObject::addLayerHitTestRects(LayerHitTestRects& rects, cons
t RenderLayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& c
ontainerRect) const | |
| 124 { | |
| 125 if (hasLayer()) { | |
| 126 if (isRenderView()) { | |
| 127 // RenderView is handled with a special fast-path, but it needs to k
now the current layer. | |
| 128 RenderObject::addLayerHitTestRects(rects, layer(), LayoutPoint(), La
youtRect()); | |
| 129 } else { | |
| 130 // Since a RenderObject never lives outside it's container RenderLay
er, we can switch | |
| 131 // to marking entire layers instead. This may sometimes mark more th
an necessary (when | |
| 132 // a layer is made of disjoint objects) but in practice is a signifi
cant performance | |
| 133 // savings. | |
| 134 layer()->addLayerHitTestRects(rects); | |
| 135 } | |
| 136 } else { | |
| 137 RenderObject::addLayerHitTestRects(rects, currentLayer, layerOffset, con
tainerRect); | |
| 138 } | |
| 139 } | |
| 140 | |
| 141 InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintIn
validationState& paintInvalidationState, const RenderLayerModelObject& newPaintI
nvalidationContainer) | 123 InvalidationReason RenderLayerModelObject::invalidatePaintIfNeeded(const PaintIn
validationState& paintInvalidationState, const RenderLayerModelObject& newPaintI
nvalidationContainer) |
| 142 { | 124 { |
| 143 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); | 125 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); |
| 144 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi
onFromPaintInvalidationContainer(); | 126 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi
onFromPaintInvalidationContainer(); |
| 145 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv
alidationContainer, &paintInvalidationState)); | 127 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv
alidationContainer, &paintInvalidationState)); |
| 146 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP
aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati
onState)); | 128 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP
aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati
onState)); |
| 147 | 129 |
| 148 // If we are set to do a full paint invalidation that means the RenderView w
ill issue | 130 // If we are set to do a full paint invalidation that means the RenderView w
ill issue |
| 149 // paint invalidations. We can then skip issuing of paint invalidations for
the child | 131 // paint invalidations. We can then skip issuing of paint invalidations for
the child |
| 150 // renderers as they'll be covered by the RenderView. | 132 // renderers as they'll be covered by the RenderView. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 169 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState,
newPaintInvalidationContainer); | 151 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState,
newPaintInvalidationContainer); |
| 170 | 152 |
| 171 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); | 153 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); |
| 172 if (reason == InvalidationLocationChange || reason == InvalidationFull) | 154 if (reason == InvalidationLocationChange || reason == InvalidationFull) |
| 173 childTreeWalkState.setForceCheckForPaintInvalidation(); | 155 childTreeWalkState.setForceCheckForPaintInvalidation(); |
| 174 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); | 156 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); |
| 175 } | 157 } |
| 176 | 158 |
| 177 } // namespace blink | 159 } // namespace blink |
| 178 | 160 |
| OLD | NEW |