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

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

Issue 1315993004: Implement a paint offset cache for slimming paint v2 (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
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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 LayoutSize previousPaintInvalidationRectSize() const { return previousPaintI nvalidationRect().size(); } 1002 LayoutSize previousPaintInvalidationRectSize() const { return previousPaintI nvalidationRect().size(); }
1003 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; } 1003 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; }
1004 1004
1005 // Only adjusts if the paint invalidation container is not a composited scro ller. 1005 // Only adjusts if the paint invalidation container is not a composited scro ller.
1006 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro llDelta); 1006 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro llDelta);
1007 1007
1008 // The previous position of the top-left corner of the object in its previou s paint backing. 1008 // The previous position of the top-left corner of the object in its previou s paint backing.
1009 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; } 1009 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; }
1010 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; } 1010 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; }
1011 1011
1012 // Cache of the previous paint offset for slimming paint v2.
1013 const LayoutPoint& cachedPaintOffset() const;
1014 void updateCachedPaintOffset(const LayoutPoint&) const;
1015
1012 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); } 1016 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); }
1013 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; } 1017 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; }
1014 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull); 1018 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull);
1015 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); } 1019 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); }
1016 1020
1017 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } 1021 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); }
1018 1022
1019 virtual void clearPaintInvalidationState(const PaintInvalidationState&); 1023 virtual void clearPaintInvalidationState(const PaintInvalidationState&);
1020 1024
1021 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } 1025 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); }
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 static bool s_affectsParentBlock; 1424 static bool s_affectsParentBlock;
1421 1425
1422 // This stores the paint invalidation rect from the previous frame. This rec t does *not* account for composited scrolling. See 1426 // This stores the paint invalidation rect from the previous frame. This rec t does *not* account for composited scrolling. See
1423 // adjustInvalidationRectForCompositedScrolling(). 1427 // adjustInvalidationRectForCompositedScrolling().
1424 LayoutRect m_previousPaintInvalidationRect; 1428 LayoutRect m_previousPaintInvalidationRect;
1425 1429
1426 // This stores the position in the paint invalidation backing's coordinate. 1430 // This stores the position in the paint invalidation backing's coordinate.
1427 // It is used to detect layoutObject shifts that forces a full invalidation. 1431 // It is used to detect layoutObject shifts that forces a full invalidation.
1428 // This point does *not* account for composited scrolling. See adjustInvalid ationRectForCompositedScrolling(). 1432 // This point does *not* account for composited scrolling. See adjustInvalid ationRectForCompositedScrolling().
1429 LayoutPoint m_previousPositionFromPaintInvalidationBacking; 1433 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
1434
1435 // Previous paint offset for slimming paint v2.
1436 // TODO(pdr): This should be merged with m_previousPositionFromPaintInvalida tionBacking (https://codereview.chromium.org/1315213002).
1437 // DO NOT COMMIT until https://codereview.chromium.org/1315213002 lands.
1438 mutable LayoutPoint m_cachedPaintOffset;
Xianzhu 2015/08/27 17:20:10 Would m_previousPaintOffset be better, as we don't
pdr. 2015/08/28 03:31:41 In the latest patch I've moved the cache to the di
1430 }; 1439 };
1431 1440
1432 // 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 .
1433 class DeprecatedDisableModifyLayoutTreeStructureAsserts { 1442 class DeprecatedDisableModifyLayoutTreeStructureAsserts {
1434 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); 1443 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts);
1435 public: 1444 public:
1436 DeprecatedDisableModifyLayoutTreeStructureAsserts(); 1445 DeprecatedDisableModifyLayoutTreeStructureAsserts();
1437 1446
1438 static bool canModifyLayoutTreeStateInAnyState(); 1447 static bool canModifyLayoutTreeStateInAnyState();
1439 1448
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1656 void showTree(const blink::LayoutObject*); 1665 void showTree(const blink::LayoutObject*);
1657 void showLineTree(const blink::LayoutObject*); 1666 void showLineTree(const blink::LayoutObject*);
1658 void showLayoutTree(const blink::LayoutObject* object1); 1667 void showLayoutTree(const blink::LayoutObject* object1);
1659 // We don't make object2 an optional parameter so that showLayoutTree 1668 // We don't make object2 an optional parameter so that showLayoutTree
1660 // can be called from gdb easily. 1669 // can be called from gdb easily.
1661 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1670 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1662 1671
1663 #endif 1672 #endif
1664 1673
1665 #endif // LayoutObject_h 1674 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutObject.cpp » ('j') | Source/core/paint/BlockFlowPainter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698