本文整理汇总了C++中InlineFlowBox::nextLineBox方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineFlowBox::nextLineBox方法的具体用法?C++ InlineFlowBox::nextLineBox怎么用?C++ InlineFlowBox::nextLineBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InlineFlowBox
的用法示例。
在下文中一共展示了InlineFlowBox::nextLineBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintRectForImageStrip
LayoutRect InlineFlowBoxPainter::paintRectForImageStrip(const LayoutPoint& paintOffset, const LayoutSize& frameSize, TextDirection direction) const
{
// We have a fill/border/mask image that spans multiple lines.
// We need to adjust the offset by the width of all previous lines.
// Think of background painting on inlines as though you had one long line, a single continuous
// strip. Even though that strip has been broken up across multiple lines, you still paint it
// as though you had one single line. This means each line has to pick up the background where
// the previous line left off.
LayoutUnit logicalOffsetOnLine = 0;
LayoutUnit totalLogicalWidth;
if (direction == LTR) {
for (InlineFlowBox* curr = m_inlineFlowBox.prevLineBox(); curr; curr = curr->prevLineBox())
logicalOffsetOnLine += curr->logicalWidth();
totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = &m_inlineFlowBox; curr; curr = curr->nextLineBox())
totalLogicalWidth += curr->logicalWidth();
} else {
for (InlineFlowBox* curr = m_inlineFlowBox.nextLineBox(); curr; curr = curr->nextLineBox())
logicalOffsetOnLine += curr->logicalWidth();
totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = &m_inlineFlowBox; curr; curr = curr->prevLineBox())
totalLogicalWidth += curr->logicalWidth();
}
LayoutUnit stripX = paintOffset.x() - (m_inlineFlowBox.isHorizontal() ? logicalOffsetOnLine : LayoutUnit());
LayoutUnit stripY = paintOffset.y() - (m_inlineFlowBox.isHorizontal() ? LayoutUnit() : logicalOffsetOnLine);
LayoutUnit stripWidth = m_inlineFlowBox.isHorizontal() ? totalLogicalWidth : frameSize.width();
LayoutUnit stripHeight = m_inlineFlowBox.isHorizontal() ? frameSize.height() : totalLogicalWidth;
return LayoutRect(stripX, stripY, stripWidth, stripHeight);
}
示例2: paint
void LineBoxListPainter::paint(LayoutBoxModelObject* layoutObject, const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
{
ASSERT(paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines);
// Only paint during the foreground/selection phases.
if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseTextClip && paintInfo.phase != PaintPhaseMask)
return;
ASSERT(layoutObject->isLayoutBlock() || (layoutObject->isLayoutInline() && layoutObject->hasLayer())); // The only way an inline could paint like this is if it has a layer.
// FIXME: When Skia supports annotation rect covering (https://code.google.com/p/skia/issues/detail?id=3872),
// these rects may be covered line box drawings. Then we may need a dedicated paint phase.
if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting())
addPDFURLRectsForInlineChildrenRecursively(layoutObject, paintInfo, paintOffset);
// If we have no lines then we have no work to do.
if (!m_lineBoxList.firstLineBox())
return;
if (!m_lineBoxList.anyLineIntersectsRect(LineLayoutBoxModel(layoutObject), LayoutRect(paintInfo.rect), paintOffset))
return;
PaintInfo info(paintInfo);
// See if our root lines intersect with the dirty rect. If so, then we paint
// them. Note that boxes can easily overlap, so we can't make any assumptions
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr->nextLineBox()) {
if (m_lineBoxList.lineIntersectsDirtyRect(LineLayoutBoxModel(layoutObject), curr, info, paintOffset)) {
RootInlineBox& root = curr->root();
curr->paint(info, paintOffset, root.lineTop(), root.lineBottom());
}
}
}
示例3: paint
void LineBoxListPainter::paint(const LayoutBoxModelObject& layoutObject, const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
{
ASSERT(!shouldPaintSelfOutline(paintInfo.phase) && !shouldPaintDescendantOutlines(paintInfo.phase));
// Only paint during the foreground/selection phases.
if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseTextClip && paintInfo.phase != PaintPhaseMask)
return;
ASSERT(layoutObject.isLayoutBlock() || (layoutObject.isLayoutInline() && layoutObject.hasLayer())); // The only way an inline could paint like this is if it has a layer.
if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting())
addPDFURLRectsForInlineChildrenRecursively(layoutObject, paintInfo, paintOffset);
// If we have no lines then we have no work to do.
if (!m_lineBoxList.firstLineBox())
return;
if (!m_lineBoxList.anyLineIntersectsRect(LineLayoutBoxModel(const_cast<LayoutBoxModelObject*>(&layoutObject)), paintInfo.cullRect(), paintOffset))
return;
PaintInfo info(paintInfo);
// See if our root lines intersect with the dirty rect. If so, then we paint
// them. Note that boxes can easily overlap, so we can't make any assumptions
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr->nextLineBox()) {
if (m_lineBoxList.lineIntersectsDirtyRect(LineLayoutBoxModel(const_cast<LayoutBoxModelObject*>(&layoutObject)), curr, info.cullRect(), paintOffset)) {
RootInlineBox& root = curr->root();
curr->paint(info, paintOffset, root.lineTop(), root.lineBottom());
}
}
}
示例4: absoluteQuads
void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
{
const RenderObject* object = SVGRenderSupport::findTextRootObject(this);
if (!object)
return;
FloatRect textBoundingBox = object->strokeBoundingBox();
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->width(), box->height())));
}
示例5: absoluteQuads
void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
{
auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(*this);
if (!textAncestor)
return;
FloatRect textBoundingBox = textAncestor->strokeBoundingBox();
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->logicalWidth(), box->logicalHeight()), UseTransforms, wasFixed));
}
示例6: absoluteQuads
void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed)
{
RenderObject* object = RenderSVGText::locateRenderSVGTextAncestor(this);
if (!object)
return;
FloatRect textBoundingBox = object->strokeBoundingBox();
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->logicalWidth(), box->logicalHeight()), false, wasFixed));
}
示例7: paintOutline
void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
const ComputedStyle& styleToUse = m_layoutInline.styleRef();
if (!styleToUse.hasOutline())
return;
if (styleToUse.outlineStyleIsAuto()) {
if (!LayoutTheme::theme().shouldDrawDefaultFocusRing(&m_layoutInline))
return;
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutInline, paintInfo.phase))
return;
Vector<LayoutRect> focusRingRects;
m_layoutInline.addOutlineRects(focusRingRects, paintOffset);
LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, outlinePaintRect(focusRingRects, LayoutPoint()));
// Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
ObjectPainter(m_layoutInline).paintFocusRing(paintInfo, styleToUse, focusRingRects);
return;
}
if (styleToUse.outlineStyle() == BNONE)
return;
GraphicsContext* graphicsContext = paintInfo.context;
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*graphicsContext, m_layoutInline, paintInfo.phase))
return;
Vector<LayoutRect> rects;
rects.append(LayoutRect());
for (InlineFlowBox* curr = m_layoutInline.firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox& root = curr->root();
LayoutUnit top = std::max<LayoutUnit>(root.lineTop(), curr->logicalTop());
LayoutUnit bottom = std::min<LayoutUnit>(root.lineBottom(), curr->logicalBottom());
rects.append(LayoutRect(curr->x(), top, curr->logicalWidth(), bottom - top));
}
rects.append(LayoutRect());
Color outlineColor = m_layoutInline.resolveColor(styleToUse, CSSPropertyOutlineColor);
bool useTransparencyLayer = outlineColor.hasAlpha();
LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutInline, paintInfo.phase, outlinePaintRect(rects, paintOffset));
if (useTransparencyLayer) {
graphicsContext->beginLayer(static_cast<float>(outlineColor.alpha()) / 255);
outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineColor.blue());
}
for (unsigned i = 1; i < rects.size() - 1; i++)
paintOutlineForLine(graphicsContext, paintOffset, rects.at(i - 1), rects.at(i), rects.at(i + 1), outlineColor);
if (useTransparencyLayer)
graphicsContext->endLayer();
}
示例8: deleteLineBoxTree
void RenderLineBoxList::deleteLineBoxTree(RenderArena* arena)
{
InlineFlowBox* line = m_firstLineBox;
InlineFlowBox* nextLine;
while (line) {
nextLine = line->nextLineBox();
line->deleteLine(arena);
line = nextLine;
}
m_firstLineBox = m_lastLineBox = 0;
}
示例9: deleteLineBoxTree
void LineBoxList::deleteLineBoxTree()
{
InlineFlowBox* line = m_firstLineBox;
InlineFlowBox* nextLine;
while (line) {
nextLine = line->nextLineBox();
line->deleteLine();
line = nextLine;
}
m_firstLineBox = m_lastLineBox = 0;
}
示例10: paintOutline
void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
RenderStyle* styleToUse = m_renderInline.style();
if (!styleToUse->hasOutline())
return;
LayoutRect bounds;
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
// FIXME: Use tighter bounds.
RenderBlock* cb = m_renderInline.containingBlock();
bounds = cb->visualOverflowRect();
bounds.moveBy(paintOffset);
}
RenderDrawingRecorder recorder(paintInfo.context, m_renderInline, paintInfo.phase, bounds);
if (recorder.canUseCachedDrawing())
return;
if (styleToUse->outlineStyleIsAuto()) {
if (RenderTheme::theme().shouldDrawDefaultFocusRing(&m_renderInline)) {
// Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
ObjectPainter(m_renderInline).paintFocusRing(paintInfo, paintOffset, styleToUse);
}
return;
}
if (styleToUse->outlineStyle() == BNONE)
return;
Vector<LayoutRect> rects;
rects.append(LayoutRect());
for (InlineFlowBox* curr = m_renderInline.firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox& root = curr->root();
LayoutUnit top = std::max<LayoutUnit>(root.lineTop(), curr->logicalTop());
LayoutUnit bottom = std::min<LayoutUnit>(root.lineBottom(), curr->logicalBottom());
rects.append(LayoutRect(curr->x(), top, curr->logicalWidth(), bottom - top));
}
rects.append(LayoutRect());
Color outlineColor = m_renderInline.resolveColor(styleToUse, CSSPropertyOutlineColor);
bool useTransparencyLayer = outlineColor.hasAlpha();
GraphicsContext* graphicsContext = paintInfo.context;
if (useTransparencyLayer) {
graphicsContext->beginTransparencyLayer(static_cast<float>(outlineColor.alpha()) / 255);
outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineColor.blue());
}
for (unsigned i = 1; i < rects.size() - 1; i++)
paintOutlineForLine(graphicsContext, paintOffset, rects.at(i - 1), rects.at(i), rects.at(i + 1), outlineColor);
if (useTransparencyLayer)
graphicsContext->endLayer();
}
示例11: objectBoundingBox
FloatRect RenderSVGText::objectBoundingBox() const
{
FloatRect boundingBox;
for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine())
boundingBox.unite(FloatRect(box->x(), box->y(), box->width(), box->height()));
}
boundingBox.move(x(), y());
return boundingBox;
}
示例12: deleteLineBoxes
void RenderLineBoxList::deleteLineBoxes(RenderArena* arena)
{
if (m_firstLineBox) {
InlineFlowBox* next;
for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) {
next = curr->nextLineBox();
curr->destroy(arena);
}
m_firstLineBox = 0;
m_lastLineBox = 0;
}
}
示例13: deleteLineBoxes
void RenderLineBoxList::deleteLineBoxes()
{
if (m_firstLineBox) {
InlineFlowBox* next;
for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) {
next = curr->nextLineBox();
delete curr;
}
m_firstLineBox = nullptr;
m_lastLineBox = nullptr;
}
}
示例14: deleteLineBoxes
void LineBoxList::deleteLineBoxes()
{
if (m_firstLineBox) {
InlineFlowBox* next;
for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) {
next = curr->nextLineBox();
curr->destroy();
}
m_firstLineBox = 0;
m_lastLineBox = 0;
}
}
示例15: absoluteQuads
void LayoutSVGInline::absoluteQuads(Vector<FloatQuad>& quads) const {
const LayoutSVGText* textRoot =
LayoutSVGText::locateLayoutSVGTextAncestor(this);
if (!textRoot)
return;
FloatRect textBoundingBox = textRoot->strokeBoundingBox();
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
quads.append(
localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x().toFloat(),
textBoundingBox.y() + box->y().toFloat(),
box->logicalWidth().toFloat(),
box->logicalHeight().toFloat()),
false));
}