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

Side by Side Diff: Source/core/layout/LayoutTableSection.cpp

Issue 1306433002: Let collapsed border drawings be cacheable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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/layout/LayoutTableSection.h ('k') | Source/core/paint/TableCellPainter.cpp » ('j') | 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 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 1595
1596 void LayoutTableSection::removeCachedCollapsedBorders(const LayoutTableCell* cel l) 1596 void LayoutTableSection::removeCachedCollapsedBorders(const LayoutTableCell* cel l)
1597 { 1597 {
1598 if (!table()->collapseBorders()) 1598 if (!table()->collapseBorders())
1599 return; 1599 return;
1600 1600
1601 for (int side = CBSBefore; side <= CBSEnd; ++side) 1601 for (int side = CBSBefore; side <= CBSEnd; ++side)
1602 m_cellsCollapsedBorders.remove(std::make_pair(cell, side)); 1602 m_cellsCollapsedBorders.remove(std::make_pair(cell, side));
1603 } 1603 }
1604 1604
1605 void LayoutTableSection::setCachedCollapsedBorder(const LayoutTableCell* cell, C ollapsedBorderSide side, const CollapsedBorderValue& border) 1605 bool LayoutTableSection::setCachedCollapsedBorder(const LayoutTableCell* cell, C ollapsedBorderSide side, const CollapsedBorderValue& border)
1606 { 1606 {
1607 ASSERT(table()->collapseBorders()); 1607 ASSERT(table()->collapseBorders());
1608 CellsCollapsedBordersMap::iterator it = m_cellsCollapsedBorders.find(std::ma ke_pair(cell, side)); 1608 CellsCollapsedBordersMap::iterator it = m_cellsCollapsedBorders.find(std::ma ke_pair(cell, side));
1609 if (it == m_cellsCollapsedBorders.end()) 1609 if (it == m_cellsCollapsedBorders.end()) {
1610 m_cellsCollapsedBorders.add(std::make_pair(cell, side), border); 1610 m_cellsCollapsedBorders.add(std::make_pair(cell, side), border);
1611 else 1611 return true;
1612 }
1613 if (!it->value.equals(border)) {
1612 it->value = border; 1614 it->value = border;
1615 return true;
1616 }
1617 return false;
1613 } 1618 }
1614 1619
1615 const CollapsedBorderValue& LayoutTableSection::cachedCollapsedBorder(const Layo utTableCell* cell, CollapsedBorderSide side) const 1620 const CollapsedBorderValue& LayoutTableSection::cachedCollapsedBorder(const Layo utTableCell* cell, CollapsedBorderSide side) const
1616 { 1621 {
1617 ASSERT(table()->collapseBorders()); 1622 ASSERT(table()->collapseBorders());
1618 CellsCollapsedBordersMap::const_iterator it = m_cellsCollapsedBorders.find(s td::make_pair(cell, side)); 1623 CellsCollapsedBordersMap::const_iterator it = m_cellsCollapsedBorders.find(s td::make_pair(cell, side));
1619 ASSERT_WITH_SECURITY_IMPLICATION(it != m_cellsCollapsedBorders.end()); 1624 ASSERT_WITH_SECURITY_IMPLICATION(it != m_cellsCollapsedBorders.end());
1620 return it->value; 1625 return it->value;
1621 } 1626 }
1622 1627
(...skipping 14 matching lines...) Expand all
1637 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1642 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1638 if (!style()->isLeftToRightDirection()) 1643 if (!style()->isLeftToRightDirection())
1639 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1644 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1640 else 1645 else
1641 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1646 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1642 1647
1643 cell->setLogicalLocation(cellLocation); 1648 cell->setLogicalLocation(cellLocation);
1644 } 1649 }
1645 1650
1646 } // namespace blink 1651 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableSection.h ('k') | Source/core/paint/TableCellPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698