Chromium Code Reviews| 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. All rights reserv ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1190 | 1190 |
| 1191 if (HostWindow* window = frameView->hostWindow()) | 1191 if (HostWindow* window = frameView->hostWindow()) |
| 1192 window->invalidateRect(frameView->contentsToRootFrame(paintRect)); | 1192 window->invalidateRect(frameView->contentsToRootFrame(paintRect)); |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 void LayoutObject::invalidatePaintUsingContainer(const LayoutBoxModelObject& pai ntInvalidationContainer, const LayoutRect& dirtyRect, PaintInvalidationReason in validationReason) const | 1195 void LayoutObject::invalidatePaintUsingContainer(const LayoutBoxModelObject& pai ntInvalidationContainer, const LayoutRect& dirtyRect, PaintInvalidationReason in validationReason) const |
| 1196 { | 1196 { |
| 1197 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) | 1197 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) |
| 1198 return; | 1198 return; |
| 1199 | 1199 |
| 1200 FrameView* frameView = paintInvalidationContainer.frameView(); | |
| 1201 if (frameView && frameView->shouldThrottleRenderingIfAllowed()) | |
|
esprehn
2015/10/14 22:09:46
ditto, the frameView must not be null if the Layou
Sami
2015/10/16 16:48:09
Done.
| |
| 1202 return; | |
| 1203 | |
| 1200 ASSERT(gDisablePaintInvalidationStateAsserts || document().lifecycle().state () == DocumentLifecycle::InPaintInvalidation); | 1204 ASSERT(gDisablePaintInvalidationStateAsserts || document().lifecycle().state () == DocumentLifecycle::InPaintInvalidation); |
| 1201 | 1205 |
| 1202 if (dirtyRect.isEmpty()) | 1206 if (dirtyRect.isEmpty()) |
| 1203 return; | 1207 return; |
| 1204 | 1208 |
| 1205 RELEASE_ASSERT(isRooted()); | 1209 RELEASE_ASSERT(isRooted()); |
| 1206 | 1210 |
| 1207 // FIXME: Unify "devtools.timeline.invalidationTracking" and "blink.invalida tion". crbug.com/413527. | 1211 // FIXME: Unify "devtools.timeline.invalidationTracking" and "blink.invalida tion". crbug.com/413527. |
| 1208 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidati onTracking"), | 1212 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidati onTracking"), |
| 1209 "PaintInvalidationTracking", | 1213 "PaintInvalidationTracking", |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3239 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason( ) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull; | 3243 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason( ) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull; |
| 3240 | 3244 |
| 3241 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is UpgradingDelayedFullToFull) { | 3245 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is UpgradingDelayedFullToFull) { |
| 3242 if (reason == PaintInvalidationFull) | 3246 if (reason == PaintInvalidationFull) |
| 3243 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle()); | 3247 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle()); |
| 3244 m_bitfields.setFullPaintInvalidationReason(reason); | 3248 m_bitfields.setFullPaintInvalidationReason(reason); |
| 3245 } | 3249 } |
| 3246 | 3250 |
| 3247 if (!isUpgradingDelayedFullToFull) { | 3251 if (!isUpgradingDelayedFullToFull) { |
| 3248 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInval idation); | 3252 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInval idation); |
| 3249 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). | 3253 if (!frameView() || !frameView()->shouldThrottleRendering()) |
|
esprehn
2015/10/14 22:09:46
no null check
Sami
2015/10/16 16:48:09
Done.
| |
| 3254 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). | |
| 3250 markContainerChainForPaintInvalidation(); | 3255 markContainerChainForPaintInvalidation(); |
| 3251 } | 3256 } |
| 3252 } | 3257 } |
| 3253 | 3258 |
| 3254 void LayoutObject::setMayNeedPaintInvalidation() | 3259 void LayoutObject::setMayNeedPaintInvalidation() |
| 3255 { | 3260 { |
| 3256 if (mayNeedPaintInvalidation()) | 3261 if (mayNeedPaintInvalidation()) |
| 3257 return; | 3262 return; |
| 3258 m_bitfields.setMayNeedPaintInvalidation(true); | 3263 m_bitfields.setMayNeedPaintInvalidation(true); |
| 3259 markContainerChainForPaintInvalidation(); | 3264 markContainerChainForPaintInvalidation(); |
| 3260 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). | 3265 if (!frameView() || !frameView()->shouldThrottleRendering()) |
| 3266 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). | |
|
esprehn
2015/10/14 22:09:46
this should be inside a helper so we don't need th
Sami
2015/10/16 16:48:09
Added Frame::scheduleVisualUpdateUnlessThrottled()
| |
| 3261 } | 3267 } |
| 3262 | 3268 |
| 3263 void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& pai ntInvalidationState) | 3269 void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& pai ntInvalidationState) |
| 3264 { | 3270 { |
| 3265 // paintInvalidationStateIsDirty should be kept in sync with the | 3271 // paintInvalidationStateIsDirty should be kept in sync with the |
| 3266 // booleans that are cleared below. | 3272 // booleans that are cleared below. |
| 3267 ASSERT(paintInvalidationState.forcedSubtreeInvalidationWithinContainer() || paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinContainer() || p aintInvalidationStateIsDirty()); | 3273 ASSERT(paintInvalidationState.forcedSubtreeInvalidationWithinContainer() || paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinContainer() || p aintInvalidationStateIsDirty()); |
| 3268 clearShouldDoFullPaintInvalidation(); | 3274 clearShouldDoFullPaintInvalidation(); |
| 3269 m_bitfields.setChildShouldCheckForPaintInvalidation(false); | 3275 m_bitfields.setChildShouldCheckForPaintInvalidation(false); |
| 3270 m_bitfields.setNeededLayoutBecauseOfChildren(false); | 3276 m_bitfields.setNeededLayoutBecauseOfChildren(false); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3468 const blink::LayoutObject* root = object1; | 3474 const blink::LayoutObject* root = object1; |
| 3469 while (root->parent()) | 3475 while (root->parent()) |
| 3470 root = root->parent(); | 3476 root = root->parent(); |
| 3471 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3477 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3472 } else { | 3478 } else { |
| 3473 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3479 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3474 } | 3480 } |
| 3475 } | 3481 } |
| 3476 | 3482 |
| 3477 #endif | 3483 #endif |
| OLD | NEW |