当前位置: 首页>>代码示例>>C++>>正文


C++ LayoutTableCell::hasSelfPaintingLayer方法代码示例

本文整理汇总了C++中LayoutTableCell::hasSelfPaintingLayer方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutTableCell::hasSelfPaintingLayer方法的具体用法?C++ LayoutTableCell::hasSelfPaintingLayer怎么用?C++ LayoutTableCell::hasSelfPaintingLayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LayoutTableCell的用法示例。


在下文中一共展示了LayoutTableCell::hasSelfPaintingLayer方法的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);
    }
}
开发者ID:mirror,项目名称:chromium,代码行数:34,代码来源:TableRowPainter.cpp

示例2: nodeAtPoint

// Hit Testing
bool LayoutTableRow::nodeAtPoint(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
{
    // Table rows cannot ever be hit tested.  Effectively they do not exist.
    // Just forward to our children always.
    for (LayoutTableCell* cell = lastCell(); cell; cell = cell->previousCell()) {
        // FIXME: We have to skip over inline flows, since they can show up inside table rows
        // at the moment (a demoted inline <form> for example). If we ever implement a
        // table-specific hit-test method (which we should do for performance reasons anyway),
        // then we can remove this check.
        if (!cell->hasSelfPaintingLayer()) {
            LayoutPoint cellPoint = flipForWritingModeForChild(cell, accumulatedOffset);
            if (cell->nodeAtPoint(result, locationInContainer, cellPoint, action)) {
                updateHitTestResult(result, locationInContainer.point() - toLayoutSize(cellPoint));
                return true;
            }
        }
    }

    return false;
}
开发者ID:JiangSuyong,项目名称:chromium,代码行数:21,代码来源:LayoutTableRow.cpp

示例3: paintCell

void TableSectionPainter::paintCell(const LayoutTableCell& cell, const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
    LayoutPoint cellPoint = m_layoutTableSection.flipForWritingModeForChild(&cell, paintOffset);
    PaintPhase paintPhase = paintInfo.phase;
    const LayoutTableRow* row = toLayoutTableRow(cell.parent());

    if ((paintPhase == PaintPhaseSelfBlockBackground || paintPhase == PaintPhaseBlockBackground)
        && BlockPainter(cell).intersectsPaintRect(paintInfo, paintOffset)) {
        // We need to handle painting a stack of backgrounds. This stack (from bottom to top) consists of
        // the column group, column, row group, row, and then the cell.

        LayoutTable::ColAndColGroup colAndColGroup = m_layoutTableSection.table()->colElement(cell.col());
        LayoutTableCol* column = colAndColGroup.col;
        LayoutTableCol* columnGroup = colAndColGroup.colgroup;
        TableCellPainter tableCellPainter(cell);

        // Column groups and columns first.
        // FIXME: Columns and column groups do not currently support opacity, and they are being painted "too late" in
        // the stack, since we have already opened a transparency layer (potentially) for the table row group.
        // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the
        // cell.
        if (columnGroup && columnGroup->hasBackground())
            tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, columnGroup, DisplayItem::TableCellBackgroundFromColumnGroup);
        if (column && column->hasBackground())
            tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, column, DisplayItem::TableCellBackgroundFromColumn);

        // Paint the row group next.
        if (m_layoutTableSection.hasBackground())
            tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, &m_layoutTableSection, DisplayItem::TableCellBackgroundFromSection);

        // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for
        // painting the row background for the cell.
        if (row->hasBackground() && !row->hasSelfPaintingLayer())
            tableCellPainter.paintBackgroundsBehindCell(paintInfo, cellPoint, row, DisplayItem::TableCellBackgroundFromRow);
    }
    if ((!cell.hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()))
        cell.paint(paintInfo, cellPoint);
}
开发者ID:zhihuizhiming,项目名称:chromium,代码行数:38,代码来源:TableSectionPainter.cpp


注:本文中的LayoutTableCell::hasSelfPaintingLayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。