Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 | 164 |
| 165 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const override; | 165 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const override; |
| 166 | 166 |
| 167 double layoutViewportWidth() const; | 167 double layoutViewportWidth() const; |
| 168 double layoutViewportHeight() const; | 168 double layoutViewportHeight() const; |
| 169 | 169 |
| 170 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat e; } | 170 void pushLayoutState(LayoutState& layoutState) { m_layoutState = &layoutStat e; } |
| 171 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState ->next(); } | 171 void popLayoutState() { ASSERT(m_layoutState); m_layoutState = m_layoutState ->next(); } |
| 172 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) override final; | 172 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) override final; |
| 173 | 173 |
| 174 // Records |obj| as needing paint invalidation on the next frame. See the de finition of PaintInvalidationDelayedFull for more details. | |
| 175 void pushDelayedPaintInvalidationTarget(LayoutObject& obj) { m_pendingDelaye dPaintInvalidations.append(&obj); } | |
| 176 | |
| 177 // Invalidates paint for all objects that were added via pushDelayedPaintInv alidationTarget, and clears the pending vector. | |
| 178 void invalidatePaintForDelayedTargets(); | |
| 179 | |
| 174 private: | 180 private: |
| 175 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const override; | 181 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const override; |
| 176 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const override; | 182 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const override; |
| 177 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst override; | 183 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst override; |
| 178 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override; | 184 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override; |
| 179 | 185 |
| 180 void layoutContent(); | 186 void layoutContent(); |
| 181 #if ENABLE(ASSERT) | 187 #if ENABLE(ASSERT) |
| 182 void checkLayoutState(); | 188 void checkLayoutState(); |
| 183 #endif | 189 #endif |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 201 LayoutState* m_layoutState; | 207 LayoutState* m_layoutState; |
| 202 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor; | 208 OwnPtr<DeprecatedPaintLayerCompositor> m_compositor; |
| 203 RefPtr<IntervalArena> m_intervalArena; | 209 RefPtr<IntervalArena> m_intervalArena; |
| 204 | 210 |
| 205 LayoutQuote* m_layoutQuoteHead; | 211 LayoutQuote* m_layoutQuoteHead; |
| 206 unsigned m_layoutCounterCount; | 212 unsigned m_layoutCounterCount; |
| 207 | 213 |
| 208 unsigned m_hitTestCount; | 214 unsigned m_hitTestCount; |
| 209 | 215 |
| 210 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection; | 216 OwnPtrWillBePersistent<PendingSelection> m_pendingSelection; |
| 217 | |
| 218 Vector<LayoutObject*> m_pendingDelayedPaintInvalidations; | |
|
esprehn
2015/03/26 21:09:26
This is a use-after-free since you don't remove ob
| |
| 211 }; | 219 }; |
| 212 | 220 |
| 213 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); | 221 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView()); |
| 214 | 222 |
| 215 // Suspends the LayoutState cached offset and clipRect optimization. Used under transforms | 223 // Suspends the LayoutState cached offset and clipRect optimization. Used under transforms |
| 216 // that cannot be represented by LayoutState (common in SVG) and when manipulati ng the render | 224 // that cannot be represented by LayoutState (common in SVG) and when manipulati ng the render |
| 217 // tree during layout in ways that can trigger paint invalidation of a non-child (e.g. when a list item | 225 // tree during layout in ways that can trigger paint invalidation of a non-child (e.g. when a list item |
| 218 // moves its list marker around). Note that even when disabled, LayoutState is s till used to | 226 // moves its list marker around). Note that even when disabled, LayoutState is s till used to |
| 219 // store layoutDelta. | 227 // store layoutDelta. |
| 220 class ForceHorriblySlowRectMapping { | 228 class ForceHorriblySlowRectMapping { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 234 m_paintInvalidationState->m_cachedOffsetsEnabled = true; | 242 m_paintInvalidationState->m_cachedOffsetsEnabled = true; |
| 235 } | 243 } |
| 236 private: | 244 private: |
| 237 const PaintInvalidationState* m_paintInvalidationState; | 245 const PaintInvalidationState* m_paintInvalidationState; |
| 238 bool m_didDisable; | 246 bool m_didDisable; |
| 239 }; | 247 }; |
| 240 | 248 |
| 241 } // namespace blink | 249 } // namespace blink |
| 242 | 250 |
| 243 #endif // LayoutView_h | 251 #endif // LayoutView_h |
| OLD | NEW |