| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> |
| 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
| 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 const SVGRenderStyle& svgStyle = style->svgStyle(); | 112 const SVGRenderStyle& svgStyle = style->svgStyle(); |
| 113 | 113 |
| 114 // Setup transparency layers before setting up SVG resources! | 114 // Setup transparency layers before setting up SVG resources! |
| 115 bool isRenderingMask = isRenderingMaskImage(m_object); | 115 bool isRenderingMask = isRenderingMaskImage(m_object); |
| 116 // RenderLayer takes care of root opacity. | 116 // RenderLayer takes care of root opacity. |
| 117 float opacity = (object->isSVGRoot() || isRenderingMask) ? 1 : style->opacit
y(); | 117 float opacity = (object->isSVGRoot() || isRenderingMask) ? 1 : style->opacit
y(); |
| 118 bool hasBlendMode = style->hasBlendMode() && !isRenderingMask; | 118 bool hasBlendMode = style->hasBlendMode() && !isRenderingMask; |
| 119 | 119 |
| 120 if (opacity < 1 || hasBlendMode || style->hasIsolation()) { | 120 if (opacity < 1 || hasBlendMode || style->hasIsolation()) { |
| 121 FloatRect repaintRect = m_object->paintInvalidationRectInLocalCoordinate
s(); | 121 FloatRect paintInvalidationRect = m_object->paintInvalidationRectInLocal
Coordinates(); |
| 122 m_paintInfo->context->clip(repaintRect); | 122 m_paintInfo->context->clip(paintInvalidationRect); |
| 123 | 123 |
| 124 if (hasBlendMode) { | 124 if (hasBlendMode) { |
| 125 if (!(m_renderingFlags & RestoreGraphicsContext)) { | 125 if (!(m_renderingFlags & RestoreGraphicsContext)) { |
| 126 m_paintInfo->context->save(); | 126 m_paintInfo->context->save(); |
| 127 m_renderingFlags |= RestoreGraphicsContext; | 127 m_renderingFlags |= RestoreGraphicsContext; |
| 128 } | 128 } |
| 129 m_paintInfo->context->setCompositeOperation(CompositeSourceOver, sty
le->blendMode()); | 129 m_paintInfo->context->setCompositeOperation(CompositeSourceOver, sty
le->blendMode()); |
| 130 } | 130 } |
| 131 | 131 |
| 132 m_paintInfo->context->beginTransparencyLayer(opacity); | 132 m_paintInfo->context->beginTransparencyLayer(opacity); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 m_filter = resources->filter(); | 173 m_filter = resources->filter(); |
| 174 if (m_filter) { | 174 if (m_filter) { |
| 175 m_savedContext = m_paintInfo->context; | 175 m_savedContext = m_paintInfo->context; |
| 176 m_savedPaintRect = m_paintInfo->rect; | 176 m_savedPaintRect = m_paintInfo->rect; |
| 177 // Return with false here may mean that we don't need to draw the co
ntent | 177 // Return with false here may mean that we don't need to draw the co
ntent |
| 178 // (because it was either drawn before or empty) but we still need t
o apply the filter. | 178 // (because it was either drawn before or empty) but we still need t
o apply the filter. |
| 179 m_renderingFlags |= PostApplyResources; | 179 m_renderingFlags |= PostApplyResources; |
| 180 if (!m_filter->applyResource(m_object, style, m_paintInfo->context,
ApplyToDefaultMode)) | 180 if (!m_filter->applyResource(m_object, style, m_paintInfo->context,
ApplyToDefaultMode)) |
| 181 return; | 181 return; |
| 182 | 182 |
| 183 // Since we're caching the resulting bitmap and do not invalidate it
on repaint rect | 183 // Since we're caching the resulting bitmap and do not invalidate it
on paint invalidation rect |
| 184 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible | 184 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible |
| 185 // at the time of the initial paint (due to scrolling, window size,
etc.) will never | 185 // at the time of the initial paint (due to scrolling, window size,
etc.) will never |
| 186 // be drawn. | 186 // be drawn. |
| 187 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object)); | 187 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object)); |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 m_renderingFlags |= RenderingPrepared; | 191 m_renderingFlags |= RenderingPrepared; |
| 192 } | 192 } |
| 193 | 193 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); | 302 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); |
| 303 } else | 303 } else |
| 304 return false; | 304 return false; |
| 305 } | 305 } |
| 306 | 306 |
| 307 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 307 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); |
| 308 return true; | 308 return true; |
| 309 } | 309 } |
| 310 | 310 |
| 311 } | 311 } |
| OLD | NEW |