本文整理汇总了C++中LayoutRect::unite方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutRect::unite方法的具体用法?C++ LayoutRect::unite怎么用?C++ LayoutRect::unite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutRect
的用法示例。
在下文中一共展示了LayoutRect::unite方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersectsPaintRect
bool BlockPainter::intersectsPaintRect(
const PaintInfo& paintInfo,
const LayoutPoint& adjustedPaintOffset) const {
LayoutRect overflowRect;
if (paintInfo.isPrinting() && m_layoutBlock.isAnonymousBlock() &&
m_layoutBlock.childrenInline()) {
// For case <a href="..."><div>...</div></a>, when m_layoutBlock is the
// anonymous container of <a>, the anonymous container's visual overflow is
// empty, but we need to continue painting to output <a>'s PDF URL rect
// which covers the continuations, as if we included <a>'s PDF URL rect into
// m_layoutBlock's visual overflow.
Vector<LayoutRect> rects;
m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint());
overflowRect = unionRect(rects);
}
overflowRect.unite(m_layoutBlock.visualOverflowRect());
bool usesCompositedScrolling = m_layoutBlock.hasOverflowModel() &&
m_layoutBlock.usesCompositedScrolling();
if (usesCompositedScrolling) {
LayoutRect layoutOverflowRect = m_layoutBlock.layoutOverflowRect();
overflowRect.unite(layoutOverflowRect);
}
m_layoutBlock.flipForWritingMode(overflowRect);
// Scrolling is applied in physical space, which is why it is after the flip
// above.
if (usesCompositedScrolling) {
overflowRect.move(-m_layoutBlock.scrolledContentOffset());
}
overflowRect.moveBy(adjustedPaintOffset);
return paintInfo.cullRect().intersectsCullRect(overflowRect);
}
示例2: selectionBounds
IntRect RenderView::selectionBounds() const
{
typedef WillBeHeapHashMap<RawPtrWillBeMember<RenderObject>, OwnPtrWillBeMember<RenderSelectionInfo> > SelectionMap;
SelectionMap selectedObjects;
RenderObject* os = m_selectionStart;
RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
while (os && os != stop) {
if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
// Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
selectedObjects.set(os, adoptPtrWillBeNoop(new RenderSelectionInfo(os)));
RenderBlock* cb = os->containingBlock();
while (cb && !cb->isRenderView()) {
OwnPtrWillBeMember<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).storedValue->value;
if (blockInfo)
break;
blockInfo = adoptPtrWillBeNoop(new RenderSelectionInfo(cb));
cb = cb->containingBlock();
}
}
os = os->nextInPreOrder();
}
// Now create a single bounding box rect that encloses the whole selection.
LayoutRect selRect;
SelectionMap::iterator end = selectedObjects.end();
for (SelectionMap::iterator i = selectedObjects.begin(); i != end; ++i)
selRect.unite(i->value->absoluteSelectionRect());
return pixelSnappedIntRect(selRect);
}
示例3: clippedOverflowRectForPaintInvalidation
LayoutRect LayoutSVGRoot::clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
{
// This is an open-coded aggregate of SVGLayoutSupport::clippedOverflowRectForPaintInvalidation,
// LayoutSVGRoot::mapToVisibleRectInContainerSpace and LayoutReplaced::clippedOverflowRectForPaintInvalidation.
// The reason for this is to optimize/minimize the paint invalidation rect when the box is not "decorated"
// (does not have background/border/etc.)
// Return early for any cases where we don't actually paint.
if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
return LayoutRect();
// Compute the paint invalidation rect of the content of the SVG in the border-box coordinate space.
FloatRect contentPaintInvalidationRect = paintInvalidationRectInLocalCoordinates();
contentPaintInvalidationRect = m_localToBorderBoxTransform.mapRect(contentPaintInvalidationRect);
// Apply initial viewport clip, overflow:visible content is added to visualOverflow
// but the most common case is that overflow is hidden, so always intersect.
contentPaintInvalidationRect.intersect(pixelSnappedBorderBoxRect());
LayoutRect paintInvalidationRect = enclosingLayoutRect(contentPaintInvalidationRect);
// If the box is decorated or is overflowing, extend it to include the border-box and overflow.
if (m_hasBoxDecorationBackground || hasOverflowModel()) {
// The selectionRect can project outside of the overflowRect, so take their union
// for paint invalidation to avoid selection painting glitches.
LayoutRect decoratedPaintInvalidationRect = unionRect(localSelectionRect(), visualOverflowRect());
paintInvalidationRect.unite(decoratedPaintInvalidationRect);
}
// Compute the paint invalidation rect in the parent coordinate space.
LayoutRect rect(enclosingIntRect(paintInvalidationRect));
LayoutReplaced::mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, paintInvalidationState);
return rect;
}
示例4: fragmentsBoundingBox
LayoutRect LayoutMultiColumnSet::fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) const
{
LayoutRect result;
for (const auto& group : m_fragmentainerGroups)
result.unite(group.fragmentsBoundingBox(boundingBoxInFlowThread));
return result;
}
示例5: unionRect
LayoutRect unionRect(const Vector<LayoutRect>& rects) {
LayoutRect result;
size_t count = rects.size();
for (size_t i = 0; i < count; ++i)
result.unite(rects[i]);
return result;
}
示例6: calculateBoundaries
LayoutRect SVGInlineFlowBox::calculateBoundaries() const
{
LayoutRect childRect;
for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
if (!child->isSVGInlineTextBox() && !child->isSVGInlineFlowBox())
continue;
childRect.unite(child->calculateBoundaries());
}
return childRect;
}
示例7: overflowRectForPaintRejection
LayoutRect BlockPainter::overflowRectForPaintRejection() const
{
LayoutRect overflowRect = m_layoutBlock.visualOverflowRect();
if (!m_layoutBlock.hasOverflowModel() || !m_layoutBlock.usesCompositedScrolling())
return overflowRect;
overflowRect.unite(m_layoutBlock.layoutOverflowRect());
overflowRect.move(-m_layoutBlock.scrolledContentOffset());
return overflowRect;
}
示例8: intersectsPaintRect
bool BlockPainter::intersectsPaintRect(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
{
LayoutRect overflowRect = m_layoutBlock.visualOverflowRect();
if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrolling()) {
overflowRect.unite(m_layoutBlock.layoutOverflowRect());
overflowRect.move(-m_layoutBlock.scrolledContentOffset());
}
m_layoutBlock.flipForWritingMode(overflowRect);
overflowRect.moveBy(paintOffset + m_layoutBlock.location());
return paintInfo.cullRect().intersectsCullRect(overflowRect);
}
示例9: addOverflowFromChildren
void LayoutMultiColumnSet::addOverflowFromChildren()
{
LayoutRect overflowRect;
for (const auto& group : m_fragmentainerGroups) {
LayoutRect rect = group.calculateOverflow();
rect.move(group.offsetFromColumnSet());
overflowRect.unite(rect);
}
addLayoutOverflow(overflowRect);
addContentsVisualOverflow(overflowRect);
}
示例10: calculateBoundaries
LayoutRect SVGInlineTextBox::calculateBoundaries() const
{
LineLayoutSVGInlineText lineLayoutItem = LineLayoutSVGInlineText(this->lineLayoutItem());
float scalingFactor = lineLayoutItem.scalingFactor();
ASSERT(scalingFactor);
LayoutUnit baseline = lineLayoutItem.scaledFont().fontMetrics().floatAscent() / scalingFactor;
LayoutRect textBoundingRect;
for (const SVGTextFragment& fragment : m_textFragments)
textBoundingRect.unite(LayoutRect(fragment.overflowBoundingBox(baseline)));
return textBoundingRect;
}
示例11: outlinePaintRect
LayoutRect InlinePainter::outlinePaintRect(const Vector<LayoutRect>& outlineRects, const LayoutPoint& paintOffset) const
{
int outlineOutset = m_layoutInline.styleRef().outlineOutsetExtent();
LayoutRect outlineRect;
for (const LayoutRect& rect : outlineRects) {
LayoutRect inflatedRect(rect);
// Inflate the individual rects instead of the union, to avoid losing
// rects which have degenerate width/height (== isEmpty() true.)
inflatedRect.inflate(outlineOutset);
outlineRect.unite(inflatedRect);
}
outlineRect.moveBy(paintOffset);
return outlineRect;
}
示例12: clippedOverflowRectForRepaint
LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
{
if (style().visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
return LayoutRect();
FloatRect contentRepaintRect = m_localToBorderBoxTransform.mapRect(repaintRectInLocalCoordinates());
contentRepaintRect.intersect(snappedIntRect(borderBoxRect()));
LayoutRect repaintRect = enclosingLayoutRect(contentRepaintRect);
if (m_hasBoxDecorations || hasRenderOverflow())
repaintRect.unite(unionRect(localSelectionRect(false), visualOverflowRect()));
return RenderReplaced::computeRectForRepaint(enclosingIntRect(repaintRect), repaintContainer);
}
示例13: fragmentsBoundingBox
LayoutRect LayoutFlowThread::fragmentsBoundingBox(const LayoutRect& layerBoundingBox) const
{
ASSERT(!m_columnSetsInvalidated);
LayoutRect result;
for (auto* columnSet : m_multiColumnSetList) {
DeprecatedPaintLayerFragments fragments;
columnSet->collectLayerFragments(fragments, layerBoundingBox, LayoutRect(LayoutRect::infiniteIntRect()));
for (const auto& fragment : fragments) {
LayoutRect fragmentRect(layerBoundingBox);
fragmentRect.intersect(fragment.paginationClip);
fragmentRect.moveBy(fragment.paginationOffset);
result.unite(fragmentRect);
}
}
return result;
}
示例14: calculateBoundaries
LayoutRect SVGInlineTextBox::calculateBoundaries() const {
LineLayoutSVGInlineText lineLayoutItem =
LineLayoutSVGInlineText(this->getLineLayoutItem());
const SimpleFontData* fontData = lineLayoutItem.scaledFont().primaryFont();
DCHECK(fontData);
if (!fontData)
return LayoutRect();
float scalingFactor = lineLayoutItem.scalingFactor();
ASSERT(scalingFactor);
LayoutUnit baseline(fontData->getFontMetrics().floatAscent() / scalingFactor);
LayoutRect textBoundingRect;
for (const SVGTextFragment& fragment : m_textFragments)
textBoundingRect.unite(LayoutRect(fragment.overflowBoundingBox(baseline)));
return textBoundingRect;
}
示例15: layoutOverflowRectForBoxForPropagation
// FIXME: This doesn't work for writing modes.
LayoutRect RenderRegion::layoutOverflowRectForBoxForPropagation(const RenderBox* box)
{
// Only propagate interior layout overflow if we don't clip it.
LayoutRect rect = box->borderBoxRectInRegion(this);
rect = rectFlowPortionForBox(box, rect);
if (!box->hasOverflowClip())
rect.unite(layoutOverflowRectForBox(box));
bool hasTransform = box->hasLayer() && box->layer()->transform();
if (box->isInFlowPositioned() || hasTransform) {
if (hasTransform)
rect = box->layer()->currentTransform().mapRect(rect);
if (box->isInFlowPositioned())
rect.move(box->offsetForInFlowPosition());
}
return rect;
}