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

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

Issue 1287413002: Fix paint invalidation rect tracking within composited scrolling layers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutBoxModelObject.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 virtual void addOutlineRects(Vector<LayoutRect>&, const LayoutPoint& additio nalOffset) const { } 991 virtual void addOutlineRects(Vector<LayoutRect>&, const LayoutPoint& additio nalOffset) const { }
992 992
993 // Compute a list of hit-test rectangles per layer rooted at this layoutObje ct. 993 // Compute a list of hit-test rectangles per layer rooted at this layoutObje ct.
994 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; 994 virtual void computeLayerHitTestRects(LayerHitTestRects&) const;
995 995
996 RespectImageOrientationEnum shouldRespectImageOrientation() const; 996 RespectImageOrientationEnum shouldRespectImageOrientation() const;
997 997
998 bool isRelayoutBoundaryForInspector() const; 998 bool isRelayoutBoundaryForInspector() const;
999 999
1000 // The previous paint invalidation rect in the object's previous paint backi ng. 1000 // The previous paint invalidation rect, in the the space of the paint inval idation container (*not* the graphics layer that paints
1001 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } 1001 // this object).
1002 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling(const L ayoutBoxModelObject& paintInvalidationContainer) const;
1002 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; } 1003 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; }
1003 1004
1005 // Only adjusts if the paint invalidation container is not a composited scro ller.
1006 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro llDelta);
1007
1004 // 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.
1005 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; } 1009 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; }
1006 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; } 1010 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; }
1007 1011
1008 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); } 1012 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi elds.fullPaintInvalidationReason(); }
1009 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; } 1013 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; }
1010 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull); 1014 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull);
1011 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); } 1015 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); }
1012 1016
1013 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } 1017 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 1187
1184 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients 1188 // When this object is invalidated for paint, this method is called to inval idate any DisplayItemClients
1185 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc., 1189 // owned by this object, including the object itself, LayoutText/LayoutInlin e line boxes, etc.,
1186 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and 1190 // not including children which will be invalidated normally during invalida teTreeIfNeeded() and
1187 // parts which are invalidated separately (e.g. scrollbars). 1191 // parts which are invalidated separately (e.g. scrollbars).
1188 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer) const; 1192 virtual void invalidateDisplayItemClients(const LayoutBoxModelObject& paintI nvalidationContainer) const;
1189 1193
1190 void setIsSlowRepaintObject(bool); 1194 void setIsSlowRepaintObject(bool);
1191 1195
1192 private: 1196 private:
1197 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1198
1199 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking|
1200 // to be in the space of the |paintInvalidationContainer|,
1201 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller.
1202 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const;
1203
1193 void clearLayoutRootIfNeeded() const; 1204 void clearLayoutRootIfNeeded() const;
1194 1205
1195 bool isInert() const; 1206 bool isInert() const;
1196 1207
1197 void updateImage(StyleImage*, StyleImage*); 1208 void updateImage(StyleImage*, StyleImage*);
1198 1209
1199 void scheduleRelayout(); 1210 void scheduleRelayout();
1200 1211
1201 void updateShapeImage(const ShapeValue*, const ShapeValue*); 1212 void updateShapeImage(const ShapeValue*, const ShapeValue*);
1202 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers ); 1213 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers );
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } 1430 void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
1420 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } 1431 void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
1421 void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInva lidateOverflowForPaint(b); } 1432 void setShouldInvalidateOverflowForPaint(bool b) { m_bitfields.setShouldInva lidateOverflowForPaint(b); }
1422 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel fNeedsOverflowRecalcAfterStyleChange(b); } 1433 void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setSel fNeedsOverflowRecalcAfterStyleChange(b); }
1423 void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setCh ildNeedsOverflowRecalcAfterStyleChange(b); } 1434 void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setCh ildNeedsOverflowRecalcAfterStyleChange(b); }
1424 1435
1425 private: 1436 private:
1426 // Store state between styleWillChange and styleDidChange 1437 // Store state between styleWillChange and styleDidChange
1427 static bool s_affectsParentBlock; 1438 static bool s_affectsParentBlock;
1428 1439
1429 // This stores the paint invalidation rect from the previous frame. 1440 // This stores the paint invalidation rect from the previous frame. This rec t does *not* account for composited scrolling. See
1441 // adjustInvalidationRectForCompositedScrolling().
1430 LayoutRect m_previousPaintInvalidationRect; 1442 LayoutRect m_previousPaintInvalidationRect;
1431 1443
1432 // This stores the position in the paint invalidation backing's coordinate. 1444 // This stores the position in the paint invalidation backing's coordinate.
1433 // It is used to detect layoutObject shifts that forces a full invalidation. 1445 // It is used to detect layoutObject shifts that forces a full invalidation.
1446 // This point does *not* account for composited scrolling. See adjustInvalid ationRectForCompositedScrolling().
1434 LayoutPoint m_previousPositionFromPaintInvalidationBacking; 1447 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
1435 }; 1448 };
1436 1449
1437 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit . 1450 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit .
1438 class DeprecatedDisableModifyLayoutTreeStructureAsserts { 1451 class DeprecatedDisableModifyLayoutTreeStructureAsserts {
1439 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts); 1452 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts);
1440 public: 1453 public:
1441 DeprecatedDisableModifyLayoutTreeStructureAsserts(); 1454 DeprecatedDisableModifyLayoutTreeStructureAsserts();
1442 1455
1443 static bool canModifyLayoutTreeStateInAnyState(); 1456 static bool canModifyLayoutTreeStateInAnyState();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 void showTree(const blink::LayoutObject*); 1670 void showTree(const blink::LayoutObject*);
1658 void showLineTree(const blink::LayoutObject*); 1671 void showLineTree(const blink::LayoutObject*);
1659 void showLayoutTree(const blink::LayoutObject* object1); 1672 void showLayoutTree(const blink::LayoutObject* object1);
1660 // We don't make object2 an optional parameter so that showLayoutTree 1673 // We don't make object2 an optional parameter so that showLayoutTree
1661 // can be called from gdb easily. 1674 // can be called from gdb easily.
1662 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1675 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1663 1676
1664 #endif 1677 #endif
1665 1678
1666 #endif // LayoutObject_h 1679 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBoxModelObject.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698