本文整理汇总了C++中PaintInfo::forDescendants方法的典型用法代码示例。如果您正苦于以下问题:C++ PaintInfo::forDescendants方法的具体用法?C++ PaintInfo::forDescendants怎么用?C++ PaintInfo::forDescendants使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaintInfo
的用法示例。
在下文中一共展示了PaintInfo::forDescendants方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
void TableRowPainter::paint(const PaintInfo& paintInfo,
const LayoutPoint& paintOffset) {
DCHECK(m_layoutTableRow.hasSelfPaintingLayer());
// TODO(crbug.com/577282): This painting order is inconsistent with other
// outlines.
if (shouldPaintSelfOutline(paintInfo.phase))
paintOutline(paintInfo, paintOffset);
if (paintInfo.phase == PaintPhaseSelfOutlineOnly)
return;
PaintInfo paintInfoForCells = paintInfo.forDescendants();
if (shouldPaintSelfBlockBackground(paintInfo.phase)) {
paintBoxShadow(paintInfo, paintOffset, Normal);
if (m_layoutTableRow.styleRef().hasBackground()) {
// Paint row background of behind the cells.
for (LayoutTableCell* cell = m_layoutTableRow.firstCell(); cell;
cell = cell->nextCell())
TableCellPainter(*cell).paintContainerBackgroundBehindCell(
paintInfoForCells, paintOffset, m_layoutTableRow,
DisplayItem::kTableCellBackgroundFromRow);
}
paintBoxShadow(paintInfo, paintOffset, Inset);
}
if (paintInfo.phase == PaintPhaseSelfBlockBackgroundOnly)
return;
for (LayoutTableCell* cell = m_layoutTableRow.firstCell(); cell;
cell = cell->nextCell()) {
if (!cell->hasSelfPaintingLayer())
cell->paint(paintInfoForCells, paintOffset);
}
}
示例2: paintObject
void TablePainter::paintObject(const PaintInfo& paintInfo,
const LayoutPoint& paintOffset) {
PaintPhase paintPhase = paintInfo.phase;
if (shouldPaintSelfBlockBackground(paintPhase)) {
paintBoxDecorationBackground(paintInfo, paintOffset);
if (paintPhase == PaintPhaseSelfBlockBackgroundOnly)
return;
}
if (paintPhase == PaintPhaseMask) {
paintMask(paintInfo, paintOffset);
return;
}
if (paintPhase != PaintPhaseSelfOutlineOnly) {
PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
for (LayoutObject* child = m_layoutTable.firstChild(); child;
child = child->nextSibling()) {
if (child->isBox() && !toLayoutBox(child)->hasSelfPaintingLayer() &&
(child->isTableSection() || child->isTableCaption())) {
LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChild(
toLayoutBox(child), paintOffset);
child->paint(paintInfoForDescendants, childPoint);
}
}
if (m_layoutTable.collapseBorders() &&
shouldPaintDescendantBlockBackgrounds(paintPhase) &&
m_layoutTable.style()->visibility() == EVisibility::Visible) {
// Using our cached sorted styles, we then do individual passes,
// painting each style of border from lowest precedence to highest
// precedence.
LayoutTable::CollapsedBorderValues collapsedBorders =
m_layoutTable.collapsedBorders();
size_t count = collapsedBorders.size();
for (size_t i = 0; i < count; ++i) {
for (LayoutTableSection* section = m_layoutTable.bottomSection();
section; section = m_layoutTable.sectionAbove(section)) {
LayoutPoint childPoint =
m_layoutTable.flipForWritingModeForChild(section, paintOffset);
TableSectionPainter(*section).paintCollapsedBorders(
paintInfoForDescendants, childPoint, collapsedBorders[i]);
}
}
}
}
if (shouldPaintSelfOutline(paintPhase))
ObjectPainter(m_layoutTable).paintOutline(paintInfo, paintOffset);
}
示例3: paintContents
void BlockPainter::paintContents(const PaintInfo& paintInfo,
const LayoutPoint& paintOffset) {
DCHECK(!m_layoutBlock.childrenInline());
PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
}