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

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

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 return style()->borderEnd(); 1394 return style()->borderEnd();
1395 1395
1396 return style()->borderStart(); 1396 return style()->borderStart();
1397 } 1397 }
1398 1398
1399 PaintInvalidationReason LayoutTable::invalidatePaintIfNeeded(PaintInvalidationSt ate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContai ner) 1399 PaintInvalidationReason LayoutTable::invalidatePaintIfNeeded(PaintInvalidationSt ate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContai ner)
1400 { 1400 {
1401 // Information of collapsed borders doesn't affect layout and are for painti ng only. 1401 // Information of collapsed borders doesn't affect layout and are for painti ng only.
1402 // Do it now instead of during painting to invalidate table cells if needed. 1402 // Do it now instead of during painting to invalidate table cells if needed.
1403 recalcCollapsedBordersIfNeeded(); 1403 recalcCollapsedBordersIfNeeded();
1404 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState, paintInv alidationContainer);
1405 }
1406 1404
1407 void LayoutTable::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& chil dPaintInvalidationState)
1408 {
1409 // Table cells paint background from the containing column group, column, se ction and row. 1405 // Table cells paint background from the containing column group, column, se ction and row.
1410 // If background of any of them changed, we need to invalidate all affected cells. 1406 // If background of any of them changed, we need to invalidate all affected cells.
1411 // Here use shouldDoFullPaintInvalidation() as a broader condition of backgr ound change. 1407 // Here use shouldDoFullPaintInvalidation() as a broader condition of backgr ound change.
1412 for (LayoutObject* section = firstChild(); section; section = section->nextS ibling()) { 1408 for (LayoutObject* section = firstChild(); section; section = section->nextS ibling()) {
1413 if (!section->isTableSection()) 1409 if (!section->isTableSection())
1414 continue; 1410 continue;
1415 for (LayoutTableRow* row = toLayoutTableSection(section)->firstRow(); ro w; row = row->nextRow()) { 1411 for (LayoutTableRow* row = toLayoutTableSection(section)->firstRow(); ro w; row = row->nextRow()) {
1416 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->ne xtCell()) { 1412 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->ne xtCell()) {
1417 ColAndColGroup colAndColGroup = colElement(cell->col()); 1413 ColAndColGroup colAndColGroup = colElement(cell->col());
1418 LayoutTableCol* column = colAndColGroup.col; 1414 LayoutTableCol* column = colAndColGroup.col;
1419 LayoutTableCol* columnGroup = colAndColGroup.colgroup; 1415 LayoutTableCol* columnGroup = colAndColGroup.colgroup;
1420 // Table cells paint container's background on the container's b acking instead of its own (if any), 1416 // Table cells paint container's background on the container's b acking instead of its own (if any),
1421 // so we must invalidate it by the containers. 1417 // so we must invalidate it by the containers.
1422 bool invalidated = false; 1418 bool invalidated = false;
1423 if ((columnGroup && columnGroup->shouldDoFullPaintInvalidation() ) 1419 if ((columnGroup && columnGroup->shouldDoFullPaintInvalidation() )
1424 || (column && column->shouldDoFullPaintInvalidation()) 1420 || (column && column->shouldDoFullPaintInvalidation())
1425 || section->shouldDoFullPaintInvalidation()) { 1421 || section->shouldDoFullPaintInvalidation()) {
1426 section->invalidateDisplayItemClient(*cell); 1422 section->invalidateDisplayItemClient(*cell);
1427 invalidated = true; 1423 invalidated = true;
1428 } 1424 }
1429 if ((!invalidated || row->isPaintInvalidationContainer()) && row ->shouldDoFullPaintInvalidation()) 1425 if ((!invalidated || row->isPaintInvalidationContainer()) && row ->shouldDoFullPaintInvalidation())
1430 row->invalidateDisplayItemClient(*cell); 1426 row->invalidateDisplayItemClient(*cell);
1431 } 1427 }
1432 } 1428 }
1433 } 1429 }
1434 1430
1435 LayoutBlock::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); 1431 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState, paintInv alidationContainer);
1436 } 1432 }
1437 1433
1438 LayoutUnit LayoutTable::paddingTop() const 1434 LayoutUnit LayoutTable::paddingTop() const
1439 { 1435 {
1440 if (collapseBorders()) 1436 if (collapseBorders())
1441 return LayoutUnit(); 1437 return LayoutUnit();
1442 1438
1443 return LayoutBlock::paddingTop(); 1439 return LayoutBlock::paddingTop();
1444 } 1440 }
1445 1441
(...skipping 15 matching lines...) Expand all
1461 1457
1462 LayoutUnit LayoutTable::paddingRight() const 1458 LayoutUnit LayoutTable::paddingRight() const
1463 { 1459 {
1464 if (collapseBorders()) 1460 if (collapseBorders())
1465 return LayoutUnit(); 1461 return LayoutUnit();
1466 1462
1467 return LayoutBlock::paddingRight(); 1463 return LayoutBlock::paddingRight();
1468 } 1464 }
1469 1465
1470 } // namespace blink 1466 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableCol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698