Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: Source/core/layout/LayoutObject.h

Issue 1318713003: Make classes and structures in core/layout fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/layout/LayoutGeometryMapStep.h ('k') | Source/core/layout/LayoutState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 IsFixed = 1 << 0, 93 IsFixed = 1 << 0,
94 UseTransforms = 1 << 1, 94 UseTransforms = 1 << 1,
95 ApplyContainerFlip = 1 << 2, 95 ApplyContainerFlip = 1 << 2,
96 TraverseDocumentBoundaries = 1 << 3, 96 TraverseDocumentBoundaries = 1 << 3,
97 }; 97 };
98 typedef unsigned MapCoordinatesFlags; 98 typedef unsigned MapCoordinatesFlags;
99 99
100 const LayoutUnit& caretWidth(); 100 const LayoutUnit& caretWidth();
101 101
102 struct AnnotatedRegionValue { 102 struct AnnotatedRegionValue {
103 ALLOW_ONLY_INLINE_ALLOCATION();
103 bool operator==(const AnnotatedRegionValue& o) const 104 bool operator==(const AnnotatedRegionValue& o) const
104 { 105 {
105 return draggable == o.draggable && bounds == o.bounds; 106 return draggable == o.draggable && bounds == o.bounds;
106 } 107 }
107 108
108 LayoutRect bounds; 109 LayoutRect bounds;
109 bool draggable; 110 bool draggable;
110 }; 111 };
111 112
112 typedef WTF::HashMap<const DeprecatedPaintLayer*, Vector<LayoutRect>> LayerHitTe stRects; 113 typedef WTF::HashMap<const DeprecatedPaintLayer*, Vector<LayoutRect>> LayerHitTe stRects;
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 return style()->visitedDependentColor(colorProperty); 814 return style()->visitedDependentColor(colorProperty);
814 } 815 }
815 816
816 // Used only by Element::pseudoStyleCacheIsInvalid to get a first line style based off of a 817 // Used only by Element::pseudoStyleCacheIsInvalid to get a first line style based off of a
817 // given new style, without accessing the cache. 818 // given new style, without accessing the cache.
818 PassRefPtr<ComputedStyle> uncachedFirstLineStyle(ComputedStyle*) const; 819 PassRefPtr<ComputedStyle> uncachedFirstLineStyle(ComputedStyle*) const;
819 820
820 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; 821 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
821 822
822 struct AppliedTextDecoration { 823 struct AppliedTextDecoration {
824 STACK_ALLOCATED();
823 Color color; 825 Color color;
824 TextDecorationStyle style; 826 TextDecorationStyle style;
825 AppliedTextDecoration() : color(Color::transparent), style(TextDecoratio nStyleSolid) { } 827 AppliedTextDecoration() : color(Color::transparent), style(TextDecoratio nStyleSolid) { }
826 }; 828 };
827 829
828 void getTextDecorations(unsigned decorations, AppliedTextDecoration& underli ne, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool qu irksMode = false, bool firstlineStyle = false); 830 void getTextDecorations(unsigned decorations, AppliedTextDecoration& underli ne, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool qu irksMode = false, bool firstlineStyle = false);
829 831
830 // Return the LayoutBoxModelObject in the container chain which is responsib le for painting this object, or layout view 832 // Return the LayoutBoxModelObject in the container chain which is responsib le for painting this object, or layout view
831 // if painting is root-relative. This is the container that should be passed to the 'forPaintInvalidation' 833 // if painting is root-relative. This is the container that should be passed to the 'forPaintInvalidation'
832 // methods. 834 // methods.
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 LayoutRect m_previousPaintInvalidationRect; 1433 LayoutRect m_previousPaintInvalidationRect;
1432 1434
1433 // This stores the position in the paint invalidation backing's coordinate. 1435 // This stores the position in the paint invalidation backing's coordinate.
1434 // It is used to detect layoutObject shifts that forces a full invalidation. 1436 // It is used to detect layoutObject shifts that forces a full invalidation.
1435 // This point does *not* account for composited scrolling. See adjustInvalid ationRectForCompositedScrolling(). 1437 // This point does *not* account for composited scrolling. See adjustInvalid ationRectForCompositedScrolling().
1436 LayoutPoint m_previousPositionFromPaintInvalidationBacking; 1438 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
1437 }; 1439 };
1438 1440
1439 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit . 1441 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit .
1440 class DeprecatedDisableModifyLayoutTreeStructureAsserts { 1442 class DeprecatedDisableModifyLayoutTreeStructureAsserts {
1443 STACK_ALLOCATED();
1441 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); 1444 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts);
1442 public: 1445 public:
1443 DeprecatedDisableModifyLayoutTreeStructureAsserts(); 1446 DeprecatedDisableModifyLayoutTreeStructureAsserts();
1444 1447
1445 static bool canModifyLayoutTreeStateInAnyState(); 1448 static bool canModifyLayoutTreeStateInAnyState();
1446 1449
1447 private: 1450 private:
1448 TemporaryChange<bool> m_disabler; 1451 TemporaryChange<bool> m_disabler;
1449 }; 1452 };
1450 1453
1451 // FIXME: We should not allow paint invalidation out of paint invalidation state . crbug.com/457415 1454 // FIXME: We should not allow paint invalidation out of paint invalidation state . crbug.com/457415
1452 // Remove this once we fix the bug. 1455 // Remove this once we fix the bug.
1453 class DisablePaintInvalidationStateAsserts { 1456 class DisablePaintInvalidationStateAsserts {
1457 STACK_ALLOCATED();
1454 WTF_MAKE_NONCOPYABLE(DisablePaintInvalidationStateAsserts); 1458 WTF_MAKE_NONCOPYABLE(DisablePaintInvalidationStateAsserts);
1455 public: 1459 public:
1456 DisablePaintInvalidationStateAsserts(); 1460 DisablePaintInvalidationStateAsserts();
1457 private: 1461 private:
1458 TemporaryChange<bool> m_disabler; 1462 TemporaryChange<bool> m_disabler;
1459 }; 1463 };
1460 1464
1461 // Allow equality comparisons of LayoutObjects by reference or pointer, intercha ngeably. 1465 // Allow equality comparisons of LayoutObjects by reference or pointer, intercha ngeably.
1462 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(LayoutObject) 1466 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(LayoutObject)
1463 1467
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 void showTree(const blink::LayoutObject*); 1667 void showTree(const blink::LayoutObject*);
1664 void showLineTree(const blink::LayoutObject*); 1668 void showLineTree(const blink::LayoutObject*);
1665 void showLayoutTree(const blink::LayoutObject* object1); 1669 void showLayoutTree(const blink::LayoutObject* object1);
1666 // We don't make object2 an optional parameter so that showLayoutTree 1670 // We don't make object2 an optional parameter so that showLayoutTree
1667 // can be called from gdb easily. 1671 // can be called from gdb easily.
1668 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1672 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1669 1673
1670 #endif 1674 #endif
1671 1675
1672 #endif // LayoutObject_h 1676 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutGeometryMapStep.h ('k') | Source/core/layout/LayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698