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

Side by Side Diff: Source/core/rendering/RenderObject.h

Issue 433603004: Disentangle repaint-after-compositing from updateLayerPositionsAfterLayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 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/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderObject.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 15 matching lines...) Expand all
26 #ifndef RenderObject_h 26 #ifndef RenderObject_h
27 #define RenderObject_h 27 #define RenderObject_h
28 28
29 #include "core/dom/Document.h" 29 #include "core/dom/Document.h"
30 #include "core/dom/DocumentLifecycle.h" 30 #include "core/dom/DocumentLifecycle.h"
31 #include "core/dom/Element.h" 31 #include "core/dom/Element.h"
32 #include "core/editing/TextAffinity.h" 32 #include "core/editing/TextAffinity.h"
33 #include "core/fetch/ImageResourceClient.h" 33 #include "core/fetch/ImageResourceClient.h"
34 #include "core/html/HTMLElement.h" 34 #include "core/html/HTMLElement.h"
35 #include "core/rendering/HitTestRequest.h" 35 #include "core/rendering/HitTestRequest.h"
36 #include "core/rendering/PaintInvalidationState.h"
36 #include "core/rendering/PaintPhase.h" 37 #include "core/rendering/PaintPhase.h"
37 #include "core/rendering/RenderObjectChildList.h" 38 #include "core/rendering/RenderObjectChildList.h"
38 #include "core/rendering/ScrollAlignment.h" 39 #include "core/rendering/ScrollAlignment.h"
39 #include "core/rendering/SubtreeLayoutScope.h" 40 #include "core/rendering/SubtreeLayoutScope.h"
40 #include "core/rendering/compositing/CompositingState.h" 41 #include "core/rendering/compositing/CompositingState.h"
41 #include "core/rendering/compositing/CompositingTriggers.h" 42 #include "core/rendering/compositing/CompositingTriggers.h"
42 #include "core/rendering/style/RenderStyle.h" 43 #include "core/rendering/style/RenderStyle.h"
43 #include "core/rendering/style/StyleInheritedData.h" 44 #include "core/rendering/style/StyleInheritedData.h"
44 #include "platform/geometry/FloatQuad.h" 45 #include "platform/geometry/FloatQuad.h"
45 #include "platform/geometry/LayoutRect.h" 46 #include "platform/geometry/LayoutRect.h"
46 #include "platform/graphics/CompositingReasons.h" 47 #include "platform/graphics/CompositingReasons.h"
47 #include "platform/transforms/TransformationMatrix.h" 48 #include "platform/transforms/TransformationMatrix.h"
48 49
49 namespace blink { 50 namespace blink {
50 51
51 class AffineTransform; 52 class AffineTransform;
52 class Cursor; 53 class Cursor;
53 class Document; 54 class Document;
54 class HitTestLocation; 55 class HitTestLocation;
55 class HitTestResult; 56 class HitTestResult;
56 class InlineBox; 57 class InlineBox;
57 class InlineFlowBox; 58 class InlineFlowBox;
58 class PaintInvalidationState;
59 class Position; 59 class Position;
60 class PositionWithAffinity; 60 class PositionWithAffinity;
61 class PseudoStyleRequest; 61 class PseudoStyleRequest;
62 class RenderBoxModelObject; 62 class RenderBoxModelObject;
63 class RenderBlock; 63 class RenderBlock;
64 class RenderFlowThread; 64 class RenderFlowThread;
65 class RenderGeometryMap; 65 class RenderGeometryMap;
66 class RenderLayer; 66 class RenderLayer;
67 class RenderLayerModelObject; 67 class RenderLayerModelObject;
68 class RenderView; 68 class RenderView;
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99. 852 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99.
853 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali dationContainer, const LayoutRect&, InvalidationReason) const; 853 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali dationContainer, const LayoutRect&, InvalidationReason) const;
854 854
855 // Invalidate the paint of the entire object. Called when, e.g., the color o f a border changes, or when a border 855 // Invalidate the paint of the entire object. Called when, e.g., the color o f a border changes, or when a border
856 // style changes. 856 // style changes.
857 void paintInvalidationForWholeRenderer() const; 857 void paintInvalidationForWholeRenderer() const;
858 858
859 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space. 859 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space.
860 void invalidatePaintRectangle(const LayoutRect&) const; 860 void invalidatePaintRectangle(const LayoutRect&) const;
861 861
862 bool invalidatePaintIfNeeded(const RenderLayerModelObject& paintInvalidation Container, 862 InvalidationReason invalidatePaintIfNeeded(const RenderLayerModelObject& pai ntInvalidationContainer,
863 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva lidationContainer, const PaintInvalidationState&); 863 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva lidationContainer, const PaintInvalidationState&);
864 864
865 // Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint in validation state. 865 // Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint in validation state.
866 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); 866 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&);
867 867
868 virtual void invalidatePaintForOverflow(); 868 virtual void invalidatePaintForOverflow();
869 void invalidatePaintForOverflowIfNeeded(); 869 void invalidatePaintForOverflowIfNeeded();
870 870
871 bool checkForPaintInvalidation() const; 871 bool checkForPaintInvalidation() const;
872 872
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 { 1029 {
1030 m_bitfields.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b); 1030 m_bitfields.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b);
1031 1031
1032 if (b) 1032 if (b)
1033 markContainingBlockChainForPaintInvalidation(); 1033 markContainingBlockChainForPaintInvalidation();
1034 } 1034 }
1035 1035
1036 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee dedPositionedMovementLayout(); } 1036 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee dedPositionedMovementLayout(); }
1037 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed edPositionedMovementLayout(b); } 1037 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed edPositionedMovementLayout(b); }
1038 1038
1039 virtual void clearPaintInvalidationState(); 1039 virtual void clearPaintInvalidationState(const PaintInvalidationState&);
1040 1040
1041 // layoutDidGetCalled indicates whether this render object was re-laid-out 1041 // layoutDidGetCalled indicates whether this render object was re-laid-out
1042 // since the last call to setLayoutDidGetCalled(false) on this object. 1042 // since the last call to setLayoutDidGetCalled(false) on this object.
1043 bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } 1043 bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); }
1044 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); } 1044 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); }
1045 1045
1046 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } 1046 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); }
1047 void setMayNeedPaintInvalidation(bool b) 1047 void setMayNeedPaintInvalidation(bool b)
1048 { 1048 {
1049 m_bitfields.setMayNeedPaintInvalidation(b); 1049 m_bitfields.setMayNeedPaintInvalidation(b);
1050 1050
1051 // Make sure our parent is marked as needing invalidation. 1051 // Make sure our parent is marked as needing invalidation.
1052 if (b) 1052 if (b)
1053 markContainingBlockChainForPaintInvalidation(); 1053 markContainingBlockChainForPaintInvalidation();
1054 } 1054 }
1055 1055
1056 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); } 1056 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); }
1057 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); } 1057 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); }
1058 1058
1059 bool shouldCheckForPaintInvalidation() 1059 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva lidationState)
1060 {
1061 return paintInvalidationState.forceCheckForPaintInvalidation() || should CheckForPaintInvalidationRegardlessOfPaintInvalidationState();
1062 }
1063
1064 bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
1060 { 1065 {
1061 return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFul lPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer(); 1066 return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFul lPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer();
1062 } 1067 }
1063 1068
1064 bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !has Transform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); } 1069 bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !has Transform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); }
1065 1070
1066 void setNeedsOverflowRecalcAfterStyleChange(); 1071 void setNeedsOverflowRecalcAfterStyleChange();
1067 void markContainingBlocksForOverflowRecalc(); 1072 void markContainingBlocksForOverflowRecalc();
1068 1073
1069 protected: 1074 protected:
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 1155
1151 void removeShapeImageClient(ShapeValue*); 1156 void removeShapeImageClient(ShapeValue*);
1152 1157
1153 #if ENABLE(ASSERT) 1158 #if ENABLE(ASSERT)
1154 void checkBlockPositionedObjectsNeedLayout(); 1159 void checkBlockPositionedObjectsNeedLayout();
1155 #endif 1160 #endif
1156 const char* invalidationReasonToString(InvalidationReason) const; 1161 const char* invalidationReasonToString(InvalidationReason) const;
1157 1162
1158 void markContainingBlockChainForPaintInvalidation() 1163 void markContainingBlockChainForPaintInvalidation()
1159 { 1164 {
1160 for (RenderObject* container = this->container(); container && !containe r->shouldCheckForPaintInvalidation(); container = container->container()) 1165 for (RenderObject* container = this->container(); container && !containe r->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); containe r = container->container())
1161 container->setMayNeedPaintInvalidation(true); 1166 container->setMayNeedPaintInvalidation(true);
1162 } 1167 }
1163 1168
1164 static bool isAllowedToModifyRenderTreeStructure(Document&); 1169 static bool isAllowedToModifyRenderTreeStructure(Document&);
1165 1170
1166 RefPtr<RenderStyle> m_style; 1171 RefPtr<RenderStyle> m_style;
1167 1172
1168 Node* m_node; 1173 Node* m_node;
1169 1174
1170 RenderObject* m_parent; 1175 RenderObject* m_parent;
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 void showTree(const blink::RenderObject*); 1539 void showTree(const blink::RenderObject*);
1535 void showLineTree(const blink::RenderObject*); 1540 void showLineTree(const blink::RenderObject*);
1536 void showRenderTree(const blink::RenderObject* object1); 1541 void showRenderTree(const blink::RenderObject* object1);
1537 // We don't make object2 an optional parameter so that showRenderTree 1542 // We don't make object2 an optional parameter so that showRenderTree
1538 // can be called from gdb easily. 1543 // can be called from gdb easily.
1539 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2); 1544 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2);
1540 1545
1541 #endif 1546 #endif
1542 1547
1543 #endif // RenderObject_h 1548 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698