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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 #include "core/layout/LayoutTableCaption.h" | 69 #include "core/layout/LayoutTableCaption.h" |
| 70 #include "core/layout/LayoutTableCell.h" | 70 #include "core/layout/LayoutTableCell.h" |
| 71 #include "core/layout/LayoutTableCol.h" | 71 #include "core/layout/LayoutTableCol.h" |
| 72 #include "core/layout/LayoutTableRow.h" | 72 #include "core/layout/LayoutTableRow.h" |
| 73 #include "core/layout/LayoutTheme.h" | 73 #include "core/layout/LayoutTheme.h" |
| 74 #include "core/layout/LayoutView.h" | 74 #include "core/layout/LayoutView.h" |
| 75 #include "core/layout/compositing/PaintLayerCompositor.h" | 75 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 76 #include "core/page/AutoscrollController.h" | 76 #include "core/page/AutoscrollController.h" |
| 77 #include "core/page/Page.h" | 77 #include "core/page/Page.h" |
| 78 #include "core/paint/ObjectPainter.h" | 78 #include "core/paint/ObjectPainter.h" |
| 79 #include "core/paint/PaintInfo.h" | |
| 79 #include "core/paint/PaintLayer.h" | 80 #include "core/paint/PaintLayer.h" |
| 80 #include "core/style/ContentData.h" | 81 #include "core/style/ContentData.h" |
| 81 #include "core/style/ShadowList.h" | 82 #include "core/style/ShadowList.h" |
| 82 #include "platform/JSONValues.h" | 83 #include "platform/JSONValues.h" |
| 83 #include "platform/RuntimeEnabledFeatures.h" | 84 #include "platform/RuntimeEnabledFeatures.h" |
| 84 #include "platform/TraceEvent.h" | 85 #include "platform/TraceEvent.h" |
| 85 #include "platform/TracedValue.h" | 86 #include "platform/TracedValue.h" |
| 86 #include "platform/geometry/TransformState.h" | 87 #include "platform/geometry/TransformState.h" |
| 87 #include "platform/graphics/GraphicsContext.h" | 88 #include "platform/graphics/GraphicsContext.h" |
| 88 #include "platform/graphics/paint/DisplayItemList.h" | 89 #include "platform/graphics/paint/DisplayItemList.h" |
| (...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1409 if (invalidationReason == PaintInvalidationIncremental) { | 1410 if (invalidationReason == PaintInvalidationIncremental) { |
| 1410 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds, newLocation); | 1411 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds, newLocation); |
| 1411 return invalidationReason; | 1412 return invalidationReason; |
| 1412 } | 1413 } |
| 1413 | 1414 |
| 1414 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds); | 1415 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds); |
| 1415 | 1416 |
| 1416 return invalidationReason; | 1417 return invalidationReason; |
| 1417 } | 1418 } |
| 1418 | 1419 |
| 1420 void LayoutObject::invalidatePaintIfNeededForSynchronziedPainting(const PaintInf o& paintInfo) | |
| 1421 { | |
| 1422 ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()); | |
| 1423 ASSERT(document().lifecycle().state() == DocumentLifecycle::InPaint); | |
| 1424 ASSERT(paintInfo.paintInvalidationState); | |
| 1425 ASSERT(paintInfo.paintContainer()); | |
| 1426 | |
| 1427 DisplayItemList* displayItemList = paintInfo.context->displayItemList(); | |
| 1428 // TODO(chrishtr): paintInvalidationContainer for squashed layer. | |
|
chrishtr
2015/10/05 21:50:35
This works out of the box. GraphicsLayer::paint ca
Xianzhu
2015/10/05 22:04:15
Done.
| |
| 1429 const LayoutBoxModelObject& paintInvalidationContainer = *paintInfo.paintCon tainer(); | |
| 1430 | |
| 1431 if (displayItemList->clientHasCheckedPaintInvalidation(displayItemClient())) { | |
| 1432 ASSERT(displayItemList->clientCacheIsValid(displayItemClient()) | |
| 1433 == (invalidatePaintIfNeeded(*paintInfo.paintInvalidationState, paint InvalidationContainer) == PaintInvalidationNone)); | |
| 1434 return; | |
| 1435 } | |
| 1436 | |
| 1437 PaintInvalidationReason reason = invalidatePaintIfNeeded(*paintInfo.paintInv alidationState, paintInvalidationContainer); | |
| 1438 clearPaintInvalidationState(*paintInfo.paintInvalidationState); | |
| 1439 | |
| 1440 if (reason == PaintInvalidationDelayedFull) | |
| 1441 paintInfo.paintInvalidationState->pushDelayedPaintInvalidationTarget(*th is); | |
| 1442 | |
| 1443 displayItemList->setClientHasCheckedPaintInvalidation(displayItemClient()); | |
| 1444 } | |
| 1445 | |
| 1419 PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxMod elObject& paintInvalidationContainer, | 1446 PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxMod elObject& paintInvalidationContainer, |
| 1420 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida tionBacking, | 1447 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida tionBacking, |
| 1421 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida tionBacking) const | 1448 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida tionBacking) const |
| 1422 { | 1449 { |
| 1423 // First check for InvalidationLocationChange to avoid it from being hidden by other | 1450 // First check for InvalidationLocationChange to avoid it from being hidden by other |
| 1424 // invalidation reasons because we'll need to force check for paint invalida tion for | 1451 // invalidation reasons because we'll need to force check for paint invalida tion for |
| 1425 // children when location of this object changed. | 1452 // children when location of this object changed. |
| 1426 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat ionBacking) | 1453 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat ionBacking) |
| 1427 return PaintInvalidationLocationChange; | 1454 return PaintInvalidationLocationChange; |
| 1428 | 1455 |
| (...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3435 const blink::LayoutObject* root = object1; | 3462 const blink::LayoutObject* root = object1; |
| 3436 while (root->parent()) | 3463 while (root->parent()) |
| 3437 root = root->parent(); | 3464 root = root->parent(); |
| 3438 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3465 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3439 } else { | 3466 } else { |
| 3440 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3467 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3441 } | 3468 } |
| 3442 } | 3469 } |
| 3443 | 3470 |
| 3444 #endif | 3471 #endif |
| OLD | NEW |