OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. | 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 13 matching lines...) Expand all Loading... |
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "platform/fonts/shaping/HarfBuzzShaper.h" | 32 #include "platform/fonts/shaping/HarfBuzzShaper.h" |
33 | 33 |
| 34 #include <hb.h> |
| 35 #include <unicode/uchar.h> |
| 36 #include <unicode/uscript.h> |
| 37 #include <algorithm> |
| 38 #include <memory> |
34 #include "platform/fonts/Font.h" | 39 #include "platform/fonts/Font.h" |
35 #include "platform/fonts/FontDescription.h" | 40 #include "platform/fonts/FontDescription.h" |
36 #include "platform/fonts/FontFallbackIterator.h" | 41 #include "platform/fonts/FontFallbackIterator.h" |
37 #include "platform/fonts/GlyphBuffer.h" | 42 #include "platform/fonts/GlyphBuffer.h" |
38 #include "platform/fonts/SmallCapsIterator.h" | 43 #include "platform/fonts/SmallCapsIterator.h" |
39 #include "platform/fonts/UTF16TextIterator.h" | 44 #include "platform/fonts/UTF16TextIterator.h" |
40 #include "platform/fonts/opentype/OpenTypeCapsSupport.h" | 45 #include "platform/fonts/opentype/OpenTypeCapsSupport.h" |
41 #include "platform/fonts/shaping/CaseMappingHarfBuzzBufferFiller.h" | 46 #include "platform/fonts/shaping/CaseMappingHarfBuzzBufferFiller.h" |
42 #include "platform/fonts/shaping/HarfBuzzFace.h" | 47 #include "platform/fonts/shaping/HarfBuzzFace.h" |
43 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" | 48 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" |
44 #include "platform/text/TextBreakIterator.h" | 49 #include "platform/text/TextBreakIterator.h" |
45 #include "wtf/Compiler.h" | 50 #include "wtf/Compiler.h" |
46 #include "wtf/MathExtras.h" | 51 #include "wtf/MathExtras.h" |
47 #include "wtf/PtrUtil.h" | 52 #include "wtf/PtrUtil.h" |
48 #include "wtf/text/Unicode.h" | 53 #include "wtf/text/Unicode.h" |
49 #include <algorithm> | |
50 #include <hb.h> | |
51 #include <memory> | |
52 #include <unicode/uchar.h> | |
53 #include <unicode/uscript.h> | |
54 | 54 |
55 namespace blink { | 55 namespace blink { |
56 enum HolesQueueItemAction { HolesQueueNextFont, HolesQueueRange }; | 56 enum HolesQueueItemAction { HolesQueueNextFont, HolesQueueRange }; |
57 | 57 |
58 struct HolesQueueItem { | 58 struct HolesQueueItem { |
59 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 59 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
60 HolesQueueItemAction m_action; | 60 HolesQueueItemAction m_action; |
61 unsigned m_startIndex; | 61 unsigned m_startIndex; |
62 unsigned m_numCharacters; | 62 unsigned m_numCharacters; |
63 HolesQueueItem(HolesQueueItemAction action, unsigned start, unsigned num) | 63 HolesQueueItem(HolesQueueItemAction action, unsigned start, unsigned num) |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 shapeSegment(&rangeData, segmentRange, result.get()); | 701 shapeSegment(&rangeData, segmentRange, result.get()); |
702 } | 702 } |
703 return result.release(); | 703 return result.release(); |
704 } | 704 } |
705 | 705 |
706 PassRefPtr<ShapeResult> HarfBuzzShaper::shape(const Font* font, | 706 PassRefPtr<ShapeResult> HarfBuzzShaper::shape(const Font* font, |
707 TextDirection direction) const { | 707 TextDirection direction) const { |
708 return shape(font, direction, 0, m_textLength); | 708 return shape(font, direction, 0, m_textLength); |
709 } | 709 } |
710 } // namespace blink | 710 } // namespace blink |
OLD | NEW |