void FilterEffectRenderer::apply() { lastEffect()->apply(); #if !USE(CG) output()->transformColorSpace(lastEffect()->colorSpace(), ColorSpaceDeviceRGB); #endif }
LayoutRect FilterEffectRenderer::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect) { // The result of this function is the area in the "filterBoxRect" that needs to be repainted, so that we fully cover the "dirtyRect". FloatRect rectForRepaint = dirtyRect; float inf = std::numeric_limits<float>::infinity(); FloatRect clipRect = FloatRect(FloatPoint(-inf, -inf), FloatSize(inf, inf)); rectForRepaint = lastEffect()->getSourceRect(rectForRepaint, clipRect); rectForRepaint.intersect(filterBoxRect); return LayoutRect(rectForRepaint); }
void FilterEffectRenderer::prepare() { // At this point the effect chain has been built, and the // source image sizes set. We just need to attach the graphic // buffer if we have not yet done so. if (!m_graphicsBufferAttached) { setSourceImage(ImageBuffer::create(IntSize(m_sourceDrawingRegion.width(), m_sourceDrawingRegion.height()), ColorSpaceDeviceRGB, renderingMode())); m_graphicsBufferAttached = true; } m_sourceGraphic->clearResult(); lastEffect()->clearResult(); }
LayoutRect FilterEffectRenderer::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect) { if (hasCustomShaderFilter()) { // When we have at least a custom shader in the chain, we need to compute the whole source image, because the shader can // reference any pixel and we cannot control that. return filterBoxRect; } // The result of this function is the area in the "filterBoxRect" that needs to be repainted, so that we fully cover the "dirtyRect". FloatRect rectForRepaint = dirtyRect; rectForRepaint.move(-filterBoxRect.location().x(), -filterBoxRect.location().y()); float inf = std::numeric_limits<float>::infinity(); FloatRect clipRect = FloatRect(FloatPoint(-inf, -inf), FloatSize(inf, inf)); rectForRepaint = lastEffect()->getSourceRect(rectForRepaint, clipRect); rectForRepaint.move(filterBoxRect.location().x(), filterBoxRect.location().y()); rectForRepaint.intersect(filterBoxRect); return LayoutRect(rectForRepaint); }
void FilterEffectRenderer::apply() { lastEffect()->apply(); }
void FilterEffectRenderer::apply() { RefPtr<FilterEffect> effect = lastEffect(); effect->apply(); effect->transformResultColorSpace(ColorSpaceDeviceRGB); }