static int kMaxImageBufferSize = 4096;
-namespace WebCore {
+namespace blink {
static inline bool isRenderingMaskImage(RenderObject* object)
{
{
ASSERT(object);
-#ifndef NDEBUG
+#if ENABLE(ASSERT)
// This function must not be called twice!
ASSERT(!(m_renderingFlags & PrepareToRenderSVGContentWasCalled));
m_renderingFlags |= PrepareToRenderSVGContentWasCalled;
RenderStyle* style = m_object->style();
ASSERT(style);
- const SVGRenderStyle* svgStyle = style->svgStyle();
- ASSERT(svgStyle);
+ const SVGRenderStyle& svgStyle = style->svgStyle();
// Setup transparency layers before setting up SVG resources!
bool isRenderingMask = isRenderingMaskImage(m_object);
bool hasBlendMode = style->hasBlendMode() && !isRenderingMask;
if (opacity < 1 || hasBlendMode || style->hasIsolation()) {
- FloatRect repaintRect = m_object->paintInvalidationRectInLocalCoordinates();
- m_paintInfo->context->clip(repaintRect);
+ FloatRect paintInvalidationRect = m_object->paintInvalidationRectInLocalCoordinates();
+ m_paintInfo->context->clip(paintInvalidationRect);
if (hasBlendMode) {
if (!(m_renderingFlags & RestoreGraphicsContext)) {
m_paintInfo->context->beginTransparencyLayer(opacity);
if (hasBlendMode)
- m_paintInfo->context->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal);
+ m_paintInfo->context->setCompositeOperation(CompositeSourceOver, WebBlendModeNormal);
m_renderingFlags |= EndOpacityLayer;
}
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(m_object);
if (!resources) {
- if (svgStyle->hasFilter())
+ if (svgStyle.hasFilter())
return;
m_renderingFlags |= RenderingPrepared;
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
+ // Since we're caching the resulting bitmap and do not invalidate it on paint invalidation 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.
// Create a new buffer and paint the foreground into it.
if (!imageBuffer) {
- if ((imageBuffer = m_paintInfo->context->createCompatibleBuffer(expandedIntSize(boundingBox.size())))) {
+ if ((imageBuffer = m_paintInfo->context->createRasterBuffer(expandedIntSize(boundingBox.size())))) {
GraphicsContext* bufferedRenderingContext = imageBuffer->context();
bufferedRenderingContext->translate(-boundingBox.x(), -boundingBox.y());
PaintInfo bufferedInfo(*m_paintInfo);
return true;
}
-}
+} // namespace blink