OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 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) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 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 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 | 1165 |
1166 PaintInvalidationState new_paint_invalidation_state(paint_invalidation_state, | 1166 PaintInvalidationState new_paint_invalidation_state(paint_invalidation_state, |
1167 *this); | 1167 *this); |
1168 | 1168 |
1169 if (MayNeedPaintInvalidationSubtree()) { | 1169 if (MayNeedPaintInvalidationSubtree()) { |
1170 new_paint_invalidation_state | 1170 new_paint_invalidation_state |
1171 .SetForceSubtreeInvalidationCheckingWithinContainer(); | 1171 .SetForceSubtreeInvalidationCheckingWithinContainer(); |
1172 } | 1172 } |
1173 | 1173 |
1174 PaintInvalidationReason reason = | 1174 PaintInvalidationReason reason = |
1175 InvalidatePaintIfNeeded(new_paint_invalidation_state); | 1175 InvalidatePaint(new_paint_invalidation_state); |
1176 new_paint_invalidation_state.UpdateForChildren(reason); | 1176 new_paint_invalidation_state.UpdateForChildren(reason); |
1177 InvalidatePaintOfSubtreesIfNeeded(new_paint_invalidation_state); | 1177 InvalidatePaintOfSubtreesIfNeeded(new_paint_invalidation_state); |
1178 | 1178 |
1179 ClearPaintInvalidationFlags(); | 1179 ClearPaintInvalidationFlags(); |
1180 } | 1180 } |
1181 | 1181 |
1182 DISABLE_CFI_PERF | 1182 DISABLE_CFI_PERF |
1183 void LayoutObject::InvalidatePaintOfSubtreesIfNeeded( | 1183 void LayoutObject::InvalidatePaintOfSubtreesIfNeeded( |
1184 const PaintInvalidationState& child_paint_invalidation_state) { | 1184 const PaintInvalidationState& child_paint_invalidation_state) { |
1185 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | 1185 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
1186 | 1186 |
1187 for (auto* child = SlowFirstChild(); child; child = child->NextSibling()) | 1187 for (auto* child = SlowFirstChild(); child; child = child->NextSibling()) |
1188 child->InvalidateTreeIfNeeded(child_paint_invalidation_state); | 1188 child->InvalidateTreeIfNeeded(child_paint_invalidation_state); |
1189 } | 1189 } |
1190 | 1190 |
1191 LayoutRect LayoutObject::SelectionRectInViewCoordinates() const { | 1191 LayoutRect LayoutObject::SelectionRectInViewCoordinates() const { |
1192 LayoutRect selection_rect = LocalSelectionRect(); | 1192 LayoutRect selection_rect = LocalSelectionRect(); |
1193 if (!selection_rect.IsEmpty()) | 1193 if (!selection_rect.IsEmpty()) |
1194 MapToVisualRectInAncestorSpace(View(), selection_rect); | 1194 MapToVisualRectInAncestorSpace(View(), selection_rect); |
1195 return selection_rect; | 1195 return selection_rect; |
1196 } | 1196 } |
1197 | 1197 |
1198 PaintInvalidationReason LayoutObject::InvalidatePaintIfNeeded( | 1198 PaintInvalidationReason LayoutObject::InvalidatePaint( |
1199 const PaintInvalidationState& paint_invalidation_state) { | 1199 const PaintInvalidationState& paint_invalidation_state) { |
1200 DCHECK_EQ(&paint_invalidation_state.CurrentObject(), this); | 1200 DCHECK_EQ(&paint_invalidation_state.CurrentObject(), this); |
1201 | 1201 |
1202 if (StyleRef().HasOutline()) { | 1202 if (StyleRef().HasOutline()) { |
1203 PaintLayer& layer = paint_invalidation_state.PaintingLayer(); | 1203 PaintLayer& layer = paint_invalidation_state.PaintingLayer(); |
1204 if (&layer.GetLayoutObject() != this) | 1204 if (&layer.GetLayoutObject() != this) |
1205 layer.SetNeedsPaintPhaseDescendantOutlines(); | 1205 layer.SetNeedsPaintPhaseDescendantOutlines(); |
1206 } | 1206 } |
1207 | 1207 |
1208 LayoutView* v = View(); | 1208 LayoutView* v = View(); |
(...skipping 19 matching lines...) Expand all Loading... |
1228 paint_invalidator.SetLocationInBacking(context.new_location); | 1228 paint_invalidator.SetLocationInBacking(context.new_location); |
1229 | 1229 |
1230 if (!ShouldCheckForPaintInvalidation() && | 1230 if (!ShouldCheckForPaintInvalidation() && |
1231 paint_invalidation_state | 1231 paint_invalidation_state |
1232 .ForcedSubtreeInvalidationRectUpdateWithinContainerOnly()) { | 1232 .ForcedSubtreeInvalidationRectUpdateWithinContainerOnly()) { |
1233 // We are done updating the visual rect. No other paint invalidation work | 1233 // We are done updating the visual rect. No other paint invalidation work |
1234 // to do for this object. | 1234 // to do for this object. |
1235 return kPaintInvalidationNone; | 1235 return kPaintInvalidationNone; |
1236 } | 1236 } |
1237 | 1237 |
1238 return InvalidatePaintIfNeeded(context); | 1238 return InvalidatePaint(context); |
1239 } | 1239 } |
1240 | 1240 |
1241 DISABLE_CFI_PERF | 1241 DISABLE_CFI_PERF |
1242 PaintInvalidationReason LayoutObject::InvalidatePaintIfNeeded( | 1242 PaintInvalidationReason LayoutObject::InvalidatePaint( |
1243 const PaintInvalidatorContext& context) const { | 1243 const PaintInvalidatorContext& context) const { |
1244 return ObjectPaintInvalidatorWithContext(*this, context) | 1244 return ObjectPaintInvalidatorWithContext(*this, context).InvalidatePaint(); |
1245 .InvalidatePaintIfNeeded(); | |
1246 } | 1245 } |
1247 | 1246 |
1248 void LayoutObject::AdjustVisualRectForCompositedScrolling( | 1247 void LayoutObject::AdjustVisualRectForCompositedScrolling( |
1249 LayoutRect& rect, | 1248 LayoutRect& rect, |
1250 const LayoutBoxModelObject& paint_invalidation_container) const { | 1249 const LayoutBoxModelObject& paint_invalidation_container) const { |
1251 if (CompositedScrollsWithRespectTo(paint_invalidation_container)) { | 1250 if (CompositedScrollsWithRespectTo(paint_invalidation_container)) { |
1252 LayoutSize offset( | 1251 LayoutSize offset( |
1253 -ToLayoutBox(&paint_invalidation_container)->ScrolledContentOffset()); | 1252 -ToLayoutBox(&paint_invalidation_container)->ScrolledContentOffset()); |
1254 rect.Move(offset); | 1253 rect.Move(offset); |
1255 } | 1254 } |
(...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3654 const blink::LayoutObject* root = object1; | 3653 const blink::LayoutObject* root = object1; |
3655 while (root->Parent()) | 3654 while (root->Parent()) |
3656 root = root->Parent(); | 3655 root = root->Parent(); |
3657 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3656 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3658 } else { | 3657 } else { |
3659 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3658 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3660 } | 3659 } |
3661 } | 3660 } |
3662 | 3661 |
3663 #endif | 3662 #endif |
OLD | NEW |