Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: Source/platform/fonts/GlyphBuffer.h

Issue 180893004: Adjust both x and y position when drawing glyphs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/mac fix Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/WidthIterator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2007-2008 Torch Mobile Inc. 3 * Copyright (C) 2007-2008 Torch Mobile Inc.
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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 const GlyphBufferGlyph* glyphs(unsigned from) const { return m_glyphs.data() + from; } 79 const GlyphBufferGlyph* glyphs(unsigned from) const { return m_glyphs.data() + from; }
80 const GlyphBufferAdvance* advances(unsigned from) const { return m_advances. data() + from; } 80 const GlyphBufferAdvance* advances(unsigned from) const { return m_advances. data() + from; }
81 81
82 const SimpleFontData* fontDataAt(unsigned index) const { return m_fontData[i ndex]; } 82 const SimpleFontData* fontDataAt(unsigned index) const { return m_fontData[i ndex]; }
83 83
84 Glyph glyphAt(unsigned index) const 84 Glyph glyphAt(unsigned index) const
85 { 85 {
86 return m_glyphs[index]; 86 return m_glyphs[index];
87 } 87 }
88 88
89 float advanceAt(unsigned index) const 89 FloatSize advanceAt(unsigned index) const
90 { 90 {
91 return m_advances[index].width(); 91 #if OS(MACOSX)
92 return FloatSize(m_advances[index]);
93 #else
94 return m_advances[index];
95 #endif
92 } 96 }
93 97
94 void add(Glyph glyph, const SimpleFontData* font, float width) 98 void add(Glyph glyph, const SimpleFontData* font, float width)
95 { 99 {
96 m_fontData.append(font); 100 m_fontData.append(font);
97 m_glyphs.append(glyph); 101 m_glyphs.append(glyph);
98 102
99 #if OS(MACOSX) 103 #if OS(MACOSX)
100 CGSize advance = { width, 0 }; 104 CGSize advance = { width, 0 };
101 m_advances.append(advance); 105 m_advances.append(advance);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 m_advances[index2] = s; 144 m_advances[index2] = s;
141 } 145 }
142 146
143 Vector<const SimpleFontData*, 2048> m_fontData; 147 Vector<const SimpleFontData*, 2048> m_fontData;
144 Vector<GlyphBufferGlyph, 2048> m_glyphs; 148 Vector<GlyphBufferGlyph, 2048> m_glyphs;
145 Vector<GlyphBufferAdvance, 2048> m_advances; 149 Vector<GlyphBufferAdvance, 2048> m_advances;
146 }; 150 };
147 151
148 } 152 }
149 #endif 153 #endif
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/WidthIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698