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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1246173002: Throttle rendering pipeline for invisible iframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased to post merge awesomeness. Created 5 years, 2 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
OLDNEW
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 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason( ) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull; 3167 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason( ) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull;
3168 3168
3169 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is UpgradingDelayedFullToFull) { 3169 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is UpgradingDelayedFullToFull) {
3170 if (reason == PaintInvalidationFull) 3170 if (reason == PaintInvalidationFull)
3171 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle()); 3171 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle());
3172 m_bitfields.setFullPaintInvalidationReason(reason); 3172 m_bitfields.setFullPaintInvalidationReason(reason);
3173 } 3173 }
3174 3174
3175 if (!isUpgradingDelayedFullToFull) { 3175 if (!isUpgradingDelayedFullToFull) {
3176 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInval idation); 3176 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInval idation);
3177 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). 3177 if (!frameView() || !frameView()->shouldThrottleRenderingPipeline())
3178 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting().
3178 markContainerChainForPaintInvalidation(); 3179 markContainerChainForPaintInvalidation();
3179 } 3180 }
3180 } 3181 }
3181 3182
3182 void LayoutObject::setMayNeedPaintInvalidation() 3183 void LayoutObject::setMayNeedPaintInvalidation()
3183 { 3184 {
3184 if (mayNeedPaintInvalidation()) 3185 if (mayNeedPaintInvalidation())
3185 return; 3186 return;
3186 m_bitfields.setMayNeedPaintInvalidation(true); 3187 m_bitfields.setMayNeedPaintInvalidation(true);
3187 markContainerChainForPaintInvalidation(); 3188 markContainerChainForPaintInvalidation();
3188 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). 3189 if (!frameView() || !frameView()->shouldThrottleRenderingPipeline())
3190 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting().
3189 } 3191 }
3190 3192
3191 void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& pai ntInvalidationState) 3193 void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& pai ntInvalidationState)
3192 { 3194 {
3193 // paintInvalidationStateIsDirty should be kept in sync with the 3195 // paintInvalidationStateIsDirty should be kept in sync with the
3194 // booleans that are cleared below. 3196 // booleans that are cleared below.
3195 ASSERT(paintInvalidationState.forcedSubtreeInvalidationWithinContainer() || paintInvalidationStateIsDirty()); 3197 ASSERT(paintInvalidationState.forcedSubtreeInvalidationWithinContainer() || paintInvalidationStateIsDirty());
3196 clearShouldDoFullPaintInvalidation(); 3198 clearShouldDoFullPaintInvalidation();
3197 m_bitfields.setChildShouldCheckForPaintInvalidation(false); 3199 m_bitfields.setChildShouldCheckForPaintInvalidation(false);
3198 m_bitfields.setNeededLayoutBecauseOfChildren(false); 3200 m_bitfields.setNeededLayoutBecauseOfChildren(false);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
3394 const blink::LayoutObject* root = object1; 3396 const blink::LayoutObject* root = object1;
3395 while (root->parent()) 3397 while (root->parent())
3396 root = root->parent(); 3398 root = root->parent();
3397 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3399 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3398 } else { 3400 } else {
3399 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3401 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3400 } 3402 }
3401 } 3403 }
3402 3404
3403 #endif 3405 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698