| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/unicode/CharacterNames.h" | 34 #include "wtf/unicode/CharacterNames.h" |
| 35 | 35 |
| 36 using namespace std; | 36 using namespace std; |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 class TextLayout { | 40 class TextLayout { |
| 41 public: | 41 public: |
| 42 static bool isNeeded(const TextRun& run, const Font& font) | 42 static bool isNeeded(const TextRun& run, const Font& font) |
| 43 { | 43 { |
| 44 return font.codePath(run) == Font::Complex; | 44 return font.codePath(run) == ComplexPath; |
| 45 } | 45 } |
| 46 | 46 |
| 47 TextLayout(const TextRun& run, unsigned textLength, const Font& font, float
xPos) | 47 TextLayout(const TextRun& run, unsigned textLength, const Font& font, float
xPos) |
| 48 : m_font(font) | 48 : m_font(font) |
| 49 , m_run(constructTextRun(run, textLength, font, xPos)) | 49 , m_run(constructTextRun(run, textLength, font, xPos)) |
| 50 , m_controller(adoptPtr(new ComplexTextController(&m_font, m_run, true))
) | 50 , m_controller(adoptPtr(new ComplexTextController(&m_font, m_run, true))
) |
| 51 { | 51 { |
| 52 } | 52 } |
| 53 | 53 |
| 54 float width(unsigned from, unsigned len, HashSet<const SimpleFontData*>* fal
lbackFonts) | 54 float width(unsigned from, unsigned len, HashSet<const SimpleFontData*>* fal
lbackFonts) |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 | 718 |
| 719 lastCharacterIndex = characterIndex; | 719 lastCharacterIndex = characterIndex; |
| 720 } | 720 } |
| 721 if (!isMonotonic) | 721 if (!isMonotonic) |
| 722 complexTextRun.setIsNonMonotonic(); | 722 complexTextRun.setIsNonMonotonic(); |
| 723 } | 723 } |
| 724 m_totalWidth += widthSinceLastCommit; | 724 m_totalWidth += widthSinceLastCommit; |
| 725 } | 725 } |
| 726 | 726 |
| 727 } // namespace WebCore | 727 } // namespace WebCore |
| OLD | NEW |