| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 m_filter.clear(); | 77 m_filter.clear(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); | 80 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void RenderSVGResourceFilter::removeClientFromCache(RenderObject* client, bool m
arkForInvalidation) | 83 void RenderSVGResourceFilter::removeClientFromCache(RenderObject* client, bool m
arkForInvalidation) |
| 84 { | 84 { |
| 85 ASSERT(client); | 85 ASSERT(client); |
| 86 | 86 |
| 87 if (m_filter.contains(client)) | 87 if (FilterData* filterData = m_filter.get(client)) { |
| 88 delete m_filter.take(client); | 88 if (filterData->savedContext) |
| 89 filterData->markedForRemoval = true; |
| 90 else |
| 91 delete m_filter.take(client); |
| 92 } |
| 89 | 93 |
| 90 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); | 94 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); |
| 91 } | 95 } |
| 92 | 96 |
| 93 PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(Filter* fi
lter) | 97 PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(Filter* fi
lter) |
| 94 { | 98 { |
| 95 SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(node()); | 99 SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(node()); |
| 96 bool primitiveBoundingBoxMode = filterElement->primitiveUnits() == SVGUnitTy
pes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; | 100 bool primitiveBoundingBoxMode = filterElement->primitiveUnits() == SVGUnitTy
pes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; |
| 97 | 101 |
| 98 // Add effects to the builder | 102 // Add effects to the builder |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
ntext*& context, unsigned short resourceMode, const Path*) | 263 void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
ntext*& context, unsigned short resourceMode, const Path*) |
| 260 { | 264 { |
| 261 ASSERT(object); | 265 ASSERT(object); |
| 262 ASSERT(context); | 266 ASSERT(context); |
| 263 #ifndef NDEBUG | 267 #ifndef NDEBUG |
| 264 ASSERT(resourceMode == ApplyToDefaultMode); | 268 ASSERT(resourceMode == ApplyToDefaultMode); |
| 265 #else | 269 #else |
| 266 UNUSED_PARAM(resourceMode); | 270 UNUSED_PARAM(resourceMode); |
| 267 #endif | 271 #endif |
| 268 | 272 |
| 269 if (!m_filter.contains(object)) | 273 FilterData* filterData = m_filter.get(object); |
| 274 if (!filterData) |
| 270 return; | 275 return; |
| 271 | 276 |
| 272 FilterData* filterData = m_filter.get(object); | 277 if (filterData->markedForRemoval) { |
| 278 delete m_filter.take(object); |
| 279 return; |
| 280 } |
| 281 |
| 273 if (!filterData->builded) { | 282 if (!filterData->builded) { |
| 274 if (!filterData->savedContext) { | 283 if (!filterData->savedContext) { |
| 275 removeClientFromCache(object); | 284 removeClientFromCache(object); |
| 276 return; | 285 return; |
| 277 } | 286 } |
| 278 | 287 |
| 279 context = filterData->savedContext; | 288 context = filterData->savedContext; |
| 280 filterData->savedContext = 0; | 289 filterData->savedContext = 0; |
| 281 #if !USE(CG) | 290 #if !USE(CG) |
| 282 if (filterData->sourceGraphicBuffer) | 291 if (filterData->sourceGraphicBuffer) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 return; | 357 return; |
| 349 builder->clearResultsRecursive(effect); | 358 builder->clearResultsRecursive(effect); |
| 350 | 359 |
| 351 // Repaint the image on the screen. | 360 // Repaint the image on the screen. |
| 352 markClientForInvalidation(it->first, RepaintInvalidation); | 361 markClientForInvalidation(it->first, RepaintInvalidation); |
| 353 } | 362 } |
| 354 } | 363 } |
| 355 | 364 |
| 356 } | 365 } |
| 357 #endif | 366 #endif |
| OLD | NEW |