本文整理汇总了C++中enclosingIntRect函数的典型用法代码示例。如果您正苦于以下问题:C++ enclosingIntRect函数的具体用法?C++ enclosingIntRect怎么用?C++ enclosingIntRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了enclosingIntRect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enclosingIntRect
void CompositingInputsUpdater::updateRecursive(DeprecatedPaintLayer* layer, UpdateType updateType, AncestorInfo info)
{
if (!layer->childNeedsCompositingInputsUpdate() && updateType != ForceUpdate)
return;
m_geometryMap.pushMappingsToAncestor(layer, layer->parent());
if (layer->hasCompositedDeprecatedPaintLayerMapping())
info.enclosingCompositedLayer = layer;
if (layer->needsCompositingInputsUpdate()) {
if (info.enclosingCompositedLayer)
info.enclosingCompositedLayer->compositedDeprecatedPaintLayerMapping()->setNeedsGraphicsLayerUpdate(GraphicsLayerUpdateSubtree);
updateType = ForceUpdate;
}
if (updateType == ForceUpdate) {
DeprecatedPaintLayer::AncestorDependentCompositingInputs properties;
if (!layer->isRootLayer()) {
properties.clippedAbsoluteBoundingBox = enclosingIntRect(m_geometryMap.absoluteRect(layer->boundingBoxForCompositingOverlapTest()));
// FIXME: Setting the absBounds to 1x1 instead of 0x0 makes very little sense,
// but removing this code will make JSGameBench sad.
// See https://codereview.chromium.org/13912020/
if (properties.clippedAbsoluteBoundingBox.isEmpty())
properties.clippedAbsoluteBoundingBox.setSize(IntSize(1, 1));
IntRect clipRect = pixelSnappedIntRect(layer->clipper().backgroundClipRect(ClipRectsContext(m_rootLayer, AbsoluteClipRects)).rect());
properties.clippedAbsoluteBoundingBox.intersect(clipRect);
const DeprecatedPaintLayer* parent = layer->parent();
properties.opacityAncestor = parent->isTransparent() ? parent : parent->opacityAncestor();
properties.transformAncestor = parent->hasTransformRelatedProperty() ? parent : parent->transformAncestor();
properties.filterAncestor = parent->hasFilter() ? parent : parent->filterAncestor();
bool layerIsFixedPosition = layer->layoutObject()->style()->position() == FixedPosition;
properties.nearestFixedPositionLayer = layerIsFixedPosition ? layer : parent->nearestFixedPositionLayer();
if (info.hasAncestorWithClipOrOverflowClip) {
const DeprecatedPaintLayer* parentLayerOnClippingContainerChain = findParentLayerOnClippingContainerChain(layer);
const bool parentHasClipOrOverflowClip = parentLayerOnClippingContainerChain->layoutObject()->hasClipOrOverflowClip();
properties.clippingContainer = parentHasClipOrOverflowClip ? parentLayerOnClippingContainerChain->layoutObject() : parentLayerOnClippingContainerChain->clippingContainer();
}
if (info.lastScrollingAncestor) {
const LayoutObject* containingBlock = layer->layoutObject()->containingBlock();
const DeprecatedPaintLayer* parentLayerOnContainingBlockChain = findParentLayerOnContainingBlockChain(containingBlock);
properties.ancestorScrollingLayer = parentLayerOnContainingBlockChain->ancestorScrollingLayer();
if (parentLayerOnContainingBlockChain->scrollsOverflow())
properties.ancestorScrollingLayer = parentLayerOnContainingBlockChain;
if (layer->layoutObject()->isOutOfFlowPositioned() && !layer->subtreeIsInvisible()) {
const DeprecatedPaintLayer* clippingLayer = properties.clippingContainer ? properties.clippingContainer->enclosingLayer() : layer->compositor()->rootLayer();
if (hasClippedStackingAncestor(layer, clippingLayer))
properties.clipParent = clippingLayer;
}
if (layer->stackingNode()->isTreatedAsStackingContextForPainting()
&& properties.ancestorScrollingLayer
&& !info.ancestorStackingContext->layoutObject()->isDescendantOf(properties.ancestorScrollingLayer->layoutObject()))
properties.scrollParent = properties.ancestorScrollingLayer;
}
}
properties.hasAncestorWithClipPath = info.hasAncestorWithClipPath;
layer->updateAncestorDependentCompositingInputs(properties);
}
if (layer->stackingNode()->isStackingContext())
info.ancestorStackingContext = layer;
if (layer->scrollsOverflow())
info.lastScrollingAncestor = layer;
if (layer->layoutObject()->hasClipOrOverflowClip())
info.hasAncestorWithClipOrOverflowClip = true;
if (layer->layoutObject()->hasClipPath())
info.hasAncestorWithClipPath = true;
DeprecatedPaintLayer::DescendantDependentCompositingInputs descendantProperties;
for (DeprecatedPaintLayer* child = layer->firstChild(); child; child = child->nextSibling()) {
updateRecursive(child, updateType, info);
descendantProperties.hasDescendantWithClipPath |= child->hasDescendantWithClipPath() || child->layoutObject()->hasClipPath();
descendantProperties.hasNonIsolatedDescendantWithBlendMode |= (!child->stackingNode()->isStackingContext() && child->hasNonIsolatedDescendantWithBlendMode()) || child->layoutObject()->style()->hasBlendMode();
}
layer->updateDescendantDependentCompositingInputs(descendantProperties);
layer->didUpdateCompositingInputs();
m_geometryMap.popMappingsToAncestor(layer->parent());
}
示例2: unmarkAllTextMatches
bool TextFinder::find(int identifier,
const WebString& searchText,
const WebFindOptions& options,
bool wrapWithinFrame,
bool* activeNow) {
if (!options.findNext)
unmarkAllTextMatches();
else
setMarkerActive(m_activeMatch.get(), false);
if (m_activeMatch &&
&m_activeMatch->ownerDocument() != ownerFrame().frame()->document())
m_activeMatch = nullptr;
// If the user has selected something since the last Find operation we want
// to start from there. Otherwise, we start searching from where the last Find
// operation left off (either a Find or a FindNext operation).
VisibleSelection selection(ownerFrame().frame()->selection().selection());
bool activeSelection = !selection.isNone();
if (activeSelection) {
m_activeMatch = firstRangeOf(selection);
ownerFrame().frame()->selection().clear();
}
DCHECK(ownerFrame().frame());
DCHECK(ownerFrame().frame()->view());
const FindOptions findOptions =
(options.forward ? 0 : Backwards) |
(options.matchCase ? 0 : CaseInsensitive) |
(wrapWithinFrame ? WrapAround : 0) |
(options.wordStart ? AtWordStarts : 0) |
(options.medialCapitalAsWordStart ? TreatMedialCapitalAsWordStart : 0) |
(options.findNext ? 0 : StartInSelection);
m_activeMatch = ownerFrame().frame()->editor().findStringAndScrollToVisible(
searchText, m_activeMatch.get(), findOptions);
if (!m_activeMatch) {
// If we're finding next the next active match might not be in the current
// frame. In this case we don't want to clear the matches cache.
if (!options.findNext)
clearFindMatchesCache();
ownerFrame().frameView()->invalidatePaintForTickmarks();
return false;
}
// If the user is browsing a page with autosizing, adjust the zoom to the
// column where the next hit has been found. Doing this when autosizing is
// not set will result in a zoom reset on small devices.
if (ownerFrame()
.frame()
->document()
->textAutosizer()
->pageNeedsAutosizing()) {
ownerFrame().viewImpl()->zoomToFindInPageRect(
ownerFrame().frameView()->contentsToRootFrame(
enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRange(
m_activeMatch.get()))));
}
bool wasActiveFrame = m_currentActiveMatchFrame;
m_currentActiveMatchFrame = true;
bool isActive = setMarkerActive(m_activeMatch.get(), true);
if (activeNow)
*activeNow = isActive;
// Make sure no node is focused. See http://crbug.com/38700.
ownerFrame().frame()->document()->clearFocusedElement();
// Set this frame as focused.
ownerFrame().viewImpl()->setFocusedFrame(&ownerFrame());
if (!options.findNext || activeSelection || !isActive) {
// This is either an initial Find operation, a Find-next from a new
// start point due to a selection, or new matches were found during
// Find-next due to DOM alteration (that couldn't be set as active), so
// we set the flag to ask the scoping effort to find the active rect for
// us and report it back to the UI.
m_locatingActiveRect = true;
} else {
if (!wasActiveFrame) {
if (options.forward)
m_activeMatchIndex = 0;
else
m_activeMatchIndex = m_lastMatchCount - 1;
} else {
if (options.forward)
++m_activeMatchIndex;
else
--m_activeMatchIndex;
if (m_activeMatchIndex + 1 > m_lastMatchCount)
m_activeMatchIndex = 0;
else if (m_activeMatchIndex < 0)
m_activeMatchIndex = m_lastMatchCount - 1;
}
WebRect selectionRect = ownerFrame().frameView()->contentsToRootFrame(
m_activeMatch->boundingBox());
reportFindInPageSelection(selectionRect, m_activeMatchIndex + 1,
//.........这里部分代码省略.........
示例3: writePositionAndStyle
static TextStream& writePositionAndStyle(TextStream& ts, const RenderObject& object)
{
ts << " " << enclosingIntRect(const_cast<RenderObject&>(object).absoluteClippedOverflowRect());
writeStyle(ts, object);
return ts;
}
示例4: enclosingIntRect
IntRect VisualViewport::rootFrameToViewport(const IntRect& rectInRootFrame) const
{
// FIXME: How to snap to pixels?
return enclosingIntRect(rootFrameToViewport(FloatRect(rectInRootFrame)));
}
示例5: enclosingIntRect
IntRect RenderSVGInlineText::linesBoundingBox() const
{
return enclosingIntRect(floatLinesBoundingBox());
}
示例6: enclosingIntRect
void ImageBufferDataPrivateAccelerated::clip(GraphicsContext* context, const FloatRect& floatRect) const
{
QPixmap alphaMask = QPixmap::fromImage(toQImage());
IntRect rect = enclosingIntRect(floatRect);
context->pushTransparencyLayerInternal(rect, 1.0, alphaMask);
}
示例7: enclosingIntRect
void BufferedImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp)
{
IntRect intDstRect = enclosingIntRect(dstRect);
IntRect intSrcRect(srcRect);
m_data->m_bitmap->draw(ctxt, intDstRect, intSrcRect, styleColorSpace, compositeOp);
}
示例8: enclosingIntRect
IntRect TiledDrawingAreaProxy::webViewVisibleRect()
{
return enclosingIntRect(FloatRect(m_webView->visibleRect()));
}
示例9: fitsInMaximumImageSize
bool SVGResourceFilter::prepareFilter(GraphicsContext*& context, const RenderObject* object)
{
m_ownerElement->buildFilter(object->objectBoundingBox());
const SVGRenderBase* renderer = object->toSVGRenderBase();
if (!renderer)
return false;
FloatRect paintRect = renderer->strokeBoundingBox();
paintRect.unite(renderer->markerBoundingBox());
if (shouldProcessFilter(this, m_filterBBox))
return false;
// clip sourceImage to filterRegion
FloatRect clippedSourceRect = paintRect;
clippedSourceRect.intersect(m_filterBBox);
// scale filter size to filterRes
FloatRect tempSourceRect = clippedSourceRect;
if (m_filterRes) {
m_scaleX = m_filterResSize.width() / m_filterBBox.width();
m_scaleY = m_filterResSize.height() / m_filterBBox.height();
}
// scale to big sourceImage size to kMaxFilterSize
tempSourceRect.scale(m_scaleX, m_scaleY);
fitsInMaximumImageSize(tempSourceRect.size());
// prepare Filters
m_filter = SVGFilter::create(paintRect, m_filterBBox, m_effectBBoxMode);
m_filter->setFilterResolution(FloatSize(m_scaleX, m_scaleY));
FilterEffect* lastEffect = m_filterBuilder->lastEffect();
if (lastEffect) {
lastEffect->calculateEffectRect(m_filter.get());
// at least one FilterEffect has a too big image size,
// recalculate the effect sizes with new scale factors
if (!fitsInMaximumImageSize(m_filter->maxImageSize())) {
m_filter->setFilterResolution(FloatSize(m_scaleX, m_scaleY));
lastEffect->calculateEffectRect(m_filter.get());
}
} else
return false;
clippedSourceRect.scale(m_scaleX, m_scaleY);
// Draw the content of the current element and it's childs to a imageBuffer to get the SourceGraphic.
// The size of the SourceGraphic is clipped to the size of the filterRegion.
IntRect bufferRect = enclosingIntRect(clippedSourceRect);
OwnPtr<ImageBuffer> sourceGraphic(ImageBuffer::create(bufferRect.size(), LinearRGB));
if (!sourceGraphic.get())
return false;
GraphicsContext* sourceGraphicContext = sourceGraphic->context();
sourceGraphicContext->translate(-clippedSourceRect.x(), -clippedSourceRect.y());
sourceGraphicContext->scale(FloatSize(m_scaleX, m_scaleY));
sourceGraphicContext->clearRect(FloatRect(FloatPoint(), paintRect.size()));
m_sourceGraphicBuffer.set(sourceGraphic.release());
m_savedContext = context;
context = sourceGraphicContext;
return true;
}
示例10: bitmap
void NativeImageSkia::drawPattern(
GraphicsContext* context,
const FloatRect& floatSrcRect,
const FloatSize& scale,
const FloatPoint& phase,
CompositeOperator compositeOp,
const FloatRect& destRect,
WebBlendMode blendMode,
const IntSize& repeatSpacing) const
{
FloatRect normSrcRect = floatSrcRect;
normSrcRect.intersect(FloatRect(0, 0, bitmap().width(), bitmap().height()));
if (destRect.isEmpty() || normSrcRect.isEmpty())
return; // nothing to draw
SkMatrix totalMatrix = context->getTotalMatrix();
AffineTransform ctm = context->getCTM();
SkScalar ctmScaleX = ctm.xScale();
SkScalar ctmScaleY = ctm.yScale();
totalMatrix.preScale(scale.width(), scale.height());
// Figure out what size the bitmap will be in the destination. The
// destination rect is the bounds of the pattern, we need to use the
// matrix to see how big it will be.
SkRect destRectTarget;
totalMatrix.mapRect(&destRectTarget, normSrcRect);
float destBitmapWidth = SkScalarToFloat(destRectTarget.width());
float destBitmapHeight = SkScalarToFloat(destRectTarget.height());
bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap());
// Compute the resampling mode.
InterpolationQuality resampling;
if (context->isAccelerated())
resampling = InterpolationLow;
else if (isLazyDecoded)
resampling = InterpolationHigh;
else
resampling = computeInterpolationQuality(totalMatrix, normSrcRect.width(), normSrcRect.height(), destBitmapWidth, destBitmapHeight, isDataComplete());
resampling = limitInterpolationQuality(context, resampling);
SkMatrix localMatrix;
// We also need to translate it such that the origin of the pattern is the
// origin of the destination rect, which is what WebKit expects. Skia uses
// the coordinate system origin as the base for the pattern. If WebKit wants
// a shifted image, it will shift it from there using the localMatrix.
const float adjustedX = phase.x() + normSrcRect.x() * scale.width();
const float adjustedY = phase.y() + normSrcRect.y() * scale.height();
localMatrix.setTranslate(SkFloatToScalar(adjustedX), SkFloatToScalar(adjustedY));
RefPtr<SkShader> shader;
SkFilterQuality filterLevel = static_cast<SkFilterQuality>(resampling);
// Bicubic filter is only applied to defer-decoded images, see
// NativeImageSkia::draw for details.
if (resampling == InterpolationHigh && !isLazyDecoded) {
// Do nice resampling.
filterLevel = kNone_SkFilterQuality;
float scaleX = destBitmapWidth / normSrcRect.width();
float scaleY = destBitmapHeight / normSrcRect.height();
SkRect scaledSrcRect;
// Since we are resizing the bitmap, we need to remove the scale
// applied to the pixels in the bitmap shader. This means we need
// CTM * localMatrix to have identity scale. Since we
// can't modify CTM (or the rectangle will be drawn in the wrong
// place), we must set localMatrix's scale to the inverse of
// CTM scale.
localMatrix.preScale(ctmScaleX ? 1 / ctmScaleX : 1, ctmScaleY ? 1 / ctmScaleY : 1);
// The image fragment generated here is not exactly what is
// requested. The scale factor used is approximated and image
// fragment is slightly larger to align to integer
// boundaries.
SkBitmap resampled = extractScaledImageFragment(normSrcRect, scaleX, scaleY, &scaledSrcRect);
if (repeatSpacing.isZero()) {
shader = adoptRef(SkShader::CreateBitmapShader(resampled, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
} else {
shader = adoptRef(SkShader::CreateBitmapShader(
createBitmapWithSpace(resampled, repeatSpacing.width() * ctmScaleX, repeatSpacing.height() * ctmScaleY),
SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
}
} else {
// Because no resizing occurred, the shader transform should be
// set to the pattern's transform, which just includes scale.
localMatrix.preScale(scale.width(), scale.height());
// No need to resample before drawing.
SkBitmap srcSubset;
bitmap().extractSubset(&srcSubset, enclosingIntRect(normSrcRect));
if (repeatSpacing.isZero()) {
shader = adoptRef(SkShader::CreateBitmapShader(srcSubset, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
} else {
shader = adoptRef(SkShader::CreateBitmapShader(
createBitmapWithSpace(srcSubset, repeatSpacing.width() * ctmScaleX, repeatSpacing.height() * ctmScaleY),
SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
}
}
//.........这里部分代码省略.........
示例11: renderer
IntRect EllipsisBox::selectionRect()
{
RenderStyle* style = renderer().style(isFirstLineStyle());
const Font& font = style->font();
return enclosingIntRect(font.selectionRectForText(constructTextRun(&renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(logicalLeft(), logicalTop() + root().selectionTopAdjustedForPrecedingBlock()), root().selectionHeightAdjustedForPrecedingBlock()));
}
示例12: setMarkerActive
bool TextFinder::find(int identifier, const WebString& searchText, const WebFindOptions& options, bool wrapWithinFrame, WebRect* selectionRect)
{
if (!m_ownerFrame.frame() || !m_ownerFrame.frame()->page())
return false;
WebLocalFrameImpl* mainFrameImpl = m_ownerFrame.viewImpl()->mainFrameImpl();
if (!options.findNext)
m_ownerFrame.frame()->page()->unmarkAllTextMatches();
else
setMarkerActive(m_activeMatch.get(), false);
if (m_activeMatch && &m_activeMatch->ownerDocument() != m_ownerFrame.frame()->document())
m_activeMatch = nullptr;
// If the user has selected something since the last Find operation we want
// to start from there. Otherwise, we start searching from where the last Find
// operation left off (either a Find or a FindNext operation).
VisibleSelection selection(m_ownerFrame.frame()->selection().selection());
bool activeSelection = !selection.isNone();
if (activeSelection) {
m_activeMatch = selection.firstRange().get();
m_ownerFrame.frame()->selection().clear();
}
ASSERT(m_ownerFrame.frame() && m_ownerFrame.frame()->view());
const FindOptions findOptions = (options.forward ? 0 : Backwards)
| (options.matchCase ? 0 : CaseInsensitive)
| (wrapWithinFrame ? WrapAround : 0)
| (options.wordStart ? AtWordStarts : 0)
| (options.medialCapitalAsWordStart ? TreatMedialCapitalAsWordStart : 0)
| (options.findNext ? 0 : StartInSelection);
m_activeMatch = m_ownerFrame.frame()->editor().findStringAndScrollToVisible(searchText, m_activeMatch.get(), findOptions);
if (!m_activeMatch) {
// If we're finding next the next active match might not be in the current frame.
// In this case we don't want to clear the matches cache.
if (!options.findNext)
clearFindMatchesCache();
m_ownerFrame.invalidateAll();
return false;
}
#if OS(ANDROID)
m_ownerFrame.viewImpl()->zoomToFindInPageRect(m_ownerFrame.frameView()->contentsToWindow(enclosingIntRect(RenderObject::absoluteBoundingBoxRectForRange(m_activeMatch.get()))));
#endif
setMarkerActive(m_activeMatch.get(), true);
WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame;
mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &m_ownerFrame;
// Make sure no node is focused. See http://crbug.com/38700.
m_ownerFrame.frame()->document()->setFocusedElement(nullptr);
if (!options.findNext || activeSelection) {
// This is either a Find operation or a Find-next from a new start point
// due to a selection, so we set the flag to ask the scoping effort
// to find the active rect for us and report it back to the UI.
m_locatingActiveRect = true;
} else {
if (oldActiveFrame != &m_ownerFrame) {
if (options.forward)
m_activeMatchIndexInCurrentFrame = 0;
else
m_activeMatchIndexInCurrentFrame = m_lastMatchCount - 1;
} else {
if (options.forward)
++m_activeMatchIndexInCurrentFrame;
else
--m_activeMatchIndexInCurrentFrame;
if (m_activeMatchIndexInCurrentFrame + 1 > m_lastMatchCount)
m_activeMatchIndexInCurrentFrame = 0;
if (m_activeMatchIndexInCurrentFrame == -1)
m_activeMatchIndexInCurrentFrame = m_lastMatchCount - 1;
}
if (selectionRect) {
*selectionRect = m_ownerFrame.frameView()->contentsToWindow(m_activeMatch->boundingBox());
reportFindInPageSelection(*selectionRect, m_activeMatchIndexInCurrentFrame + 1, identifier);
}
}
return true;
}
示例13: determineFilterPrimitiveSubregion
FloatRect RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(FilterEffect* effect, SVGFilter* filter)
{
FloatRect uniteRect;
FloatRect subregionBoundingBox = effect->effectBoundaries();
FloatRect subregion = subregionBoundingBox;
if (effect->filterEffectType() != FilterEffectTypeTile) {
// FETurbulence, FEImage and FEFlood don't have input effects, take the filter region as unite rect.
if (unsigned numberOfInputEffects = effect->inputEffects().size()) {
for (unsigned i = 0; i < numberOfInputEffects; ++i)
uniteRect.unite(determineFilterPrimitiveSubregion(effect->inputEffect(i), filter));
} else
uniteRect = filter->filterRegionInUserSpace();
} else {
determineFilterPrimitiveSubregion(effect->inputEffect(0), filter);
uniteRect = filter->filterRegionInUserSpace();
}
if (filter->effectBoundingBoxMode()) {
subregion = uniteRect;
// Avoid the calling of a virtual method several times.
FloatRect targetBoundingBox = filter->targetBoundingBox();
if (effect->hasX())
subregion.setX(targetBoundingBox.x() + subregionBoundingBox.x() * targetBoundingBox.width());
if (effect->hasY())
subregion.setY(targetBoundingBox.y() + subregionBoundingBox.y() * targetBoundingBox.height());
if (effect->hasWidth())
subregion.setWidth(subregionBoundingBox.width() * targetBoundingBox.width());
if (effect->hasHeight())
subregion.setHeight(subregionBoundingBox.height() * targetBoundingBox.height());
} else {
if (!effect->hasX())
subregion.setX(uniteRect.x());
if (!effect->hasY())
subregion.setY(uniteRect.y());
if (!effect->hasWidth())
subregion.setWidth(uniteRect.width());
if (!effect->hasHeight())
subregion.setHeight(uniteRect.height());
}
effect->setFilterPrimitiveSubregion(subregion);
FloatRect absoluteSubregion = filter->mapLocalRectToAbsoluteRect(subregion);
FloatSize filterResolution = filter->filterResolution();
absoluteSubregion.scale(filterResolution.width(), filterResolution.height());
// FEImage needs the unclipped subregion in absolute coordinates to determine the correct
// destination rect in combination with preserveAspectRatio.
if (effect->filterEffectType() == FilterEffectTypeImage)
reinterpret_cast<FEImage*>(effect)->setAbsoluteSubregion(absoluteSubregion);
// Clip every filter effect to the filter region.
FloatRect absoluteScaledFilterRegion = filter->filterRegion();
absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.height());
absoluteSubregion.intersect(absoluteScaledFilterRegion);
effect->setMaxEffectRect(enclosingIntRect(absoluteSubregion));
return subregion;
}
示例14: enclosingIntRect
IntRect AffineTransform::mapRect(const IntRect &rect) const
{
return enclosingIntRect(mapRect(FloatRect(rect)));
}
示例15: intersectsCullRect
bool CullRect::intersectsCullRect(const LayoutRect& rectArg) const {
return m_rect.intersects(enclosingIntRect(rectArg));
}