| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return; | 58 return; |
| 59 | 59 |
| 60 ASSERT(m_object && m_paintInfo); | 60 ASSERT(m_object && m_paintInfo); |
| 61 | 61 |
| 62 if (m_renderingFlags & PostApplyResources) { | 62 if (m_renderingFlags & PostApplyResources) { |
| 63 ASSERT(m_masker || m_clipper || m_filter); | 63 ASSERT(m_masker || m_clipper || m_filter); |
| 64 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)); | 64 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)); |
| 65 | 65 |
| 66 if (m_filter) { | 66 if (m_filter) { |
| 67 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
filter() == m_filter); | 67 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
filter() == m_filter); |
| 68 m_filter->postApplyResource(m_object, m_paintInfo->context); | 68 m_filter->finishEffect(m_object, m_paintInfo->context); |
| 69 m_paintInfo->context = m_savedContext; | 69 m_paintInfo->context = m_savedContext; |
| 70 m_paintInfo->rect = m_savedPaintRect; | 70 m_paintInfo->rect = m_savedPaintRect; |
| 71 } | 71 } |
| 72 | 72 |
| 73 if (m_clipper) { | 73 if (m_clipper) { |
| 74 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
clipper() == m_clipper); | 74 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
clipper() == m_clipper); |
| 75 m_clipper->postApplyStatefulResource(m_object, m_paintInfo->context,
m_clipperState); | 75 m_clipper->postApplyStatefulResource(m_object, m_paintInfo->context,
m_clipperState); |
| 76 } | 76 } |
| 77 | 77 |
| 78 if (m_masker) { | 78 if (m_masker) { |
| 79 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
masker() == m_masker); | 79 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
masker() == m_masker); |
| 80 m_masker->postApplyResource(m_object, m_paintInfo->context); | 80 m_masker->finishEffect(m_object, m_paintInfo->context); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (m_renderingFlags & EndOpacityLayer) | 84 if (m_renderingFlags & EndOpacityLayer) |
| 85 m_paintInfo->context->endLayer(); | 85 m_paintInfo->context->endLayer(); |
| 86 | 86 |
| 87 if (m_renderingFlags & RestoreGraphicsContext) | 87 if (m_renderingFlags & RestoreGraphicsContext) |
| 88 m_paintInfo->context->restore(); | 88 m_paintInfo->context->restore(); |
| 89 } | 89 } |
| 90 | 90 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 if (!resources) { | 143 if (!resources) { |
| 144 if (svgStyle.hasFilter()) | 144 if (svgStyle.hasFilter()) |
| 145 return; | 145 return; |
| 146 | 146 |
| 147 m_renderingFlags |= RenderingPrepared; | 147 m_renderingFlags |= RenderingPrepared; |
| 148 return; | 148 return; |
| 149 } | 149 } |
| 150 | 150 |
| 151 if (!isRenderingMask) { | 151 if (!isRenderingMask) { |
| 152 if (RenderSVGResourceMasker* masker = resources->masker()) { | 152 if (RenderSVGResourceMasker* masker = resources->masker()) { |
| 153 if (!masker->applyResource(m_object, style, m_paintInfo->context, Ap
plyToDefaultMode)) | 153 if (!masker->prepareEffect(m_object, style, m_paintInfo->context)) |
| 154 return; | 154 return; |
| 155 m_masker = masker; | 155 m_masker = masker; |
| 156 m_renderingFlags |= PostApplyResources; | 156 m_renderingFlags |= PostApplyResources; |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 RenderSVGResourceClipper* clipper = resources->clipper(); | 160 RenderSVGResourceClipper* clipper = resources->clipper(); |
| 161 if (!clipPathOperation && clipper) { | 161 if (!clipPathOperation && clipper) { |
| 162 if (!clipper->applyStatefulResource(m_object, m_paintInfo->context, m_cl
ipperState)) | 162 if (!clipper->applyStatefulResource(m_object, m_paintInfo->context, m_cl
ipperState)) |
| 163 return; | 163 return; |
| 164 m_clipper = clipper; | 164 m_clipper = clipper; |
| 165 m_renderingFlags |= PostApplyResources; | 165 m_renderingFlags |= PostApplyResources; |
| 166 } | 166 } |
| 167 | 167 |
| 168 if (!isRenderingMask) { | 168 if (!isRenderingMask) { |
| 169 m_filter = resources->filter(); | 169 m_filter = resources->filter(); |
| 170 if (m_filter) { | 170 if (m_filter) { |
| 171 m_savedContext = m_paintInfo->context; | 171 m_savedContext = m_paintInfo->context; |
| 172 m_savedPaintRect = m_paintInfo->rect; | 172 m_savedPaintRect = m_paintInfo->rect; |
| 173 // Return with false here may mean that we don't need to draw the co
ntent | 173 // Return with false here may mean that we don't need to draw the co
ntent |
| 174 // (because it was either drawn before or empty) but we still need t
o apply the filter. | 174 // (because it was either drawn before or empty) but we still need t
o apply the filter. |
| 175 m_renderingFlags |= PostApplyResources; | 175 m_renderingFlags |= PostApplyResources; |
| 176 if (!m_filter->applyResource(m_object, style, m_paintInfo->context,
ApplyToDefaultMode)) | 176 if (!m_filter->prepareEffect(m_object, style, m_paintInfo->context)) |
| 177 return; | 177 return; |
| 178 | 178 |
| 179 // Since we're caching the resulting bitmap and do not invalidate it
on paint invalidation rect | 179 // Since we're caching the resulting bitmap and do not invalidate it
on paint invalidation rect |
| 180 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible | 180 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible |
| 181 // at the time of the initial paint (due to scrolling, window size,
etc.) will never | 181 // at the time of the initial paint (due to scrolling, window size,
etc.) will never |
| 182 // be drawn. | 182 // be drawn. |
| 183 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object)); | 183 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object)); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 SVGImagePainter::paintForeground(toRenderSVGImage(*m_object), buffer
edInfo); | 298 SVGImagePainter::paintForeground(toRenderSVGImage(*m_object), buffer
edInfo); |
| 299 } else | 299 } else |
| 300 return false; | 300 return false; |
| 301 } | 301 } |
| 302 | 302 |
| 303 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 303 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); |
| 304 return true; | 304 return true; |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace blink | 307 } // namespace blink |
| OLD | NEW |