| 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 14 matching lines...) Expand all Loading... |
| 25 #include "core/CoreExport.h" | 25 #include "core/CoreExport.h" |
| 26 #include "core/compositing/DisplayListCompositingBuilder.h" | 26 #include "core/compositing/DisplayListCompositingBuilder.h" |
| 27 #include "core/editing/Position.h" | 27 #include "core/editing/Position.h" |
| 28 #include "core/frame/FrameView.h" | 28 #include "core/frame/FrameView.h" |
| 29 #include "core/layout/HitTestCache.h" | 29 #include "core/layout/HitTestCache.h" |
| 30 #include "core/layout/HitTestResult.h" | 30 #include "core/layout/HitTestResult.h" |
| 31 #include "core/layout/LayoutBlockFlow.h" | 31 #include "core/layout/LayoutBlockFlow.h" |
| 32 #include "core/layout/LayoutState.h" | 32 #include "core/layout/LayoutState.h" |
| 33 #include "core/layout/PaintInvalidationState.h" | 33 #include "core/layout/PaintInvalidationState.h" |
| 34 #include "core/layout/PendingSelection.h" | 34 #include "core/layout/PendingSelection.h" |
| 35 #include "platform/MemoryPurgeController.h" |
| 35 #include "platform/PODFreeListArena.h" | 36 #include "platform/PODFreeListArena.h" |
| 36 #include "platform/RuntimeEnabledFeatures.h" | 37 #include "platform/RuntimeEnabledFeatures.h" |
| 37 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 38 #include "platform/scroll/ScrollableArea.h" | 39 #include "platform/scroll/ScrollableArea.h" |
| 39 #include "wtf/OwnPtr.h" | 40 #include "wtf/OwnPtr.h" |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class DeprecatedPaintLayerCompositor; | 44 class DeprecatedPaintLayerCompositor; |
| 44 class LayoutQuote; | 45 class LayoutQuote; |
| 45 | 46 |
| 46 // The root of the layout tree, corresponding to the CSS initial containing bloc
k. | 47 // The root of the layout tree, corresponding to the CSS initial containing bloc
k. |
| 47 // It's dimensions match that of the logical viewport (which may be different fr
om | 48 // It's dimensions match that of the logical viewport (which may be different fr
om |
| 48 // the visible viewport in fixed-layout mode), and it is always at position (0,0
) | 49 // the visible viewport in fixed-layout mode), and it is always at position (0,0
) |
| 49 // relative to the document (and so isn't necessarily in view). | 50 // relative to the document (and so isn't necessarily in view). |
| 50 class CORE_EXPORT LayoutView final : public LayoutBlockFlow { | 51 // TODO(bashi): Remove MemoryPurgeEventListener. This just demonstrate how |
| 52 // MemoryPurgeController works. |
| 53 class CORE_EXPORT LayoutView final : public MemoryPurgeEventListener, public Lay
outBlockFlow { |
| 51 public: | 54 public: |
| 52 explicit LayoutView(Document*); | 55 explicit LayoutView(Document*); |
| 53 ~LayoutView() override; | 56 ~LayoutView() override; |
| 54 void willBeDestroyed() override; | 57 void willBeDestroyed() override; |
| 55 | 58 |
| 56 // hitTest() will update layout, style and compositing first while hitTestNo
LifecycleUpdate() does not. | 59 // hitTest() will update layout, style and compositing first while hitTestNo
LifecycleUpdate() does not. |
| 57 bool hitTest(HitTestResult&); | 60 bool hitTest(HitTestResult&); |
| 58 bool hitTestNoLifecycleUpdate(HitTestResult&); | 61 bool hitTestNoLifecycleUpdate(HitTestResult&); |
| 59 | 62 |
| 60 // Returns the total count of calls to HitTest, for testing. | 63 // Returns the total count of calls to HitTest, for testing. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 188 |
| 186 LayoutRect visualOverflowRect() const override; | 189 LayoutRect visualOverflowRect() const override; |
| 187 | 190 |
| 188 // Invalidates paint for the entire view, including composited descendants,
but not including child frames. | 191 // Invalidates paint for the entire view, including composited descendants,
but not including child frames. |
| 189 // It is very likely you do not want to call this method. | 192 // It is very likely you do not want to call this method. |
| 190 void setShouldDoFullPaintInvalidationForViewAndAllDescendants(); | 193 void setShouldDoFullPaintInvalidationForViewAndAllDescendants(); |
| 191 | 194 |
| 192 void setCompositedDisplayList(PassOwnPtr<const CompositedDisplayList> compos
itedDisplayList) { m_compositedDisplayList = compositedDisplayList; } | 195 void setCompositedDisplayList(PassOwnPtr<const CompositedDisplayList> compos
itedDisplayList) { m_compositedDisplayList = compositedDisplayList; } |
| 193 const CompositedDisplayList* compositedDisplayList() const { return m_compos
itedDisplayList.get(); } | 196 const CompositedDisplayList* compositedDisplayList() const { return m_compos
itedDisplayList.get(); } |
| 194 | 197 |
| 198 void purgeMemory(MemoryPurgeMode, DeviceKind) override; |
| 199 |
| 195 private: | 200 private: |
| 196 void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
nullptr, const PaintInvalidationState* = nullptr) const override; | 201 void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
nullptr, const PaintInvalidationState* = nullptr) const override; |
| 197 | 202 |
| 198 template <typename Strategy> | 203 template <typename Strategy> |
| 199 void commitPendingSelectionAlgorithm(); | 204 void commitPendingSelectionAlgorithm(); |
| 200 | 205 |
| 201 const LayoutObject* pushMappingToContainer(const LayoutBoxModelObject* ances
torToStopAt, LayoutGeometryMap&) const override; | 206 const LayoutObject* pushMappingToContainer(const LayoutBoxModelObject* ances
torToStopAt, LayoutGeometryMap&) const override; |
| 202 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove
rride; | 207 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove
rride; |
| 203 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf
fset) const override; | 208 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf
fset) const override; |
| 204 | 209 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 m_paintInvalidationState->m_cachedOffsetsEnabled = true; | 272 m_paintInvalidationState->m_cachedOffsetsEnabled = true; |
| 268 } | 273 } |
| 269 private: | 274 private: |
| 270 const PaintInvalidationState* m_paintInvalidationState; | 275 const PaintInvalidationState* m_paintInvalidationState; |
| 271 bool m_didDisable; | 276 bool m_didDisable; |
| 272 }; | 277 }; |
| 273 | 278 |
| 274 } // namespace blink | 279 } // namespace blink |
| 275 | 280 |
| 276 #endif // LayoutView_h | 281 #endif // LayoutView_h |
| OLD | NEW |