| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2011. 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #ifndef SVGTextLayoutAttributes_h | 20 #ifndef SVGTextLayoutAttributes_h |
| 21 #define SVGTextLayoutAttributes_h | 21 #define SVGTextLayoutAttributes_h |
| 22 | 22 |
| 23 #include "core/layout/svg/SVGTextMetrics.h" | 23 #include "core/layout/svg/SVGTextMetrics.h" |
| 24 #include "wtf/Allocator.h" |
| 24 #include "wtf/HashMap.h" | 25 #include "wtf/HashMap.h" |
| 25 #include "wtf/MathExtras.h" | 26 #include "wtf/MathExtras.h" |
| 26 #include "wtf/Noncopyable.h" | 27 #include "wtf/Noncopyable.h" |
| 27 #include "wtf/Vector.h" | 28 #include "wtf/Vector.h" |
| 28 | 29 |
| 29 namespace blink { | 30 namespace blink { |
| 30 | 31 |
| 31 class LayoutSVGInlineText; | 32 class LayoutSVGInlineText; |
| 32 | 33 |
| 33 struct SVGCharacterData { | 34 struct SVGCharacterData { |
| 35 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 34 SVGCharacterData(); | 36 SVGCharacterData(); |
| 35 | 37 |
| 36 float x; | 38 float x; |
| 37 float y; | 39 float y; |
| 38 float dx; | 40 float dx; |
| 39 float dy; | 41 float dy; |
| 40 float rotate; | 42 float rotate; |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 typedef HashMap<unsigned, SVGCharacterData> SVGCharacterDataMap; | 45 typedef HashMap<unsigned, SVGCharacterData> SVGCharacterDataMap; |
| 44 | 46 |
| 45 class SVGTextLayoutAttributes { | 47 class SVGTextLayoutAttributes { |
| 48 DISALLOW_ALLOCATION(); |
| 46 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributes); | 49 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributes); |
| 47 public: | 50 public: |
| 48 SVGTextLayoutAttributes(LayoutSVGInlineText*); | 51 SVGTextLayoutAttributes(LayoutSVGInlineText*); |
| 49 | 52 |
| 50 void clear(); | 53 void clear(); |
| 51 static float emptyValue() { return std::numeric_limits<float>::quiet_NaN();
} | 54 static float emptyValue() { return std::numeric_limits<float>::quiet_NaN();
} |
| 52 static bool isEmptyValue(float value) { return std::isnan(value); } | 55 static bool isEmptyValue(float value) { return std::isnan(value); } |
| 53 | 56 |
| 54 LayoutSVGInlineText* context() const { return m_context; } | 57 LayoutSVGInlineText* context() const { return m_context; } |
| 55 | 58 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 70 , y(SVGTextLayoutAttributes::emptyValue()) | 73 , y(SVGTextLayoutAttributes::emptyValue()) |
| 71 , dx(SVGTextLayoutAttributes::emptyValue()) | 74 , dx(SVGTextLayoutAttributes::emptyValue()) |
| 72 , dy(SVGTextLayoutAttributes::emptyValue()) | 75 , dy(SVGTextLayoutAttributes::emptyValue()) |
| 73 , rotate(SVGTextLayoutAttributes::emptyValue()) | 76 , rotate(SVGTextLayoutAttributes::emptyValue()) |
| 74 { | 77 { |
| 75 } | 78 } |
| 76 | 79 |
| 77 } // namespace blink | 80 } // namespace blink |
| 78 | 81 |
| 79 #endif | 82 #endif |
| OLD | NEW |