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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 if (!resources) { | 131 if (!resources) { |
132 if (svgStyle.hasFilter()) | 132 if (svgStyle.hasFilter()) |
133 return; | 133 return; |
134 | 134 |
135 m_renderingFlags |= RenderingPrepared; | 135 m_renderingFlags |= RenderingPrepared; |
136 return; | 136 return; |
137 } | 137 } |
138 | 138 |
139 if (!isRenderingMask) { | 139 if (!isRenderingMask) { |
140 if (RenderSVGResourceMasker* masker = resources->masker()) { | 140 if (RenderSVGResourceMasker* masker = resources->masker()) { |
141 if (!masker->prepareEffect(m_object, style, m_paintInfo->context)) | 141 if (!masker->prepareEffect(m_object, m_paintInfo->context)) |
142 return; | 142 return; |
143 m_masker = masker; | 143 m_masker = masker; |
144 m_renderingFlags |= PostApplyResources; | 144 m_renderingFlags |= PostApplyResources; |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 RenderSVGResourceClipper* clipper = resources->clipper(); | 148 RenderSVGResourceClipper* clipper = resources->clipper(); |
149 if (!clipPathOperation && clipper) { | 149 if (!clipPathOperation && clipper) { |
150 if (!clipper->applyStatefulResource(m_object, m_paintInfo->context, m_cl
ipperState)) | 150 if (!clipper->applyStatefulResource(m_object, m_paintInfo->context, m_cl
ipperState)) |
151 return; | 151 return; |
152 m_clipper = clipper; | 152 m_clipper = clipper; |
153 m_renderingFlags |= PostApplyResources; | 153 m_renderingFlags |= PostApplyResources; |
154 } | 154 } |
155 | 155 |
156 if (!isRenderingMask) { | 156 if (!isRenderingMask) { |
157 m_filter = resources->filter(); | 157 m_filter = resources->filter(); |
158 if (m_filter) { | 158 if (m_filter) { |
159 m_savedContext = m_paintInfo->context; | 159 m_savedContext = m_paintInfo->context; |
160 m_savedPaintRect = m_paintInfo->rect; | 160 m_savedPaintRect = m_paintInfo->rect; |
161 // Return with false here may mean that we don't need to draw the co
ntent | 161 // Return with false here may mean that we don't need to draw the co
ntent |
162 // (because it was either drawn before or empty) but we still need t
o apply the filter. | 162 // (because it was either drawn before or empty) but we still need t
o apply the filter. |
163 m_renderingFlags |= PostApplyResources; | 163 m_renderingFlags |= PostApplyResources; |
164 if (!m_filter->prepareEffect(m_object, style, m_paintInfo->context)) | 164 if (!m_filter->prepareEffect(m_object, m_paintInfo->context)) |
165 return; | 165 return; |
166 | 166 |
167 // Since we're caching the resulting bitmap and do not invalidate it
on paint invalidation rect | 167 // Since we're caching the resulting bitmap and do not invalidate it
on paint invalidation rect |
168 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible | 168 // changes, we need to paint the whole filter region. Otherwise, ele
ments not visible |
169 // at the time of the initial paint (due to scrolling, window size,
etc.) will never | 169 // at the time of the initial paint (due to scrolling, window size,
etc.) will never |
170 // be drawn. | 170 // be drawn. |
171 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object)); | 171 m_paintInfo->rect = IntRect(m_filter->drawingRegion(m_object)); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 SVGImagePainter::paintForeground(toRenderSVGImage(*m_object), buffer
edInfo); | 270 SVGImagePainter::paintForeground(toRenderSVGImage(*m_object), buffer
edInfo); |
271 } else | 271 } else |
272 return false; | 272 return false; |
273 } | 273 } |
274 | 274 |
275 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); | 275 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); |
276 return true; | 276 return true; |
277 } | 277 } |
278 | 278 |
279 } // namespace blink | 279 } // namespace blink |
OLD | NEW |