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

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

Issue 1516683002: Introducing LayoutObject::mapToVisibleRectInContainerSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix flipping logic Created 5 years 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
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 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 { 1576 {
1577 return clippedOverflowRectForPaintInvalidation(view()); 1577 return clippedOverflowRectForPaintInvalidation(view());
1578 } 1578 }
1579 1579
1580 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox ModelObject*, const PaintInvalidationState*) const 1580 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox ModelObject*, const PaintInvalidationState*) const
1581 { 1581 {
1582 ASSERT_NOT_REACHED(); 1582 ASSERT_NOT_REACHED();
1583 return LayoutRect(); 1583 return LayoutRect();
1584 } 1584 }
1585 1585
1586 void LayoutObject::mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pai ntInvalidationState) const 1586 void LayoutObject::mapToVisibleRectInContainerSpace(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pain tInvalidationState) const
1587 { 1587 {
1588 if (paintInvalidationContainer == this) 1588 if (paintInvalidationContainer == this)
1589 return; 1589 return;
1590 1590
1591 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) { 1591 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) {
1592 rect.move(paintInvalidationState->paintOffset()); 1592 rect.move(paintInvalidationState->paintOffset());
1593 if (paintInvalidationState->isClipped()) 1593 if (paintInvalidationState->isClipped())
1594 rect.intersect(paintInvalidationState->clipRect()); 1594 rect.intersect(paintInvalidationState->clipRect());
1595 return; 1595 return;
1596 } 1596 }
1597 1597
1598 if (LayoutObject* o = parent()) { 1598 if (LayoutObject* o = parent()) {
1599 if (o->hasOverflowClip()) { 1599 if (o != paintInvalidationContainer && o->hasOverflowClip()) {
1600 LayoutBox* boxParent = toLayoutBox(o); 1600 LayoutBox* boxParent = toLayoutBox(o);
1601 boxParent->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); 1601 if (o == paintInvalidationContainer)
1602 boxParent->applyCachedScrollOffsetForPaintInvalidation(rect);
1603 else
1604 boxParent->applyCachedClipAndScrollOffsetForPaintInvalidation(re ct);
1602 if (rect.isEmpty()) 1605 if (rect.isEmpty())
1603 return; 1606 return;
1604 } 1607 }
1605 1608
1606 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, p aintInvalidationState); 1609 o->mapToVisibleRectInContainerSpace(paintInvalidationContainer, rect, pa intInvalidationState);
1607 } 1610 }
1608 } 1611 }
1609 1612
1610 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*) 1613 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*)
1611 { 1614 {
1612 } 1615 }
1613 1616
1614 #ifndef NDEBUG 1617 #ifndef NDEBUG
1615 1618
1616 void LayoutObject::showTreeForThis() const 1619 void LayoutObject::showTreeForThis() const
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after
3520 const blink::LayoutObject* root = object1; 3523 const blink::LayoutObject* root = object1;
3521 while (root->parent()) 3524 while (root->parent())
3522 root = root->parent(); 3525 root = root->parent();
3523 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3526 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3524 } else { 3527 } else {
3525 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3528 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3526 } 3529 }
3527 } 3530 }
3528 3531
3529 #endif 3532 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutReplaced.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698