本文整理汇总了C++中RenderElement::repaintRectInLocalCoordinates方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderElement::repaintRectInLocalCoordinates方法的具体用法?C++ RenderElement::repaintRectInLocalCoordinates怎么用?C++ RenderElement::repaintRectInLocalCoordinates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderElement
的用法示例。
在下文中一共展示了RenderElement::repaintRectInLocalCoordinates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyResource
bool RenderSVGResourceClipper::applyResource(RenderElement& renderer, const RenderStyle&, GraphicsContext*& context, unsigned short resourceMode)
{
ASSERT(context);
ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
return applyClippingToContext(renderer, renderer.objectBoundingBox(), renderer.repaintRectInLocalCoordinates(), *context);
}
示例2: applyResource
bool RenderSVGResourceMasker::applyResource(RenderElement& renderer, const RenderStyle&, GraphicsContext*& context, unsigned short resourceMode)
{
ASSERT(context);
ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
bool missingMaskerData = !m_masker.contains(&renderer);
if (missingMaskerData)
m_masker.set(&renderer, std::make_unique<MaskerData>());
MaskerData* maskerData = m_masker.get(&renderer);
AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer);
FloatRect repaintRect = renderer.repaintRectInLocalCoordinates();
if (!maskerData->maskImage && !repaintRect.isEmpty()) {
const SVGRenderStyle& svgStyle = style().svgStyle();
ColorSpace colorSpace = svgStyle.colorInterpolation() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB;
maskerData->maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, colorSpace, Unaccelerated);
if (!maskerData->maskImage)
return false;
if (!drawContentIntoMaskImage(maskerData, colorSpace, &renderer))
maskerData->maskImage.reset();
}
if (!maskerData->maskImage)
return false;
SVGRenderingContext::clipToImageBuffer(context, absoluteTransform, repaintRect, maskerData->maskImage, missingMaskerData);
return true;
}
示例3: repaintRectForRendererInLocalCoordinatesExcludingSVGShadow
FloatRect SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow(const RenderElement& renderer)
{
// FIXME: Add support for RenderSVGBlock.
if (is<RenderSVGModelObject>(renderer))
return downcast<RenderSVGModelObject>(renderer).repaintRectInLocalCoordinatesExcludingSVGShadow();
return renderer.repaintRectInLocalCoordinates();
}
示例4: repaintRectForRendererInLocalCoordinatesExcludingSVGShadow
FloatRect SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow(const RenderElement& renderer)
{
// FIXME: Add support for RenderSVGBlock.
if (renderer.isSVGShape() || renderer.isSVGImage() || renderer.isSVGContainer())
return toRenderSVGModelObject(renderer).repaintRectInLocalCoordinatesExcludingSVGShadow();
return renderer.repaintRectInLocalCoordinates();
}
示例5: platformApplySoftware
void FEImage::platformApplySoftware()
{
RenderElement* renderer = referencedRenderer();
if (!m_image && !renderer)
return;
ImageBuffer* resultImage = createImageBufferResult();
if (!resultImage)
return;
SVGFilter* svgFilter = toSVGFilter(filter());
FloatRect destRect = svgFilter->absoluteTransform().mapRect(filterPrimitiveSubregion());
FloatRect srcRect;
if (renderer)
srcRect = svgFilter->absoluteTransform().mapRect(renderer->repaintRectInLocalCoordinates());
else {
srcRect = FloatRect(FloatPoint(), m_image->size());
m_preserveAspectRatio.transformRect(destRect, srcRect);
}
IntPoint paintLocation = absolutePaintRect().location();
destRect.move(-paintLocation.x(), -paintLocation.y());
// FEImage results are always in ColorSpaceDeviceRGB
setResultColorSpace(ColorSpaceDeviceRGB);
if (renderer) {
const AffineTransform& absoluteTransform = svgFilter->absoluteTransform();
resultImage->context()->concatCTM(absoluteTransform);
SVGElement* contextNode = toSVGElement(renderer->element());
if (contextNode->hasRelativeLengths()) {
SVGLengthContext lengthContext(contextNode);
FloatSize viewportSize;
// If we're referencing an element with percentage units, eg. <rect with="30%"> those values were resolved against the viewport.
// Build up a transformation that maps from the viewport space to the filter primitive subregion.
if (lengthContext.determineViewport(viewportSize))
resultImage->context()->concatCTM(makeMapBetweenRects(FloatRect(FloatPoint(), viewportSize), destRect));
}
AffineTransform contentTransformation;
SVGRenderingContext::renderSubtreeToImageBuffer(resultImage, *renderer, contentTransformation);
return;
}
resultImage->context()->drawImage(m_image.get(), ColorSpaceDeviceRGB, destRect, srcRect);
}