| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 Google Inc. All rights reserved. | 2 * Copyright (c) 2015 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "platform/fonts/GlyphBuffer.h" | 34 #include "platform/fonts/GlyphBuffer.h" |
| 35 #include "platform/fonts/GlyphPage.h" | 35 #include "platform/fonts/GlyphPage.h" |
| 36 #include "platform/text/TextRun.h" | 36 #include "platform/text/TextRun.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 Shaper::Shaper(const Font* font, const TextRun& run, const GlyphData* emphasisDa
ta, | 40 Shaper::Shaper(const Font* font, const TextRun& run, const GlyphData* emphasisDa
ta, |
| 41 HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* bounds) | 41 HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* bounds) |
| 42 : m_font(font) | 42 : m_font(font) |
| 43 , m_run(run) | 43 , m_textRun(run) |
| 44 , m_fallbackFonts(fallbackFonts) | 44 , m_fallbackFonts(fallbackFonts) |
| 45 , m_glyphBoundingBox(bounds) | 45 , m_glyphBoundingBox(bounds) |
| 46 , m_expansion(0) | 46 , m_expansion(0) |
| 47 , m_expansionPerOpportunity(0) | 47 , m_expansionPerOpportunity(0) |
| 48 , m_isAfterExpansion(!run.allowsLeadingExpansion()) | 48 , m_isAfterExpansion(!run.allowsLeadingExpansion()) |
| 49 , m_emphasisSubstitutionData(emphasisData) | 49 , m_emphasisSubstitutionData(emphasisData) |
| 50 { | 50 { |
| 51 if (emphasisData) { | 51 if (emphasisData) { |
| 52 ASSERT(emphasisData->fontData); | 52 ASSERT(emphasisData->fontData); |
| 53 m_emphasisGlyphCenter = emphasisData->fontData->boundsForGlyph(emphasisD
ata->glyph).center(); | 53 m_emphasisGlyphCenter = emphasisData->fontData->boundsForGlyph(emphasisD
ata->glyph).center(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 68 if (!isVertical) { | 68 if (!isVertical) { |
| 69 buffer->add(m_emphasisSubstitutionData->glyph, emphasisFontData, | 69 buffer->add(m_emphasisSubstitutionData->glyph, emphasisFontData, |
| 70 midGlyphOffset - m_emphasisGlyphCenter.x()); | 70 midGlyphOffset - m_emphasisGlyphCenter.x()); |
| 71 } else { | 71 } else { |
| 72 buffer->add(m_emphasisSubstitutionData->glyph, emphasisFontData, | 72 buffer->add(m_emphasisSubstitutionData->glyph, emphasisFontData, |
| 73 FloatPoint(-m_emphasisGlyphCenter.x(), midGlyphOffset - m_emphasisGl
yphCenter.y())); | 73 FloatPoint(-m_emphasisGlyphCenter.x(), midGlyphOffset - m_emphasisGl
yphCenter.y())); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |