Changeset 83805 in webkit
- Timestamp:
- Apr 13, 2011 7:13:31 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83804 r83805 1 2011-04-13 Cary Clark <caryclark@google.com> 2 3 Reviewed by Eric Seidel. 4 5 Allow CG Font support in Chrome Darwin build using Skia 6 https://bugs.webkit.org/show_bug.cgi?id=58321 7 8 This allows Chrome to use Skia to do WebKit rendering, while 9 using CoreGraphics for glyph creation and computing font metrics. 10 It relies on an undefined platform token, WTF_USE_SKIA_ON_MAC_CHROME. 11 12 No new tests needed, no functionality change. 13 14 * loader/cache/CachedFont.cpp: Make CGFontRef functions and 15 CG-specific font code available to Chrome builds on Darwin using Skia. 16 * platform/graphics/FontPlatformData.h: Ditto. 17 (WebCore::FontPlatformData::hash): Ditto. 18 * platform/graphics/GlyphBuffer.h: Ditto. 19 (WebCore::GlyphBuffer::advanceAt): Ditto. 20 (WebCore::GlyphBuffer::add): Ditto. 21 (WebCore::GlyphBuffer::expandLastAdvance): Ditto. 22 * platform/graphics/SimpleFontData.h: Ditto. 23 1 24 2011-04-13 Alexis Menard <alexis.menard@openbossa.org> 2 25 -
trunk/Source/WebCore/loader/cache/CachedFont.cpp
r80582 r83805 28 28 #include "CachedFont.h" 29 29 30 #if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(FREEBSD))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID) || PLATFORM(BREWMP) 30 // FIXME: This should really be a blacklist instead of a whitelist 31 #if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) || USE(SKIA_MAC_ON_CHROME))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID) || PLATFORM(BREWMP) 31 32 #define STORE_FONT_CUSTOM_PLATFORM_DATA 32 33 #endif -
trunk/Source/WebCore/platform/graphics/FontPlatformData.h
r82314 r83805 85 85 #endif 86 86 87 #if PLATFORM(CG) 87 #if PLATFORM(CG) || USE(SKIA_ON_MAC_CHROME) 88 88 typedef struct CGFont* CGFontRef; 89 89 #if OS(DARWIN) … … 180 180 FontPlatformData(NSFont*, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal, 181 181 TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth); 182 #if PLATFORM(CG) || USE(SKIA_ON_MAC_CHROME) 182 183 FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, 183 184 TextOrientation textOrientation, FontWidthVariant widthVariant) … … 194 195 } 195 196 #endif 197 #endif 196 198 #if PLATFORM(WIN) 197 199 FontPlatformData(HFONT, float size, bool syntheticBold, bool syntheticOblique, bool useGDI); … … 214 216 #endif 215 217 216 #if PLATFORM(CG) 218 #if PLATFORM(CG) || USE(SKIA_ON_MAC_CHROME) 217 219 #if OS(DARWIN) 218 220 #ifndef BUILDING_ON_TIGER … … 251 253 return m_font ? m_font->hash() : 0; 252 254 #elif OS(DARWIN) 255 #if PLATFORM(CG) || USE(SKIA_ON_MAC_CHROME) 253 256 ASSERT(m_font || !m_cgFont); 257 #endif 254 258 uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, m_textOrientation << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique }; 255 259 return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes); … … 325 329 #endif 326 330 327 #if PLATFORM(CG) 331 #if PLATFORM(CG) || USE(SKIA_ON_MAC_CHROME) 328 332 #if PLATFORM(WIN) 329 333 RetainPtr<CGFontRef> m_cgFont; -
trunk/Source/WebCore/platform/graphics/GlyphBuffer.h
r76743 r83805 35 35 #include <wtf/Vector.h> 36 36 37 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) 37 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROME) 38 38 #include <ApplicationServices/ApplicationServices.h> 39 39 #endif … … 59 59 // CG uses CGSize instead of FloatSize so that the result of advances() 60 60 // can be passed directly to CGContextShowGlyphsWithAdvances in FontMac.mm 61 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) 61 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROME) 62 62 typedef CGSize GlyphBufferAdvance; 63 63 #elif OS(WINCE) … … 123 123 float advanceAt(int index) const 124 124 { 125 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) 125 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROME) 126 126 return m_advances[index].width; 127 127 #elif OS(WINCE) … … 154 154 #endif 155 155 156 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) 156 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROME) 157 157 CGSize advance = { width, 0 }; 158 158 m_advances.append(advance); … … 193 193 ASSERT(!isEmpty()); 194 194 GlyphBufferAdvance& lastAdvance = m_advances.last(); 195 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) 195 #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) || USE(SKIA_ON_MAC_CHROME) 196 196 lastAdvance.width += width; 197 197 #elif OS(WINCE) -
trunk/Source/WebCore/platform/graphics/SimpleFontData.h
r80582 r83805 116 116 float spaceWidth() const { return m_spaceWidth; } 117 117 118 #if PLATFORM(CG) || PLATFORM(CAIRO) || PLATFORM(WX) 118 #if PLATFORM(CG) || PLATFORM(CAIRO) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROME) 119 119 float syntheticBoldOffset() const { return m_syntheticBoldOffset; } 120 120 #endif … … 253 253 mutable OwnPtr<DerivedFontData> m_derivedFontData; 254 254 255 #if PLATFORM(CG) || PLATFORM(CAIRO) || PLATFORM(WX) 255 #if PLATFORM(CG) || PLATFORM(CAIRO) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROME) 256 256 float m_syntheticBoldOffset; 257 257 #endif
Note: See TracChangeset
for help on using the changeset viewer.