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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 case InvalidationFull: | 1251 case InvalidationFull: |
1252 return "full"; | 1252 return "full"; |
1253 case InvalidationBorderFitLines: | 1253 case InvalidationBorderFitLines: |
1254 return "border fit lines"; | 1254 return "border fit lines"; |
1255 case InvalidationBorderBoxChange: | 1255 case InvalidationBorderBoxChange: |
1256 return "border box change"; | 1256 return "border box change"; |
1257 case InvalidationBoundsChange: | 1257 case InvalidationBoundsChange: |
1258 return "bounds change"; | 1258 return "bounds change"; |
1259 case InvalidationLocationChange: | 1259 case InvalidationLocationChange: |
1260 return "location change"; | 1260 return "location change"; |
| 1261 case InvalidationBecameVisible: |
| 1262 return "became visible"; |
| 1263 case InvalidationBecameInvisible: |
| 1264 return "became invisible"; |
1261 case InvalidationScroll: | 1265 case InvalidationScroll: |
1262 return "scroll"; | 1266 return "scroll"; |
1263 case InvalidationSelection: | 1267 case InvalidationSelection: |
1264 return "selection"; | 1268 return "selection"; |
1265 case InvalidationLayer: | 1269 case InvalidationLayer: |
1266 return "layer"; | 1270 return "layer"; |
1267 case InvalidationRendererRemoval: | 1271 case InvalidationRendererRemoval: |
1268 return "renderer removal"; | 1272 return "renderer removal"; |
1269 case InvalidationPaintRectangle: | 1273 case InvalidationPaintRectangle: |
1270 return "invalidate paint rectangle"; | 1274 return "invalidate paint rectangle"; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 // can match, so we can early out since we will not need to do any | 1363 // can match, so we can early out since we will not need to do any |
1360 // invalidation. | 1364 // invalidation. |
1361 if (oldBounds == newBounds) | 1365 if (oldBounds == newBounds) |
1362 return InvalidationNone; | 1366 return InvalidationNone; |
1363 | 1367 |
1364 // If we shifted, we don't know the exact reason so we are conservative and
trigger a full invalidation. Shifting could | 1368 // If we shifted, we don't know the exact reason so we are conservative and
trigger a full invalidation. Shifting could |
1365 // be caused by some layout property (left / top) or some in-flow renderer i
nserted / removed before us in the tree. | 1369 // be caused by some layout property (left / top) or some in-flow renderer i
nserted / removed before us in the tree. |
1366 if (newBounds.location() != oldBounds.location()) | 1370 if (newBounds.location() != oldBounds.location()) |
1367 return InvalidationBoundsChange; | 1371 return InvalidationBoundsChange; |
1368 | 1372 |
1369 // If the size is zero on one of our bounds then we know we're going to have | |
1370 // to do a full invalidation of either old bounds or new bounds. If we fall | |
1371 // into the incremental invalidation we'll issue two invalidations instead | |
1372 // of one. | |
1373 if (oldBounds.size().isZero() || newBounds.size().isZero()) | |
1374 return InvalidationBoundsChange; | |
1375 | |
1376 // This covers the case where we mark containing blocks for layout | 1373 // This covers the case where we mark containing blocks for layout |
1377 // and they change size but don't have anything to paint. This is | 1374 // and they change size but don't have anything to paint. This is |
1378 // a pretty common case for <body> as we add / remove children | 1375 // a pretty common case for <body> as we add / remove children |
1379 // (and the default background is done by FrameView). | 1376 // (and the default background is done by FrameView). |
1380 if (skipInvalidationWhenLaidOutChildren()) | 1377 if (skipInvalidationWhenLaidOutChildren()) |
1381 return InvalidationNone; | 1378 return InvalidationNone; |
1382 | 1379 |
| 1380 // If the size is zero on one of our bounds then we know we're going to have |
| 1381 // to do a full invalidation of either old bounds or new bounds. If we fall |
| 1382 // into the incremental invalidation we'll issue two invalidations instead |
| 1383 // of one. |
| 1384 if (oldBounds.isEmpty()) |
| 1385 return InvalidationBecameVisible; |
| 1386 if (newBounds.isEmpty()) |
| 1387 return InvalidationBecameInvisible; |
| 1388 |
1383 return InvalidationIncremental; | 1389 return InvalidationIncremental; |
1384 } | 1390 } |
1385 | 1391 |
1386 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& pa
intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun
ds, const LayoutPoint& positionFromPaintInvalidationBacking) | 1392 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& pa
intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun
ds, const LayoutPoint& positionFromPaintInvalidationBacking) |
1387 { | 1393 { |
1388 ASSERT(oldBounds.location() == newBounds.location()); | 1394 ASSERT(oldBounds.location() == newBounds.location()); |
1389 | 1395 |
1390 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); | 1396 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); |
1391 if (deltaRight > 0) | 1397 if (deltaRight > 0) |
1392 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol
dBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncr
emental); | 1398 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol
dBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncr
emental); |
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3165 { | 3171 { |
3166 if (object1) { | 3172 if (object1) { |
3167 const blink::RenderObject* root = object1; | 3173 const blink::RenderObject* root = object1; |
3168 while (root->parent()) | 3174 while (root->parent()) |
3169 root = root->parent(); | 3175 root = root->parent(); |
3170 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3176 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3171 } | 3177 } |
3172 } | 3178 } |
3173 | 3179 |
3174 #endif | 3180 #endif |
OLD | NEW |