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

Side by Side Diff: Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp

Issue 400543004: Rename WebCore namespace to blink in Platform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
OLDNEW
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 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "platform/fonts/harfbuzz/HarfBuzzFace.h" 32 #include "platform/fonts/harfbuzz/HarfBuzzFace.h"
33 33
34 #include "platform/fonts/FontPlatformData.h" 34 #include "platform/fonts/FontPlatformData.h"
35 #include "platform/fonts/SimpleFontData.h" 35 #include "platform/fonts/SimpleFontData.h"
36 #include "platform/fonts/harfbuzz/HarfBuzzShaper.h" 36 #include "platform/fonts/harfbuzz/HarfBuzzShaper.h"
37 37
38 #include <ApplicationServices/ApplicationServices.h> 38 #include <ApplicationServices/ApplicationServices.h>
39 #include "hb.h" 39 #include "hb.h"
40 40
41 namespace WebCore { 41 namespace blink {
42 42
43 static hb_position_t floatToHarfBuzzPosition(CGFloat value) 43 static hb_position_t floatToHarfBuzzPosition(CGFloat value)
44 { 44 {
45 return static_cast<hb_position_t>(value * (1 << 16)); 45 return static_cast<hb_position_t>(value * (1 << 16));
46 } 46 }
47 47
48 static hb_bool_t getGlyph(hb_font_t* hbFont, void* fontData, hb_codepoint_t unic ode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* userData) 48 static hb_bool_t getGlyph(hb_font_t* hbFont, void* fontData, hb_codepoint_t unic ode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* userData)
49 { 49 {
50 CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont(); 50 CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont();
51 UniChar characters[4]; 51 UniChar characters[4];
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 hb_font_t* font = hb_font_create(m_face); 134 hb_font_t* font = hb_font_create(m_face);
135 hb_font_set_funcs(font, harfBuzzCoreTextGetFontFuncs(), m_platformData, 0); 135 hb_font_set_funcs(font, harfBuzzCoreTextGetFontFuncs(), m_platformData, 0);
136 const float size = m_platformData->m_size; 136 const float size = m_platformData->m_size;
137 hb_font_set_ppem(font, size, size); 137 hb_font_set_ppem(font, size, size);
138 const int scale = (1 << 16) * static_cast<int>(size); 138 const int scale = (1 << 16) * static_cast<int>(size);
139 hb_font_set_scale(font, scale, scale); 139 hb_font_set_scale(font, scale, scale);
140 hb_font_make_immutable(font); 140 hb_font_make_immutable(font);
141 return font; 141 return font;
142 } 142 }
143 143
144 } // namespace WebCore 144 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp ('k') | Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698