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

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

Issue 1315213002: (WIP) Paint invalidation for slimming paint v2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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/layout/LayoutTable.h ('k') | Source/core/paint/BlockPainter.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, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights 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 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 } 1390 }
1391 1391
1392 PaintInvalidationReason LayoutTable::invalidatePaintIfNeeded(PaintInvalidationSt ate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContai ner) 1392 PaintInvalidationReason LayoutTable::invalidatePaintIfNeeded(PaintInvalidationSt ate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContai ner)
1393 { 1393 {
1394 // Information of collapsed borders doesn't affect layout and are for painti ng only. 1394 // Information of collapsed borders doesn't affect layout and are for painti ng only.
1395 // Do it now instead of during painting to invalidate table cells if needed. 1395 // Do it now instead of during painting to invalidate table cells if needed.
1396 recalcCollapsedBordersIfNeeded(); 1396 recalcCollapsedBordersIfNeeded();
1397 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState, paintInv alidationContainer); 1397 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState, paintInv alidationContainer);
1398 } 1398 }
1399 1399
1400 PaintInvalidationReason LayoutTable::invalidatePaintIfNeededForSlimmingPaintV2(c onst LayoutPoint& newPaintOffset)
1401 {
1402 // Information of collapsed borders doesn't affect layout and are for painti ng only.
1403 // Do it now instead of during painting to invalidate table cells if needed.
1404 recalcCollapsedBordersIfNeeded();
1405 return LayoutBlock::invalidatePaintIfNeededForSlimmingPaintV2(newPaintOffset );
1406 }
1407
1400 void LayoutTable::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil dPaintInvalidationState) 1408 void LayoutTable::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil dPaintInvalidationState)
1401 { 1409 {
1402 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 1410 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
1403 // Table cells paint background from the containing column group, column , section and row. 1411 // Table cells paint background from the containing column group, column , section and row.
1404 // If background of any of them changed, we need to invalidate all affec ted cells. 1412 // If background of any of them changed, we need to invalidate all affec ted cells.
1405 // Here use shouldDoFullPaintInvalidation() as a broader condition of ba ckground change. 1413 // Here use shouldDoFullPaintInvalidation() as a broader condition of ba ckground change.
1406 for (LayoutObject* section = firstChild(); section; section = section->n extSibling()) { 1414 for (LayoutObject* section = firstChild(); section; section = section->n extSibling()) {
1407 if (!section->isTableSection()) 1415 if (!section->isTableSection())
1408 continue; 1416 continue;
1409 for (LayoutTableRow* row = toLayoutTableSection(section)->firstRow() ; row; row = row->nextRow()) { 1417 for (LayoutTableRow* row = toLayoutTableSection(section)->firstRow() ; row; row = row->nextRow()) {
1410 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell ->nextCell()) { 1418 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell ->nextCell()) {
1411 LayoutTableCol* column = colElement(cell->col()); 1419 LayoutTableCol* column = colElement(cell->col());
1412 LayoutTableCol* columnGroup = column ? column->enclosingColu mnGroup() : 0; 1420 LayoutTableCol* columnGroup = column ? column->enclosingColu mnGroup() : 0;
1413 if ((columnGroup && columnGroup->shouldDoFullPaintInvalidati on()) 1421 if ((columnGroup && columnGroup->shouldDoFullPaintInvalidati on())
1414 || (column && column->shouldDoFullPaintInvalidation()) 1422 || (column && column->shouldDoFullPaintInvalidation())
1415 || section->shouldDoFullPaintInvalidation() 1423 || section->shouldDoFullPaintInvalidation()
1416 || row->shouldDoFullPaintInvalidation()) 1424 || row->shouldDoFullPaintInvalidation())
1417 cell->invalidateDisplayItemClient(*cell); 1425 cell->invalidateDisplayItemClient(*cell);
1418 } 1426 }
1419 } 1427 }
1420 } 1428 }
1421 } 1429 }
1422 1430
1423 LayoutBlock::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); 1431 LayoutBlock::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState);
1424 } 1432 }
1425 1433
1426 } 1434 }
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTable.h ('k') | Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698