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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.h

Issue 2654843004: Fix shouldPaint issue when a composited floating iframe becomes non-self-painting (Closed)
Patch Set: Rename setAncestorShouldPaintFloatingObject to updateAncestorShouldPaintFloatingObject Created 3 years, 10 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 PaintLayer* removeChild(PaintLayer*); 243 PaintLayer* removeChild(PaintLayer*);
244 244
245 void removeOnlyThisLayerAfterStyleChange(); 245 void removeOnlyThisLayerAfterStyleChange();
246 void insertOnlyThisLayerAfterStyleChange(); 246 void insertOnlyThisLayerAfterStyleChange();
247 247
248 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle); 248 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle);
249 249
250 // FIXME: Many people call this function while it has out-of-date information. 250 // FIXME: Many people call this function while it has out-of-date information.
251 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } 251 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; }
252 252
253 // PaintLayers which represent LayoutParts may become self-painting due to
254 // being composited. If this is the case, this method returns true.
255 bool isSelfPaintingOnlyBecauseIsCompositedPart() const;
256
257 bool isTransparent() const { 253 bool isTransparent() const {
258 return layoutObject()->isTransparent() || 254 return layoutObject()->isTransparent() ||
259 layoutObject()->style()->hasBlendMode() || layoutObject()->hasMask(); 255 layoutObject()->style()->hasBlendMode() || layoutObject()->hasMask();
260 } 256 }
261 257
262 const PaintLayer* root() const { 258 const PaintLayer* root() const {
263 const PaintLayer* curr = this; 259 const PaintLayer* curr = this;
264 while (curr->parent()) 260 while (curr->parent())
265 curr = curr->parent(); 261 curr = curr->parent();
266 return curr; 262 return curr;
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 m_clipRectsCache = WTF::wrapUnique(new ClipRectsCache); 977 m_clipRectsCache = WTF::wrapUnique(new ClipRectsCache);
982 return *m_clipRectsCache; 978 return *m_clipRectsCache;
983 } 979 }
984 void clearClipRectsCache() const { m_clipRectsCache.reset(); } 980 void clearClipRectsCache() const { m_clipRectsCache.reset(); }
985 981
986 bool has3DTransformedDescendant() const { 982 bool has3DTransformedDescendant() const {
987 DCHECK(!m_needsDescendantDependentFlagsUpdate); 983 DCHECK(!m_needsDescendantDependentFlagsUpdate);
988 return m_has3DTransformedDescendant; 984 return m_has3DTransformedDescendant;
989 } 985 }
990 986
987 // Whether the value of isSelfPaintingLayer() changed since the last clearing
988 // (which happens after the flag is chedked during compositing update).
989 bool selfPaintingStatusChanged() const {
990 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
991 return m_selfPaintingStatusChanged;
992 }
993 void clearSelfPaintingStatusChanged() {
994 DCHECK(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
995 m_selfPaintingStatusChanged = false;
996 }
997
991 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 998 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
992 void endShouldKeepAliveAllClientsRecursive(); 999 void endShouldKeepAliveAllClientsRecursive();
993 #endif 1000 #endif
994 1001
995 private: 1002 private:
996 void setNeedsCompositingInputsUpdateInternal(); 1003 void setNeedsCompositingInputsUpdateInternal();
997 1004
998 void update3DTransformedDescendantStatus(); 1005 void update3DTransformedDescendantStatus();
999 1006
1000 // Bounding box in the coordinates of this layer. 1007 // Bounding box in the coordinates of this layer.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1115 }
1109 1116
1110 void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer) { 1117 void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer) {
1111 m_needsPaintPhaseDescendantOutlines |= 1118 m_needsPaintPhaseDescendantOutlines |=
1112 layer.m_needsPaintPhaseDescendantOutlines; 1119 layer.m_needsPaintPhaseDescendantOutlines;
1113 m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat; 1120 m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat;
1114 m_needsPaintPhaseDescendantBlockBackgrounds |= 1121 m_needsPaintPhaseDescendantBlockBackgrounds |=
1115 layer.m_needsPaintPhaseDescendantBlockBackgrounds; 1122 layer.m_needsPaintPhaseDescendantBlockBackgrounds;
1116 } 1123 }
1117 1124
1118 bool isSelfPaintingLayerForIntrinsicOrScrollingReasons() const;
1119
1120 bool shouldFragmentCompositedBounds(const PaintLayer* compositingLayer) const; 1125 bool shouldFragmentCompositedBounds(const PaintLayer* compositingLayer) const;
1121 1126
1122 void expandRectForStackingChildren(const PaintLayer& compositedLayer, 1127 void expandRectForStackingChildren(const PaintLayer& compositedLayer,
1123 LayoutRect& result, 1128 LayoutRect& result,
1124 PaintLayer::CalculateBoundsOptions) const; 1129 PaintLayer::CalculateBoundsOptions) const;
1125 1130
1126 // The return value is in the space of |stackingParent|, if non-null, or 1131 // The return value is in the space of |stackingParent|, if non-null, or
1127 // |this| otherwise. 1132 // |this| otherwise.
1128 LayoutRect boundingBoxForCompositingInternal( 1133 LayoutRect boundingBoxForCompositingInternal(
1129 const PaintLayer& compositedLayer, 1134 const PaintLayer& compositedLayer,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1; 1197 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1;
1193 unsigned m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty : 1; 1198 unsigned m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty : 1;
1194 1199
1195 // These bitfields are part of ancestor/descendant dependent compositing 1200 // These bitfields are part of ancestor/descendant dependent compositing
1196 // inputs. 1201 // inputs.
1197 unsigned m_hasDescendantWithClipPath : 1; 1202 unsigned m_hasDescendantWithClipPath : 1;
1198 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1; 1203 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1;
1199 unsigned m_hasAncestorWithClipPath : 1; 1204 unsigned m_hasAncestorWithClipPath : 1;
1200 unsigned m_hasRootScrollerAsDescendant : 1; 1205 unsigned m_hasRootScrollerAsDescendant : 1;
1201 1206
1207 unsigned m_selfPaintingStatusChanged : 1;
1208
1202 LayoutBoxModelObject* m_layoutObject; 1209 LayoutBoxModelObject* m_layoutObject;
1203 1210
1204 PaintLayer* m_parent; 1211 PaintLayer* m_parent;
1205 PaintLayer* m_previous; 1212 PaintLayer* m_previous;
1206 PaintLayer* m_next; 1213 PaintLayer* m_next;
1207 PaintLayer* m_first; 1214 PaintLayer* m_first;
1208 PaintLayer* m_last; 1215 PaintLayer* m_last;
1209 1216
1210 // Our (x,y) coordinates are in our parent layer's coordinate space. 1217 // Our (x,y) coordinates are in our parent layer's coordinate space.
1211 LayoutPoint m_location; 1218 LayoutPoint m_location;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 1252
1246 } // namespace blink 1253 } // namespace blink
1247 1254
1248 #ifndef NDEBUG 1255 #ifndef NDEBUG
1249 // Outside the WebCore namespace for ease of invocation from gdb. 1256 // Outside the WebCore namespace for ease of invocation from gdb.
1250 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); 1257 CORE_EXPORT void showLayerTree(const blink::PaintLayer*);
1251 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); 1258 CORE_EXPORT void showLayerTree(const blink::LayoutObject*);
1252 #endif 1259 #endif
1253 1260
1254 #endif // Layer_h 1261 #endif // Layer_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698