| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 SVGResourcesCycleSolver::~SVGResourcesCycleSolver() {} | 42 SVGResourcesCycleSolver::~SVGResourcesCycleSolver() {} |
| 43 | 43 |
| 44 struct ActiveFrame { | 44 struct ActiveFrame { |
| 45 typedef SVGResourcesCycleSolver::ResourceSet ResourceSet; | 45 typedef SVGResourcesCycleSolver::ResourceSet ResourceSet; |
| 46 | 46 |
| 47 ActiveFrame(ResourceSet& activeSet, LayoutSVGResourceContainer* resource) | 47 ActiveFrame(ResourceSet& activeSet, LayoutSVGResourceContainer* resource) |
| 48 : m_activeSet(activeSet), m_resource(resource) { | 48 : m_activeSet(activeSet), m_resource(resource) { |
| 49 m_activeSet.insert(m_resource); | 49 m_activeSet.insert(m_resource); |
| 50 } | 50 } |
| 51 ~ActiveFrame() { m_activeSet.remove(m_resource); } | 51 ~ActiveFrame() { m_activeSet.erase(m_resource); } |
| 52 | 52 |
| 53 ResourceSet& m_activeSet; | 53 ResourceSet& m_activeSet; |
| 54 LayoutSVGResourceContainer* m_resource; | 54 LayoutSVGResourceContainer* m_resource; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 bool SVGResourcesCycleSolver::resourceContainsCycles( | 57 bool SVGResourcesCycleSolver::resourceContainsCycles( |
| 58 LayoutSVGResourceContainer* resource) { | 58 LayoutSVGResourceContainer* resource) { |
| 59 // If we've traversed this sub-graph before and no cycles were observed, then | 59 // If we've traversed this sub-graph before and no cycles were observed, then |
| 60 // reuse that result. | 60 // reuse that result. |
| 61 if (m_dagCache.contains(resource)) | 61 if (m_dagCache.contains(resource)) |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ASSERT(resourceLeadingToCycle == m_resources->clipper()); | 156 ASSERT(resourceLeadingToCycle == m_resources->clipper()); |
| 157 m_resources->resetClipper(); | 157 m_resources->resetClipper(); |
| 158 break; | 158 break; |
| 159 default: | 159 default: |
| 160 ASSERT_NOT_REACHED(); | 160 ASSERT_NOT_REACHED(); |
| 161 break; | 161 break; |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace blink | 165 } // namespace blink |
| OLD | NEW |