| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
GraphicsContext*& context, unsigned short resourceMode) | 186 bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
GraphicsContext*& context, unsigned short resourceMode) |
| 187 { | 187 { |
| 188 ASSERT(object); | 188 ASSERT(object); |
| 189 ASSERT(context); | 189 ASSERT(context); |
| 190 ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode); | 190 ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode); |
| 191 | 191 |
| 192 clearInvalidationMask(); | 192 clearInvalidationMask(); |
| 193 | 193 |
| 194 if (m_filter.contains(object)) { | 194 if (m_filter.contains(object)) { |
| 195 FilterData* filterData = m_filter.get(object); | 195 FilterData* filterData = m_filter.get(object); |
| 196 if (filterData->state == FilterData::PaintingSource || filterData->state
== FilterData::Applying) | 196 if (filterData->state == FilterData::PaintingSource) |
| 197 filterData->state = FilterData::CycleDetected; | 197 filterData->state = FilterData::CycleDetected; |
| 198 return false; // Already built, or we're in a cycle, or we're marked for
removal. Regardless, just do nothing more now. | 198 return false; // Already built, or we're in a cycle. Regardless, just do
nothing more now. |
| 199 } | 199 } |
| 200 | 200 |
| 201 OwnPtr<FilterData> filterData(adoptPtr(new FilterData)); | 201 OwnPtr<FilterData> filterData(adoptPtr(new FilterData)); |
| 202 FloatRect targetBoundingBox = object->objectBoundingBox(); | 202 FloatRect targetBoundingBox = object->objectBoundingBox(); |
| 203 | 203 |
| 204 SVGFilterElement* filterElement = toSVGFilterElement(element()); | 204 SVGFilterElement* filterElement = toSVGFilterElement(element()); |
| 205 filterData->boundaries = SVGLengthContext::resolveRectangle<SVGFilterElement
>(filterElement, filterElement->filterUnits()->currentValue()->enumValue(), targ
etBoundingBox); | 205 filterData->boundaries = SVGLengthContext::resolveRectangle<SVGFilterElement
>(filterElement, filterElement->filterUnits()->currentValue()->enumValue(), targ
etBoundingBox); |
| 206 if (filterData->boundaries.isEmpty()) | 206 if (filterData->boundaries.isEmpty()) |
| 207 return false; | 207 return false; |
| 208 | 208 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 235 { | 235 { |
| 236 ASSERT(object); | 236 ASSERT(object); |
| 237 ASSERT(context); | 237 ASSERT(context); |
| 238 | 238 |
| 239 FilterData* filterData = m_filter.get(object); | 239 FilterData* filterData = m_filter.get(object); |
| 240 if (!filterData) | 240 if (!filterData) |
| 241 return; | 241 return; |
| 242 | 242 |
| 243 switch (filterData->state) { | 243 switch (filterData->state) { |
| 244 case FilterData::CycleDetected: | 244 case FilterData::CycleDetected: |
| 245 case FilterData::Applying: | 245 // applyResource detected a cycle. This can occur due to FeImage |
| 246 // We have a cycle if we are already applying the data. | 246 // referencing a source that makes use of the FEImage itself. This is |
| 247 // This can occur due to FeImage referencing a source that makes use of
the FEImage itself. | 247 // the first place we've hit the cycle, so set the state back to |
| 248 // This is the first place we've hit the cycle, so set the state back to
PaintingSource so the return stack | 248 // PaintingSource so the return stack will continue correctly. |
| 249 // will continue correctly. | |
| 250 filterData->state = FilterData::PaintingSource; | 249 filterData->state = FilterData::PaintingSource; |
| 251 return; | 250 return; |
| 252 | 251 |
| 253 case FilterData::PaintingSource: | 252 case FilterData::PaintingSource: |
| 254 endDeferredFilter(context, filterData); | 253 endDeferredFilter(context, filterData); |
| 255 break; | 254 break; |
| 256 | 255 |
| 257 case FilterData::Built: { } // Empty | 256 case FilterData::Built: { } // Empty |
| 258 } | 257 } |
| 259 | 258 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 markAllClientLayersForInvalidation(); | 295 markAllClientLayersForInvalidation(); |
| 297 } | 296 } |
| 298 | 297 |
| 299 FloatRect RenderSVGResourceFilter::drawingRegion(RenderObject* object) const | 298 FloatRect RenderSVGResourceFilter::drawingRegion(RenderObject* object) const |
| 300 { | 299 { |
| 301 FilterData* filterData = m_filter.get(object); | 300 FilterData* filterData = m_filter.get(object); |
| 302 return filterData ? filterData->drawingRegion : FloatRect(); | 301 return filterData ? filterData->drawingRegion : FloatRect(); |
| 303 } | 302 } |
| 304 | 303 |
| 305 } | 304 } |
| OLD | NEW |