ASSERT(m_filter);
m_filter->postApplyResource(static_cast<RenderSVGShape*>(m_object), m_paintInfo->context, ApplyToDefaultMode, 0, 0);
m_paintInfo->context = m_savedContext;
+ m_paintInfo->rect = m_savedPaintRect;
}
#endif
}
}
- BasicShape* clipShape = style->clipPath();
- if (clipShape) {
- // FIXME: Investigate if it is better to store and update a Path object in RenderStyle.
- // https://bugs.webkit.org/show_bug.cgi?id=95619
- Path clipPath;
- clipShape->path(clipPath, object->objectBoundingBox());
- m_paintInfo->context->clipPath(clipPath, clipShape->windRule());
+ ClipPathOperation* clipPathOperation = style->clipPath();
+ if (clipPathOperation && clipPathOperation->getOperationType() == ClipPathOperation::SHAPE) {
+ ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(clipPathOperation);
+ m_paintInfo->context->clipPath(clipPath->path(object->objectBoundingBox()), clipPath->windRule());
}
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(m_object);
}
RenderSVGResourceClipper* clipper = resources->clipper();
- if (!clipShape && clipper) {
+ if (!clipPathOperation && clipper) {
if (!clipper->applyResource(m_object, style, m_paintInfo->context, ApplyToDefaultMode))
return;
}
m_filter = resources->filter();
if (m_filter) {
m_savedContext = m_paintInfo->context;
+ m_savedPaintRect = m_paintInfo->rect;
// Return with false here may mean that we don't need to draw the content
// (because it was either drawn before or empty) but we still need to apply the filter.
m_renderingFlags |= EndFilterLayer;
if (!m_filter->applyResource(m_object, style, m_paintInfo->context, ApplyToDefaultMode))
return;
+
+ // Since we're caching the resulting bitmap and do not invalidate it on repaint rect
+ // changes, we need to paint the whole filter region. Otherwise, elements not visible
+ // at the time of the initial paint (due to scrolling, window size, etc.) will never
+ // be drawn.
+ m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object));
}
}
#endif
ASSERT(image);
ASSERT(image->context());
- PaintInfo info(image->context(), PaintInfo::infiniteRect(), PaintPhaseForeground, 0, 0, 0, 0);
+ PaintInfo info(image->context(), PaintInfo::infiniteRect(), PaintPhaseForeground, PaintBehaviorNormal);
AffineTransform& contentTransformation = currentContentTransformation();
AffineTransform savedContentTransformation = contentTransformation;