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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 ASSERT(m_object && m_paintInfo); | 57 ASSERT(m_object && m_paintInfo); |
58 | 58 |
59 if (m_renderingFlags & PostApplyResources) { | 59 if (m_renderingFlags & PostApplyResources) { |
60 ASSERT(m_masker || m_clipper || m_filter); | 60 ASSERT(m_masker || m_clipper || m_filter); |
61 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)); | 61 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)); |
62 | 62 |
63 if (m_filter) { | 63 if (m_filter) { |
64 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
filter() == m_filter); | 64 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
filter() == m_filter); |
65 m_filter->postApplyResource(m_object, m_paintInfo->context, ApplyToD
efaultMode, 0, 0); | 65 m_filter->postApplyResource(m_object, m_paintInfo->context, ApplyToD
efaultMode, 0, 0); |
66 m_paintInfo->context = m_savedContext; | 66 m_paintInfo->context = m_savedContext; |
67 m_paintInfo->setRect(m_savedPaintRect); | 67 m_paintInfo->rect = m_savedPaintRect; |
68 } | 68 } |
69 | 69 |
70 if (m_clipper) { | 70 if (m_clipper) { |
71 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
clipper() == m_clipper); | 71 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
clipper() == m_clipper); |
72 m_clipper->postApplyResource(m_object, m_paintInfo->context, ApplyTo
DefaultMode, 0, 0); | 72 m_clipper->postApplyResource(m_object, m_paintInfo->context, ApplyTo
DefaultMode, 0, 0); |
73 } | 73 } |
74 | 74 |
75 if (m_masker) { | 75 if (m_masker) { |
76 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
masker() == m_masker); | 76 ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->
masker() == m_masker); |
77 m_masker->postApplyResource(m_object, m_paintInfo->context, ApplyToD
efaultMode, 0, 0); | 77 m_masker->postApplyResource(m_object, m_paintInfo->context, ApplyToD
efaultMode, 0, 0); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (!clipper->applyResource(m_object, style, m_paintInfo->context, Apply
ToDefaultMode)) | 161 if (!clipper->applyResource(m_object, style, m_paintInfo->context, Apply
ToDefaultMode)) |
162 return; | 162 return; |
163 m_clipper = clipper; | 163 m_clipper = clipper; |
164 m_renderingFlags |= PostApplyResources; | 164 m_renderingFlags |= PostApplyResources; |
165 } | 165 } |
166 | 166 |
167 if (!isRenderingMask) { | 167 if (!isRenderingMask) { |
168 m_filter = resources->filter(); | 168 m_filter = resources->filter(); |
169 if (m_filter) { | 169 if (m_filter) { |
170 m_savedContext = m_paintInfo->context; | 170 m_savedContext = m_paintInfo->context; |
171 m_savedPaintRect = m_paintInfo->rect(); | 171 m_savedPaintRect = m_paintInfo->rect; |
172 // Return with false here may mean that we don't need to draw the co
ntent | 172 // Return with false here may mean that we don't need to draw the co
ntent |
173 // (because it was either drawn before or empty) but we still need t
o apply the filter. | 173 // (because it was either drawn before or empty) but we still need t
o apply the filter. |
174 m_renderingFlags |= PostApplyResources; | 174 m_renderingFlags |= PostApplyResources; |
175 if (!m_filter->applyResource(m_object, style, m_paintInfo->context,
ApplyToDefaultMode)) | 175 if (!m_filter->applyResource(m_object, style, m_paintInfo->context,
ApplyToDefaultMode)) |
176 return; | 176 return; |
177 | 177 |
178 // Since we're caching the resulting bitmap and do not invalidate it
on repaint rect | 178 // Since we're caching the resulting bitmap and do not invalidate it
on repaint rect |
179 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible | 179 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible |
180 // at the time of the initial paint (due to scrolling, window size,
etc.) will never | 180 // at the time of the initial paint (due to scrolling, window size,
etc.) will never |
181 // be drawn. | 181 // be drawn. |
182 m_paintInfo->setRect(IntRect(m_filter->drawingRegion(m_object))); | 182 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object)); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 m_renderingFlags |= RenderingPrepared; | 186 m_renderingFlags |= RenderingPrepared; |
187 } | 187 } |
188 | 188 |
189 static AffineTransform& currentContentTransformation() | 189 static AffineTransform& currentContentTransformation() |
190 { | 190 { |
191 DEFINE_STATIC_LOCAL(AffineTransform, s_currentContentTransformation, ()); | 191 DEFINE_STATIC_LOCAL(AffineTransform, s_currentContentTransformation, ()); |
192 return s_currentContentTransformation; | 192 return s_currentContentTransformation; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); | 337 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); |
338 } else | 338 } else |
339 return false; | 339 return false; |
340 } | 340 } |
341 | 341 |
342 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 342 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); |
343 return true; | 343 return true; |
344 } | 344 } |
345 | 345 |
346 } | 346 } |
OLD | NEW |