Changeset 166633 in webkit
- Timestamp:
- Apr 2, 2014 12:05:14 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r166622 r166633 1948 1948 platform/graphics/filters/SourceGraphic.cpp 1949 1949 platform/graphics/filters/SpotLightSource.cpp 1950 1951 platform/graphics/opentype/OpenTypeMathData.cpp 1950 1952 1951 1953 platform/graphics/texmap/TextureMapper.cpp -
trunk/Source/WebCore/ChangeLog
r166632 r166633 1 2014-04-02 Frédéric Wang <fred.wang@free.fr> 2 3 Operator stretching: expose a math data API 4 https://bugs.webkit.org/show_bug.cgi?id=130572 5 6 Reviewed by Chris Fleizach. 7 8 We expose a new SimpleFontData API to give access to the data from the 9 OpenType MATH table. The class OpenTypeMathData will 10 be implemented in bug 130324. On Darwin platform, we also implement the 11 missing FontPlatformData::openTypeTable function which will be necessary 12 to load the OpenType MATH table. The changes are intended to be used 13 for MathML operator stretching (bug 130322) so tests are not added yet. 14 15 * CMakeLists.txt: add new OpenTypeMathData files. 16 * WebCore.vcxproj/WebCore.vcxproj: ditto. 17 * WebCore.vcxproj/WebCore.vcxproj.filters: ditto. 18 * WebCore.xcodeproj/project.pbxproj: ditto. 19 * platform/graphics/FontPlatformData.cpp: 20 (WebCore::FontPlatformData::openTypeTable): We implement openTypeTable() on Darwin platform. 21 * platform/graphics/FontPlatformData.h: We expose openTypeTable() on Darwin platform. 22 * platform/graphics/SimpleFontData.cpp: 23 (WebCore::SimpleFontData::SimpleFontData): 24 (WebCore::SimpleFontData::mathData): Initialize and return the math data. 25 * platform/graphics/SimpleFontData.h: We expose a mathData() function to access the MATH data. 26 * platform/graphics/opentype/OpenTypeMathData.cpp: Added. This is a new class that will be used to parse the data from the OpenType MATH table. 27 (WebCore::OpenTypeMathData::OpenTypeMathData): 28 * platform/graphics/opentype/OpenTypeMathData.h: Added. 29 (WebCore::OpenTypeMathData::create): 30 (WebCore::OpenTypeMathData::hasMathData): 31 1 32 2014-04-01 Mihnea Ovidenie <mihnea@adobe.com> 2 33 -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r166622 r166633 7990 7990 <ClCompile Include="..\platform\graphics\win\IntSizeWin.cpp" /> 7991 7991 <ClCompile Include="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.cpp" /> 7992 <ClCompile Include="..\platform\graphics\opentype\OpenTypeMathData.cpp" /> 7992 7993 <ClCompile Include="..\platform\graphics\opentype\OpenTypeUtilities.cpp" /> 7993 7994 <ClCompile Include="..\platform\graphics\opentype\OpenTypeVerticalData.cpp" /> … … 19407 19408 <ClInclude Include="..\platform\graphics\win\LocalWindowsContext.h" /> 19408 19409 <CustomBuildStep Include="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.h" /> 19410 <ClInclude Include="..\platform\graphics\opentype\OpenTypeMathData.h" /> 19409 19411 <ClInclude Include="..\platform\graphics\opentype\OpenTypeTypes.h" /> 19410 19412 <ClInclude Include="..\platform\graphics\opentype\OpenTypeUtilities.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r166622 r166633 1483 1483 <Filter>platform\graphics\win</Filter> 1484 1484 </ClCompile> 1485 <ClCompile Include="..\platform\graphics\opentype\OpenTypeMathData.cpp"> 1486 <Filter>platform\graphics\win</Filter> 1487 </ClCompile> 1485 1488 <ClCompile Include="..\platform\graphics\opentype\OpenTypeUtilities.cpp"> 1486 1489 <Filter>platform\graphics\win</Filter> … … 8448 8451 </ClInclude> 8449 8452 <ClInclude Include="..\platform\graphics\win\LocalWindowsContext.h"> 8453 <Filter>platform\graphics\win</Filter> 8454 </ClInclude> 8455 <ClInclude Include="..\platform\graphics\opentype\OpenTypeMathData.h"> 8450 8456 <Filter>platform\graphics\win</Filter> 8451 8457 </ClInclude> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r166622 r166633 4595 4595 B2C3DA640D006CD600EF6F26 /* SimpleFontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA530D006CD600EF6F26 /* SimpleFontData.cpp */; }; 4596 4596 B2C3DA650D006CD600EF6F26 /* SimpleFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA540D006CD600EF6F26 /* SimpleFontData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4597 B2D3DA640D006CD600EF6F27 /* OpenTypeMathData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2D3DA530D006CD600EF6F27 /* OpenTypeMathData.cpp */; }; 4598 B2D3DA650D006CD600EF6F27 /* OpenTypeMathData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3DA540D006CD600EF6F27 /* OpenTypeMathData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4597 4599 B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA550D006CD600EF6F26 /* FontDescription.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4598 4600 B2C3DA670D006CD600EF6F26 /* FontGlyphs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA560D006CD600EF6F26 /* FontGlyphs.cpp */; }; … … 11849 11851 B2C3DA530D006CD600EF6F26 /* SimpleFontData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleFontData.cpp; sourceTree = "<group>"; }; 11850 11852 B2C3DA540D006CD600EF6F26 /* SimpleFontData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SimpleFontData.h; sourceTree = "<group>"; }; 11853 B2D3DA530D006CD600EF6F27 /* OpenTypeMathData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = opentype/OpenTypeMathData.cpp; sourceTree = "<group>"; }; 11854 B2D3DA540D006CD600EF6F27 /* OpenTypeMathData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = opentype/OpenTypeMathData.h; sourceTree = "<group>"; }; 11851 11855 B2C3DA550D006CD600EF6F26 /* FontDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontDescription.h; sourceTree = "<group>"; }; 11852 11856 B2C3DA560D006CD600EF6F26 /* FontGlyphs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontGlyphs.cpp; sourceTree = "<group>"; }; … … 20141 20145 B2C3DA530D006CD600EF6F26 /* SimpleFontData.cpp */, 20142 20146 B2C3DA540D006CD600EF6F26 /* SimpleFontData.h */, 20147 B2D3DA530D006CD600EF6F27 /* OpenTypeMathData.cpp */, 20148 B2D3DA540D006CD600EF6F27 /* OpenTypeMathData.h */, 20143 20149 CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */, 20144 20150 CDC61DA0180867D8004B913F /* SourceBufferPrivate.h */, … … 25488 25494 41D168EE10226E89009BC827 /* SharedWorkerThread.h in Headers */, 25489 25495 B2C3DA650D006CD600EF6F26 /* SimpleFontData.h in Headers */, 25496 B2D3DA650D006CD600EF6F27 /* OpenTypeMathData.h in Headers */, 25490 25497 E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */, 25491 25498 E4E9B11D1814569C003ACCDF /* SimpleLineLayoutFunctions.h in Headers */, … … 28855 28862 41D168ED10226E89009BC827 /* SharedWorkerThread.cpp in Sources */, 28856 28863 B2C3DA640D006CD600EF6F26 /* SimpleFontData.cpp in Sources */, 28864 B2D3DA640D006CD600EF6F27 /* OpenTypeMathData.cpp in Sources */, 28857 28865 163E88F7118A39D200ED9231 /* SimpleFontDataCoreText.cpp in Sources */, 28858 28866 37E65950163B10C200EB4574 /* SimpleFontDataIOS.mm in Sources */, -
trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp
r166381 r166633 27 27 #include <wtf/text/StringHash.h> 28 28 #include <wtf/text/WTFString.h> 29 30 #if OS(DARWIN) && USE(CG) 31 #include "SharedBuffer.h" 32 #include <CoreGraphics/CGFont.h> 33 #endif 29 34 30 35 namespace WebCore { … … 170 175 } 171 176 177 #if OS(DARWIN) && USE(CG) 178 PassRefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const 179 { 180 if (CFDataRef data = CGFontCopyTableForTag(cgFont(), table)) 181 return SharedBuffer::wrapCFData(data); 182 183 return nullptr; 172 184 } 185 #endif 186 187 } -
trunk/Source/WebCore/platform/graphics/FontPlatformData.h
r166381 r166633 217 217 } 218 218 219 #if PLATFORM(WIN) && (USE(CG) || USE(CAIRO))219 #if (OS(DARWIN) && USE(CG)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO))) 220 220 PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const; 221 221 #endif -
trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp
r166381 r166633 33 33 #include "Font.h" 34 34 #include "FontCache.h" 35 #include "OpenTypeMathData.h" 35 36 #include <wtf/MathExtras.h> 36 37 … … 53 54 , m_isTextOrientationFallback(isTextOrientationFallback) 54 55 , m_isBrokenIdeographFallback(false) 56 , m_mathData(nullptr) 55 57 #if ENABLE(OPENTYPE_VERTICAL) 56 58 , m_verticalData(0) … … 77 79 , m_isTextOrientationFallback(false) 78 80 , m_isBrokenIdeographFallback(false) 81 , m_mathData(nullptr) 79 82 #if ENABLE(OPENTYPE_VERTICAL) 80 83 , m_verticalData(0) … … 256 259 } 257 260 #endif 261 262 const OpenTypeMathData* SimpleFontData::mathData() const 263 { 264 if (!m_mathData) { 265 m_mathData = OpenTypeMathData::create(m_platformData); 266 if (!m_mathData->hasMathData()) 267 m_mathData.clear(); 268 } 269 return m_mathData.get(); 270 } 258 271 259 272 PassOwnPtr<SimpleFontData::DerivedFontData> SimpleFontData::DerivedFontData::create(bool forCustomFont) -
trunk/Source/WebCore/platform/graphics/SimpleFontData.h
r166381 r166633 33 33 #include "GlyphMetricsMap.h" 34 34 #include "GlyphPageTreeNode.h" 35 #include "OpenTypeMathData.h" 35 36 #if ENABLE(OPENTYPE_VERTICAL) 36 37 #include "OpenTypeVerticalData.h" … … 93 94 94 95 const FontPlatformData& platformData() const { return m_platformData; } 96 const OpenTypeMathData* mathData() const; 95 97 #if ENABLE(OPENTYPE_VERTICAL) 96 98 const OpenTypeVerticalData* verticalData() const { return m_verticalData.get(); } … … 260 262 bool m_isTextOrientationFallback; 261 263 bool m_isBrokenIdeographFallback; 264 mutable RefPtr<OpenTypeMathData> m_mathData; 262 265 #if ENABLE(OPENTYPE_VERTICAL) 263 266 RefPtr<OpenTypeVerticalData> m_verticalData;
Note: See TracChangeset
for help on using the changeset viewer.