| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 197 } |
| 198 | 198 |
| 199 static inline SVGResources& ensureResources(OwnPtr<SVGResources>& resources) | 199 static inline SVGResources& ensureResources(OwnPtr<SVGResources>& resources) |
| 200 { | 200 { |
| 201 if (!resources) | 201 if (!resources) |
| 202 resources = adoptPtr(new SVGResources); | 202 resources = adoptPtr(new SVGResources); |
| 203 | 203 |
| 204 return *resources.get(); | 204 return *resources.get(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 PassOwnPtr<SVGResources> SVGResources::buildResources(const RenderObject* object
, const SVGRenderStyle& style) | 207 PassOwnPtr<SVGResources> SVGResources::buildResources(const LayoutObject* object
, const SVGRenderStyle& style) |
| 208 { | 208 { |
| 209 ASSERT(object); | 209 ASSERT(object); |
| 210 | 210 |
| 211 Node* node = object->node(); | 211 Node* node = object->node(); |
| 212 ASSERT(node); | 212 ASSERT(node); |
| 213 ASSERT_WITH_SECURITY_IMPLICATION(node->isSVGElement()); | 213 ASSERT_WITH_SECURITY_IMPLICATION(node->isSVGElement()); |
| 214 | 214 |
| 215 SVGElement* element = toSVGElement(node); | 215 SVGElement* element = toSVGElement(node); |
| 216 ASSERT(element); | 216 ASSERT(element); |
| 217 | 217 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 if (RenderSVGResourcePaintServer* fill = m_fillStrokeData->fill) | 309 if (RenderSVGResourcePaintServer* fill = m_fillStrokeData->fill) |
| 310 fill->layoutIfNeeded(); | 310 fill->layoutIfNeeded(); |
| 311 if (RenderSVGResourcePaintServer* stroke = m_fillStrokeData->stroke) | 311 if (RenderSVGResourcePaintServer* stroke = m_fillStrokeData->stroke) |
| 312 stroke->layoutIfNeeded(); | 312 stroke->layoutIfNeeded(); |
| 313 } | 313 } |
| 314 | 314 |
| 315 if (m_linkedResource) | 315 if (m_linkedResource) |
| 316 m_linkedResource->layoutIfNeeded(); | 316 m_linkedResource->layoutIfNeeded(); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void SVGResources::removeClientFromCache(RenderObject* object, bool markForInval
idation) const | 319 void SVGResources::removeClientFromCache(LayoutObject* object, bool markForInval
idation) const |
| 320 { | 320 { |
| 321 if (!hasResourceData()) | 321 if (!hasResourceData()) |
| 322 return; | 322 return; |
| 323 | 323 |
| 324 if (m_linkedResource) { | 324 if (m_linkedResource) { |
| 325 ASSERT(!m_clipperFilterMaskerData); | 325 ASSERT(!m_clipperFilterMaskerData); |
| 326 ASSERT(!m_markerData); | 326 ASSERT(!m_markerData); |
| 327 ASSERT(!m_fillStrokeData); | 327 ASSERT(!m_fillStrokeData); |
| 328 m_linkedResource->removeClientFromCache(object, markForInvalidation); | 328 m_linkedResource->removeClientFromCache(object, markForInvalidation); |
| 329 return; | 329 return; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 return true; | 642 return true; |
| 643 } | 643 } |
| 644 | 644 |
| 645 void SVGResources::resetLinkedResource() | 645 void SVGResources::resetLinkedResource() |
| 646 { | 646 { |
| 647 ASSERT(m_linkedResource); | 647 ASSERT(m_linkedResource); |
| 648 m_linkedResource = nullptr; | 648 m_linkedResource = nullptr; |
| 649 } | 649 } |
| 650 | 650 |
| 651 #ifndef NDEBUG | 651 #ifndef NDEBUG |
| 652 void SVGResources::dump(const RenderObject* object) | 652 void SVGResources::dump(const LayoutObject* object) |
| 653 { | 653 { |
| 654 ASSERT(object); | 654 ASSERT(object); |
| 655 ASSERT(object->node()); | 655 ASSERT(object->node()); |
| 656 | 656 |
| 657 fprintf(stderr, "-> this=%p, SVGResources(renderer=%p, node=%p)\n", this, ob
ject, object->node()); | 657 fprintf(stderr, "-> this=%p, SVGResources(renderer=%p, node=%p)\n", this, ob
ject, object->node()); |
| 658 fprintf(stderr, " | DOM Tree:\n"); | 658 fprintf(stderr, " | DOM Tree:\n"); |
| 659 object->node()->showTreeForThis(); | 659 object->node()->showTreeForThis(); |
| 660 | 660 |
| 661 fprintf(stderr, "\n | List of resources:\n"); | 661 fprintf(stderr, "\n | List of resources:\n"); |
| 662 if (m_clipperFilterMaskerData) { | 662 if (m_clipperFilterMaskerData) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 683 if (RenderSVGResourcePaintServer* stroke = m_fillStrokeData->stroke) | 683 if (RenderSVGResourcePaintServer* stroke = m_fillStrokeData->stroke) |
| 684 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke->
element()); | 684 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke->
element()); |
| 685 } | 685 } |
| 686 | 686 |
| 687 if (m_linkedResource) | 687 if (m_linkedResource) |
| 688 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_
linkedResource->element()); | 688 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_
linkedResource->element()); |
| 689 } | 689 } |
| 690 #endif | 690 #endif |
| 691 | 691 |
| 692 } | 692 } |
| OLD | NEW |