| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef ShapeResult_h | 31 #ifndef ShapeResult_h |
| 32 #define ShapeResult_h | 32 #define ShapeResult_h |
| 33 | 33 |
| 34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/geometry/FloatRect.h" | 35 #include "platform/geometry/FloatRect.h" |
| 36 #include "platform/text/TextDirection.h" | 36 #include "platform/text/TextDirection.h" |
| 37 #include "wtf/HashSet.h" | 37 #include "wtf/HashSet.h" |
| 38 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/OwnPtr.h" | |
| 40 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
| 41 #include "wtf/Vector.h" | 40 #include "wtf/Vector.h" |
| 41 #include <memory> |
| 42 | 42 |
| 43 struct hb_buffer_t; | 43 struct hb_buffer_t; |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| 47 class Font; | 47 class Font; |
| 48 class ShapeResultSpacing; | 48 class ShapeResultSpacing; |
| 49 class SimpleFontData; | 49 class SimpleFontData; |
| 50 class TextRun; | 50 class TextRun; |
| 51 struct GlyphData; | 51 struct GlyphData; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 81 | 81 |
| 82 ShapeResult(const Font*, unsigned numCharacters, TextDirection); | 82 ShapeResult(const Font*, unsigned numCharacters, TextDirection); |
| 83 ShapeResult(const ShapeResult&); | 83 ShapeResult(const ShapeResult&); |
| 84 | 84 |
| 85 static PassRefPtr<ShapeResult> create(const ShapeResult& other) | 85 static PassRefPtr<ShapeResult> create(const ShapeResult& other) |
| 86 { | 86 { |
| 87 return adoptRef(new ShapeResult(other)); | 87 return adoptRef(new ShapeResult(other)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void applySpacing(ShapeResultSpacing&, const TextRun&); | 90 void applySpacing(ShapeResultSpacing&, const TextRun&); |
| 91 void insertRun(PassOwnPtr<ShapeResult::RunInfo>, unsigned startGlyph, | 91 void insertRun(std::unique_ptr<ShapeResult::RunInfo>, unsigned startGlyph, |
| 92 unsigned numGlyphs, hb_buffer_t*); | 92 unsigned numGlyphs, hb_buffer_t*); |
| 93 | 93 |
| 94 float m_width; | 94 float m_width; |
| 95 FloatRect m_glyphBoundingBox; | 95 FloatRect m_glyphBoundingBox; |
| 96 Vector<OwnPtr<RunInfo>> m_runs; | 96 Vector<std::unique_ptr<RunInfo>> m_runs; |
| 97 RefPtr<SimpleFontData> m_primaryFont; | 97 RefPtr<SimpleFontData> m_primaryFont; |
| 98 | 98 |
| 99 unsigned m_numCharacters; | 99 unsigned m_numCharacters; |
| 100 unsigned m_numGlyphs : 30; | 100 unsigned m_numGlyphs : 30; |
| 101 | 101 |
| 102 // Overall direction for the TextRun, dictates which order each individual | 102 // Overall direction for the TextRun, dictates which order each individual |
| 103 // sub run (represented by RunInfo structs in the m_runs vector) can have a | 103 // sub run (represented by RunInfo structs in the m_runs vector) can have a |
| 104 // different text direction. | 104 // different text direction. |
| 105 unsigned m_direction : 1; | 105 unsigned m_direction : 1; |
| 106 | 106 |
| 107 // Tracks whether any runs contain glyphs with a y-offset != 0. | 107 // Tracks whether any runs contain glyphs with a y-offset != 0. |
| 108 unsigned m_hasVerticalOffsets : 1; | 108 unsigned m_hasVerticalOffsets : 1; |
| 109 | 109 |
| 110 friend class HarfBuzzShaper; | 110 friend class HarfBuzzShaper; |
| 111 friend class ShapeResultBuffer; | 111 friend class ShapeResultBuffer; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| 115 | 115 |
| 116 #endif // ShapeResult_h | 116 #endif // ShapeResult_h |
| OLD | NEW |