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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1378 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt ate.paintInvalidationContainer(); | 1378 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt ate.paintInvalidationContainer(); |
| 1379 ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); | 1379 ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); |
| 1380 | 1380 |
| 1381 const LayoutRect oldBounds = previousPaintInvalidationRect(); | 1381 const LayoutRect oldBounds = previousPaintInvalidationRect(); |
| 1382 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintInvalid ationEnabled() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking(); | 1382 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintInvalid ationEnabled() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking(); |
| 1383 LayoutRect newBounds = paintInvalidationState.computePaintInvalidationRectIn Backing(); | 1383 LayoutRect newBounds = paintInvalidationState.computePaintInvalidationRectIn Backing(); |
| 1384 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintInvalidationE nabled() ? LayoutPoint() : paintInvalidationState.computePositionFromPaintInvali dationBacking(); | 1384 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintInvalidationE nabled() ? LayoutPoint() : paintInvalidationState.computePositionFromPaintInvali dationBacking(); |
| 1385 | 1385 |
| 1386 // Composited scrolling should not be included in the bounds and position tr acking, because the graphics layer backing the scroller | 1386 // Composited scrolling should not be included in the bounds and position tr acking, because the graphics layer backing the scroller |
| 1387 // does not move on scroll. | 1387 // does not move on scroll. |
| 1388 // TODO(chrishtr): can we just avoid adding in the scroll in the first place in LayoutBox::mapScrollingContentsRectToBoxSpace? | |
| 1388 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) { | 1389 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) { |
| 1389 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset()); | 1390 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset()); |
| 1391 // Flipped-blocks scrolling grows in the opposite direction. | |
| 1392 if (UNLIKELY(hasFlippedBlocksWritingMode())) | |
| 1393 inverseOffset.setWidth(-inverseOffset.width()); | |
| 1394 | |
| 1395 PaintLayerScrollableArea* scrollableArea = paintInvalidationContainer.ge tScrollableArea(); | |
| 1396 DCHECK(scrollableArea); | |
| 1397 | |
| 1398 // Adjust for the scroll origin. Flipped-blocks writing mode scrolling s tarts at a different origin. | |
| 1399 if (UNLIKELY(hasFlippedBlocksWritingMode())) | |
| 1400 inverseOffset = inverseOffset + toLayoutSize(LayoutPoint(scrollableA rea->scrollOrigin())); | |
|
wkorman
2016/07/14 23:48:52
nit: could use += and rm the rhs inverseOffset
chrishtr
2016/07/14 23:51:10
Done.
| |
| 1401 | |
| 1390 newLocation.move(inverseOffset); | 1402 newLocation.move(inverseOffset); |
| 1391 newBounds.move(inverseOffset); | 1403 newBounds.move(inverseOffset); |
| 1392 } | 1404 } |
| 1393 | 1405 |
| 1394 setPreviousPaintInvalidationRect(newBounds); | 1406 setPreviousPaintInvalidationRect(newBounds); |
| 1395 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 1407 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 1396 setPreviousPositionFromPaintInvalidationBacking(newLocation); | 1408 setPreviousPositionFromPaintInvalidationBacking(newLocation); |
| 1397 | 1409 |
| 1398 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() && paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinContainerOnly()) { | 1410 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() && paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinContainerOnly()) { |
| 1399 // We are done updating the paint invalidation rect. No other paint inva lidation work to do for this object. | 1411 // We are done updating the paint invalidation rect. No other paint inva lidation work to do for this object. |
| (...skipping 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3677 const blink::LayoutObject* root = object1; | 3689 const blink::LayoutObject* root = object1; |
| 3678 while (root->parent()) | 3690 while (root->parent()) |
| 3679 root = root->parent(); | 3691 root = root->parent(); |
| 3680 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3692 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3681 } else { | 3693 } else { |
| 3682 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3694 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3683 } | 3695 } |
| 3684 } | 3696 } |
| 3685 | 3697 |
| 3686 #endif | 3698 #endif |
| OLD | NEW |