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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 { | 389 { |
| 390 ASSERT(!needsLayout()); | 390 ASSERT(!needsLayout()); |
| 391 | 391 |
| 392 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is); | 392 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th is); |
| 393 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) | 393 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) |
| 394 return; | 394 return; |
| 395 | 395 |
| 396 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe ct(); | 396 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe ct(); |
| 397 LayoutPoint previousPosition = previousPositionFromPaintInvalidationBacking( ); | 397 LayoutPoint previousPosition = previousPositionFromPaintInvalidationBacking( ); |
| 398 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState); | 398 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio nState); |
| 399 clearPaintInvalidationFlags(newPaintInvalidationState); | |
| 400 | 399 |
| 401 if (previousPosition != previousPositionFromPaintInvalidationBacking()) | 400 if (previousPosition != previousPositionFromPaintInvalidationBacking()) |
| 402 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta iner(); | 401 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta iner(); |
| 403 | 402 |
| 404 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre eIfNeeded() when removing the following workarounds. | 403 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre eIfNeeded() when removing the following workarounds. |
| 405 | 404 |
| 406 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching. | 405 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching. |
| 407 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) | 406 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) |
| 408 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta iner(); | 407 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta iner(); |
| 409 | 408 |
| 410 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha ve enough saved information to do accurate check | 409 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha ve enough saved information to do accurate check |
| 411 // of clipping change. Will remove when we remove rect-based paint invalidat ion. | 410 // of clipping change. Will remove when we remove rect-based paint invalidat ion. |
| 412 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() | 411 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
| 413 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( ) | 412 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( ) |
| 414 && !usesCompositedScrolling() | 413 && !usesCompositedScrolling() |
| 415 && hasOverflowClip()) | 414 && hasOverflowClip()) |
| 416 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon tainer(); | 415 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon tainer(); |
| 417 | 416 |
| 418 newPaintInvalidationState.updateForChildren(reason); | 417 newPaintInvalidationState.updateForChildren(reason); |
| 418 clearPaintInvalidationFlags(newPaintInvalidationState); | |
|
chrishtr
2016/05/23 20:10:32
What does this have to do with the fix here?
Xianzhu
2016/05/23 21:35:49
Now we check m_currentObject.mayNeedPaintInvalidat
| |
| 419 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 419 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 420 } | 420 } |
| 421 | 421 |
| 422 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c onst | 422 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c onst |
| 423 { | 423 { |
| 424 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready. | 424 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready. |
| 425 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 425 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 426 | 426 |
| 427 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, | 427 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, |
| 428 // so assert but check that the layer is composited. | 428 // so assert but check that the layer is composited. |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1116 if (rootElementStyle->hasBackground()) | 1116 if (rootElementStyle->hasBackground()) |
| 1117 return false; | 1117 return false; |
| 1118 | 1118 |
| 1119 if (node() != document().firstBodyElement()) | 1119 if (node() != document().firstBodyElement()) |
| 1120 return false; | 1120 return false; |
| 1121 | 1121 |
| 1122 return true; | 1122 return true; |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 } // namespace blink | 1125 } // namespace blink |
| OLD | NEW |