本文整理汇总了C++中PaintInfo::displayItemTypeForClipping方法的典型用法代码示例。如果您正苦于以下问题:C++ PaintInfo::displayItemTypeForClipping方法的具体用法?C++ PaintInfo::displayItemTypeForClipping怎么用?C++ PaintInfo::displayItemTypeForClipping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaintInfo
的用法示例。
在下文中一共展示了PaintInfo::displayItemTypeForClipping方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintReplaced
void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
WebMediaPlayer* mediaPlayer = m_layoutVideo.mediaElement()->webMediaPlayer();
bool displayingPoster = m_layoutVideo.videoElement()->shouldDisplayPosterImage();
if (!displayingPoster && !mediaPlayer)
return;
LayoutRect rect(m_layoutVideo.videoBox());
if (rect.isEmpty())
return;
rect.moveBy(paintOffset);
GraphicsContext& context = paintInfo.context;
LayoutRect contentRect = m_layoutVideo.contentBoxRect();
contentRect.moveBy(paintOffset);
Optional<ClipRecorder> clipRecorder;
if (!contentRect.contains(rect)) {
clipRecorder.emplace(context, m_layoutVideo, paintInfo.displayItemTypeForClipping(), contentRect);
}
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layoutVideo, paintInfo.phase, paintOffset))
return;
LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutVideo, paintInfo.phase, contentRect, paintOffset);
// Video frames are only painted in software for printing or capturing node images via web APIs.
bool forceSoftwareVideoPaint = paintInfo.globalPaintFlags() & GlobalPaintFlattenCompositingLayers;
if (displayingPoster || !forceSoftwareVideoPaint) {
// This will display the poster image, if one is present, and otherwise paint nothing.
ImagePainter(m_layoutVideo).paintIntoRect(context, rect);
} else {
SkPaint videoPaint = context.fillPaint();
videoPaint.setColor(SK_ColorBLACK);
m_layoutVideo.videoElement()->paintCurrentFrame(context.canvas(), pixelSnappedIntRect(rect), &videoPaint);
}
}