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

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

Issue 1008043002: [S.P.] Don't draw frames of animated images that are offscreen. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 1194
1195 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv alidationState) 1195 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv alidationState)
1196 { 1196 {
1197 ASSERT(!needsLayout()); 1197 ASSERT(!needsLayout());
1198 1198
1199 // If we didn't need paint invalidation then our children don't need as well . 1199 // If we didn't need paint invalidation then our children don't need as well .
1200 // Skip walking down the tree as everything should be fine below us. 1200 // Skip walking down the tree as everything should be fine below us.
1201 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) 1201 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
1202 return; 1202 return;
1203 1203
1204 invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationState.paint InvalidationContainer()); 1204 PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationSt ate, paintInvalidationState.paintInvalidationContainer());
1205 clearPaintInvalidationState(paintInvalidationState); 1205 if (reason != PaintInvalidationDelayedFull) {
1206 clearPaintInvalidationState(paintInvalidationState);
1207 } else {
1208 // Mark this object as needing paint invalidation again in the next fram e, due to the request for delayed paint invalidation.
1209 setShouldDoFullPaintInvalidation();
1210 }
1211
1206 invalidatePaintOfSubtreesIfNeeded(paintInvalidationState); 1212 invalidatePaintOfSubtreesIfNeeded(paintInvalidationState);
1207 } 1213 }
1208 1214
1209 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat e& childPaintInvalidationState) 1215 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat e& childPaintInvalidationState)
1210 { 1216 {
1211 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 1217 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
1212 if (!child->isOutOfFlowPositioned()) 1218 if (!child->isOutOfFlowPositioned())
1213 child->invalidateTreeIfNeeded(childPaintInvalidationState); 1219 child->invalidateTreeIfNeeded(childPaintInvalidationState);
1214 } 1220 }
1215 } 1221 }
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
3105 { 3111 {
3106 // Only full invalidation reasons are allowed. 3112 // Only full invalidation reasons are allowed.
3107 ASSERT(isFullPaintInvalidationReason(reason)); 3113 ASSERT(isFullPaintInvalidationReason(reason));
3108 3114
3109 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone) { 3115 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone) {
3110 if (reason == PaintInvalidationFull) 3116 if (reason == PaintInvalidationFull)
3111 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle()); 3117 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle());
3112 m_bitfields.setFullPaintInvalidationReason(reason); 3118 m_bitfields.setFullPaintInvalidationReason(reason);
3113 } 3119 }
3114 3120
3115 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidat ion);
3116 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). 3121 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting().
3117 markContainerChainForPaintInvalidation(); 3122 markContainerChainForPaintInvalidation();
3118 } 3123 }
3119 3124
3120 void LayoutObject::setMayNeedPaintInvalidation() 3125 void LayoutObject::setMayNeedPaintInvalidation()
3121 { 3126 {
3122 if (mayNeedPaintInvalidation()) 3127 if (mayNeedPaintInvalidation())
3123 return; 3128 return;
3124 m_bitfields.setMayNeedPaintInvalidation(true); 3129 m_bitfields.setMayNeedPaintInvalidation(true);
3125 // Make sure our parent is marked as needing invalidation. 3130 // Make sure our parent is marked as needing invalidation.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
3221 { 3226 {
3222 if (object1) { 3227 if (object1) {
3223 const blink::LayoutObject* root = object1; 3228 const blink::LayoutObject* root = object1;
3224 while (root->parent()) 3229 while (root->parent())
3225 root = root->parent(); 3230 root = root->parent();
3226 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3231 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3227 } 3232 }
3228 } 3233 }
3229 3234
3230 #endif 3235 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698