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

Side by Side Diff: Source/core/rendering/RenderText.cpp

Issue 544743003: Clean up paint invalidation container logic for RenderText. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Created 6 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderText.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 LayoutUnit logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - lo gicalTop; 1569 LayoutUnit logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - lo gicalTop;
1570 1570
1571 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); 1571 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
1572 if (!style()->isHorizontalWritingMode()) 1572 if (!style()->isHorizontalWritingMode())
1573 rect = rect.transposedRect(); 1573 rect = rect.transposedRect();
1574 return rect; 1574 return rect;
1575 } 1575 }
1576 1576
1577 LayoutRect RenderText::clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInva lidationState) const 1577 LayoutRect RenderText::clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInva lidationState) const
1578 { 1578 {
1579 RenderObject* rendererToIssuePaintInvalidations = containingBlock(); 1579 const RenderObject* rendererToIssuePaintInvalidations = containingObjectForP aintInvalidation();
1580
1581 // Do not cross self-painting layer boundaries.
1582 RenderObject* enclosingLayerRenderer = enclosingLayer()->renderer();
1583 if (enclosingLayerRenderer != rendererToIssuePaintInvalidations && !renderer ToIssuePaintInvalidations->isDescendantOf(enclosingLayerRenderer))
1584 rendererToIssuePaintInvalidations = enclosingLayerRenderer;
1585
1586 // The renderer we chose to issue paint invalidations may be an ancestor of paintInvalidationContainer, but we need to do a paintInvalidationContainer-relat ive paint invalidation.
1587 if (paintInvalidationContainer && paintInvalidationContainer != rendererToIs suePaintInvalidations && !rendererToIssuePaintInvalidations->isDescendantOf(pain tInvalidationContainer))
1588 return paintInvalidationContainer->clippedOverflowRectForPaintInvalidati on(paintInvalidationContainer, paintInvalidationState);
1589
1590 return rendererToIssuePaintInvalidations->clippedOverflowRectForPaintInvalid ation(paintInvalidationContainer, paintInvalidationState); 1580 return rendererToIssuePaintInvalidations->clippedOverflowRectForPaintInvalid ation(paintInvalidationContainer, paintInvalidationState);
1591 } 1581 }
1592 1582
1583 const RenderLayerModelObject* RenderText::containingObjectForPaintInvalidation() const
1584 {
1585 RenderLayerModelObject* rendererToIssuePaintInvalidations = containingBlock( );
1586
1587 // Do not cross self-painting layer boundaries.
1588 RenderLayer* layer = enclosingLayer();
1589 if (layer) {
1590 RenderLayerModelObject* enclosingLayerRenderer = layer->renderer();
1591 if (enclosingLayerRenderer != rendererToIssuePaintInvalidations && !rend ererToIssuePaintInvalidations->isDescendantOf(enclosingLayerRenderer))
1592 rendererToIssuePaintInvalidations = enclosingLayerRenderer;
1593 }
1594 return rendererToIssuePaintInvalidations;
1595 }
1596
1597 const RenderLayerModelObject* RenderText::containerForPaintInvalidation() const
1598 {
1599 const RenderObject* rendererToIssuePaintInvalidations = containingObjectForP aintInvalidation();
1600 if (rendererToIssuePaintInvalidations)
1601 return rendererToIssuePaintInvalidations->containerForPaintInvalidation( );
1602 // This can happen for detached render subtrees.
1603 return 0;
1604 }
1605
1593 LayoutRect RenderText::selectionRectForPaintInvalidation(const RenderLayerModelO bject* paintInvalidationContainer, bool clipToVisibleContent) 1606 LayoutRect RenderText::selectionRectForPaintInvalidation(const RenderLayerModelO bject* paintInvalidationContainer, bool clipToVisibleContent)
1594 { 1607 {
1595 ASSERT(!needsLayout()); 1608 ASSERT(!needsLayout());
1596 1609
1597 if (selectionState() == SelectionNone) 1610 if (selectionState() == SelectionNone)
1598 return LayoutRect(); 1611 return LayoutRect();
1599 RenderBlock* cb = containingBlock(); 1612 RenderBlock* cb = containingBlock();
1600 if (!cb) 1613 if (!cb)
1601 return LayoutRect(); 1614 return LayoutRect();
1602 1615
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 } 1886 }
1874 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); 1887 secureTextTimer->restartWithNewText(lastTypedCharacterOffset);
1875 } 1888 }
1876 1889
1877 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox() 1890 PassRefPtr<AbstractInlineTextBox> RenderText::firstAbstractInlineTextBox()
1878 { 1891 {
1879 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox); 1892 return AbstractInlineTextBox::getOrCreate(this, m_firstTextBox);
1880 } 1893 }
1881 1894
1882 } // namespace blink 1895 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698