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

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

Issue 2476813002: Move LayoutObject::m_previousPosition... into a global map in ObjectPaintInvalidator (Closed)
Patch Set: - Created 4 years, 1 month 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
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. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 const LayoutRect& previousVisualRect() const { return m_previousVisualRect; } 1582 const LayoutRect& previousVisualRect() const { return m_previousVisualRect; }
1583 1583
1584 // Called when the previous visual rect(s) is no longer valid. 1584 // Called when the previous visual rect(s) is no longer valid.
1585 virtual void clearPreviousVisualRects(); 1585 virtual void clearPreviousVisualRects();
1586 1586
1587 // Only adjusts if the paint invalidation container is not a composited 1587 // Only adjusts if the paint invalidation container is not a composited
1588 // scroller. 1588 // scroller.
1589 void adjustPreviousPaintInvalidationForScrollIfNeeded( 1589 void adjustPreviousPaintInvalidationForScrollIfNeeded(
1590 const DoubleSize& scrollDelta); 1590 const DoubleSize& scrollDelta);
1591 1591
1592 // The previous position of the top-left corner of the object in its previous
1593 // paint backing.
1594 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const {
1595 return m_previousPositionFromPaintInvalidationBacking;
1596 }
1597 void setPreviousPositionFromPaintInvalidationBacking(
1598 const LayoutPoint& positionFromPaintInvalidationBacking) {
1599 m_previousPositionFromPaintInvalidationBacking =
1600 positionFromPaintInvalidationBacking;
1601 }
1602
1603 PaintInvalidationReason fullPaintInvalidationReason() const { 1592 PaintInvalidationReason fullPaintInvalidationReason() const {
1604 return m_bitfields.fullPaintInvalidationReason(); 1593 return m_bitfields.fullPaintInvalidationReason();
1605 } 1594 }
1606 bool shouldDoFullPaintInvalidation() const { 1595 bool shouldDoFullPaintInvalidation() const {
1607 return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; 1596 return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone;
1608 } 1597 }
1609 void setShouldDoFullPaintInvalidation( 1598 void setShouldDoFullPaintInvalidation(
1610 PaintInvalidationReason = PaintInvalidationFull); 1599 PaintInvalidationReason = PaintInvalidationFull);
1611 void clearShouldDoFullPaintInvalidation() { 1600 void clearShouldDoFullPaintInvalidation() {
1612 m_bitfields.setFullPaintInvalidationReason(PaintInvalidationNone); 1601 m_bitfields.setFullPaintInvalidationReason(PaintInvalidationNone);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { 1672 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
1684 m_layoutObject.setShouldDoFullPaintInvalidation(reason); 1673 m_layoutObject.setShouldDoFullPaintInvalidation(reason);
1685 } 1674 }
1686 void ensureIsReadyForPaintInvalidation() { 1675 void ensureIsReadyForPaintInvalidation() {
1687 m_layoutObject.ensureIsReadyForPaintInvalidation(); 1676 m_layoutObject.ensureIsReadyForPaintInvalidation();
1688 } 1677 }
1689 1678
1690 void setPreviousVisualRect(const LayoutRect& r) { 1679 void setPreviousVisualRect(const LayoutRect& r) {
1691 m_layoutObject.setPreviousVisualRect(r); 1680 m_layoutObject.setPreviousVisualRect(r);
1692 } 1681 }
1693 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) {
1694 m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p);
1695 }
1696 void setPreviousBackgroundObscured(bool b) { 1682 void setPreviousBackgroundObscured(bool b) {
1697 m_layoutObject.setPreviousBackgroundObscured(b); 1683 m_layoutObject.setPreviousBackgroundObscured(b);
1698 } 1684 }
1699 void clearPreviousVisualRects() { 1685 void clearPreviousVisualRects() {
1700 m_layoutObject.clearPreviousVisualRects(); 1686 m_layoutObject.clearPreviousVisualRects();
1701 } 1687 }
1702 1688
1703 protected: 1689 protected:
1704 friend class PaintPropertyTreeBuilder; 1690 friend class PaintPropertyTreeBuilder;
1705 // The following two functions can be called from PaintPropertyTreeBuilder 1691 // The following two functions can be called from PaintPropertyTreeBuilder
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 void removeFromLayoutFlowThread(); 1911 void removeFromLayoutFlowThread();
1926 1912
1927 bool containsInlineWithOutlineAndContinuation() const { 1913 bool containsInlineWithOutlineAndContinuation() const {
1928 return m_bitfields.containsInlineWithOutlineAndContinuation(); 1914 return m_bitfields.containsInlineWithOutlineAndContinuation();
1929 } 1915 }
1930 void setContainsInlineWithOutlineAndContinuation(bool b) { 1916 void setContainsInlineWithOutlineAndContinuation(bool b) {
1931 m_bitfields.setContainsInlineWithOutlineAndContinuation(b); 1917 m_bitfields.setContainsInlineWithOutlineAndContinuation(b);
1932 } 1918 }
1933 1919
1934 private: 1920 private:
1935 // Adjusts a visual rect in the space of |m_previousVisualRect| and 1921 // Adjusts a visual rect in the space of |m_previousVisualRect| to be in the
1936 // |m_previousPositionFromPaintInvalidationBacking| to be in the space of the 1922 // space of the |paintInvalidationContainer|, if needed. They can be different
1937 // |paintInvalidationContainer|, if needed. They can be different only if 1923 // only if |paintInvalidationContainer| is a composited scroller.
1938 // |paintInvalidationContainer| is a composited scroller.
1939 void adjustVisualRectForCompositedScrolling( 1924 void adjustVisualRectForCompositedScrolling(
1940 LayoutRect&, 1925 LayoutRect&,
1941 const LayoutBoxModelObject& paintInvalidationContainer) const; 1926 const LayoutBoxModelObject& paintInvalidationContainer) const;
1942 1927
1943 void clearLayoutRootIfNeeded() const; 1928 void clearLayoutRootIfNeeded() const;
1944 1929
1945 bool isInert() const; 1930 bool isInert() const;
1946 1931
1947 void updateImage(StyleImage*, StyleImage*); 1932 void updateImage(StyleImage*, StyleImage*);
1948 1933
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 } 2327 }
2343 2328
2344 private: 2329 private:
2345 // Store state between styleWillChange and styleDidChange 2330 // Store state between styleWillChange and styleDidChange
2346 static bool s_affectsParentBlock; 2331 static bool s_affectsParentBlock;
2347 2332
2348 // This stores the visual rect from the previous frame. This rect does *not* 2333 // This stores the visual rect from the previous frame. This rect does *not*
2349 // account for composited scrolling. See 2334 // account for composited scrolling. See
2350 // adjustVisualRectForCompositedScrolling(). 2335 // adjustVisualRectForCompositedScrolling().
2351 LayoutRect m_previousVisualRect; 2336 LayoutRect m_previousVisualRect;
2352
2353 // This stores the position in the paint invalidation backing's coordinate.
2354 // It is used to detect layoutObject shifts that forces a full invalidation.
2355 // This point does *not* account for composited scrolling. See
2356 // adjustInvalidationRectForCompositedScrolling().
2357 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
2358 }; 2337 };
2359 2338
2360 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer 2339 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer
2361 // hit. 2340 // hit.
2362 class DeprecatedDisableModifyLayoutTreeStructureAsserts { 2341 class DeprecatedDisableModifyLayoutTreeStructureAsserts {
2363 STACK_ALLOCATED(); 2342 STACK_ALLOCATED();
2364 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); 2343 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts);
2365 2344
2366 public: 2345 public:
2367 DeprecatedDisableModifyLayoutTreeStructureAsserts(); 2346 DeprecatedDisableModifyLayoutTreeStructureAsserts();
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2548 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2570 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2549 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2571 // We don't make object2 an optional parameter so that showLayoutTree 2550 // We don't make object2 an optional parameter so that showLayoutTree
2572 // can be called from gdb easily. 2551 // can be called from gdb easily.
2573 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2552 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2574 const blink::LayoutObject* object2); 2553 const blink::LayoutObject* object2);
2575 2554
2576 #endif 2555 #endif
2577 2556
2578 #endif // LayoutObject_h 2557 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698