Changeset 123181 in webkit


Ignore:
Timestamp:
Jul 19, 2012, 11:01:10 PM (12 years ago)
Author:
mitz@apple.com
Message:

The ATSUI-based complex text code is unused
https://bugs.webkit.org/show_bug.cgi?id=91816

Reviewed by Sam Weinig.

../WebCore:

  • WebCore.gypi: Removed references to the files deleted in this change.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • platform/graphics/FontCache.h:
(FontCache): Replaced USE(CORE_TEXT) with PLATFORM(MAC)
PLATFORM(CHROMIUM) && OS(DARWIN).
  • platform/graphics/SimpleFontData.h:

(SimpleFontData): Removed USE(ATSUI)-only code, replaced USE(CORE_TEXT) with
(PLATFORM(CHROMIUM) && OS(DARWIN)).

  • platform/graphics/mac/ComplexTextController.cpp: Removed USE(ATSUI)-only code. Moved

collectComplexTextRunsForCharacters() and the ComplexTextRun constructor out of this file.

  • platform/graphics/mac/ComplexTextController.h: Removed USE(ATSUI)-only code and removed

#if USE(CORE_TEXT) because anyone including this header is using Core Text.

  • platform/graphics/mac/ComplexTextControllerATSUI.cpp: Removed.
  • platform/graphics/mac/ComplexTextControllerCoreText.mm:

(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved from
ComplexTextController.cpp into this file and merged with createTextRunFromFontDataCoreText().
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Moved from
ComplexTextController.cpp into this file and merged with
collectComplexTextRunsForCharactersCoreText().

  • platform/graphics/mac/SimpleFontDataATSUI.mm: Removed.
  • platform/graphics/mac/SimpleFontDataMac.mm:

(WebCore::SimpleFontData::platformInit): Remove USE(ATSUI)-only code.
(WebCore::SimpleFontData::platformDestroy): Ditto.

  • platform/text/mac/ShapeArabic.c: Removed.
  • platform/text/mac/ShapeArabic.h: Removed.

../WTF:

Removed definitions of WTF_USE_ATSUI and WTF_USE_CORE_TEXT.

  • wtf/Platform.h:
Location:
trunk/Source
Files:
4 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r123175 r123181  
     12012-07-19  Dan Bernstein  <mitz@apple.com>
     2
     3        The ATSUI-based complex text code is unused
     4        https://bugs.webkit.org/show_bug.cgi?id=91816
     5
     6        Reviewed by Sam Weinig.
     7
     8        Removed definitions of WTF_USE_ATSUI and WTF_USE_CORE_TEXT.
     9
     10        * wtf/Platform.h:
     11
    1122012-07-19  Wei James  <james.wei@intel.com>
    213
  • trunk/Source/WTF/wtf/Platform.h

    r123161 r123181  
    467467#if OS(DARWIN)
    468468#define WTF_USE_SKIA 1
    469 #define WTF_USE_ATSUI 0
    470 #define WTF_USE_CORE_TEXT 1
    471469#define WTF_USE_ICCJPEG 1
    472470#define WTF_USE_QCMSLIB 1
     
    645643#if OS(DARWIN)
    646644#define WTF_USE_CF 1
    647 #define WTF_USE_CORE_TEXT 1
    648645#define ENABLE_WEB_ARCHIVE 1
    649646#endif
     
    998995#endif
    999996
    1000 #if PLATFORM(MAC)
    1001 /* Complex text framework */
    1002 #define WTF_USE_ATSUI 0
    1003 #define WTF_USE_CORE_TEXT 1
    1004 #endif
    1005 
    1006997/* Accelerated compositing */
    1007998#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO))
  • trunk/Source/WebCore/ChangeLog

    r123180 r123181  
     12012-07-19  Dan Bernstein  <mitz@apple.com>
     2
     3        The ATSUI-based complex text code is unused
     4        https://bugs.webkit.org/show_bug.cgi?id=91816
     5
     6        Reviewed by Sam Weinig.
     7
     8        * WebCore.gypi: Removed references to the files deleted in this change.
     9        * WebCore.xcodeproj/project.pbxproj: Ditto.
     10        * platform/graphics/FontCache.h:
     11        (FontCache): Replaced USE(CORE_TEXT) with PLATFORM(MAC) || PLATFORM(CHROMIUM) && OS(DARWIN).
     12        * platform/graphics/SimpleFontData.h:
     13        (SimpleFontData): Removed USE(ATSUI)-only code, replaced USE(CORE_TEXT) with
     14        (PLATFORM(CHROMIUM) && OS(DARWIN)).
     15        * platform/graphics/mac/ComplexTextController.cpp: Removed USE(ATSUI)-only code. Moved
     16        collectComplexTextRunsForCharacters() and the ComplexTextRun constructor out of this file.
     17        * platform/graphics/mac/ComplexTextController.h: Removed USE(ATSUI)-only code and removed
     18        #if USE(CORE_TEXT) because anyone including this header is using Core Text.
     19        * platform/graphics/mac/ComplexTextControllerATSUI.cpp: Removed.
     20        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
     21        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Moved from
     22        ComplexTextController.cpp into this file and merged with createTextRunFromFontDataCoreText().
     23        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Moved from
     24        ComplexTextController.cpp into this file and merged with
     25        collectComplexTextRunsForCharactersCoreText().
     26        * platform/graphics/mac/SimpleFontDataATSUI.mm: Removed.
     27        * platform/graphics/mac/SimpleFontDataMac.mm:
     28        (WebCore::SimpleFontData::platformInit): Remove USE(ATSUI)-only code.
     29        (WebCore::SimpleFontData::platformDestroy): Ditto.
     30        * platform/text/mac/ShapeArabic.c: Removed.
     31        * platform/text/mac/ShapeArabic.h: Removed.
     32
    1332012-07-19  Kent Tamura  <tkent@chromium.org>
    234
  • trunk/Source/WebCore/WebCore.gypi

    r123154 r123181  
    37893789            'platform/graphics/mac/ComplexTextController.cpp',
    37903790            'platform/graphics/mac/ComplexTextController.h',
    3791             'platform/graphics/mac/ComplexTextControllerATSUI.cpp',
    37923791            'platform/graphics/mac/ComplexTextControllerCoreText.mm',
    37933792            'platform/graphics/mac/FloatPointMac.mm',
     
    38093808            'platform/graphics/mac/MediaPlayerPrivateQTKit.h',
    38103809            'platform/graphics/mac/MediaPlayerPrivateQTKit.mm',
    3811             'platform/graphics/mac/SimpleFontDataATSUI.mm',
    38123810            'platform/graphics/mac/SimpleFontDataCoreText.cpp',
    38133811            'platform/graphics/mac/SimpleFontDataMac.mm',
     
    44464444            'platform/text/mac/LocalizedDateMac.cpp',
    44474445            'platform/text/mac/LocalizedNumberMac.mm',
    4448             'platform/text/mac/ShapeArabic.c',
    4449             'platform/text/mac/ShapeArabic.h',
    44504446            'platform/text/mac/StringImplMac.mm',
    44514447            'platform/text/mac/StringMac.mm',
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r122824 r123181  
    352352                15D17D22147231EB005EBCA6 /* InspectorFileSystemAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 15D17D1F147231EB005EBCA6 /* InspectorFileSystemAgent.h */; };
    353353                163E88F7118A39D200ED9231 /* SimpleFontDataCoreText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 163E88F5118A39D200ED9231 /* SimpleFontDataCoreText.cpp */; };
    354                 163E8B13118B3ADD00ED9231 /* SimpleFontDataATSUI.mm in Sources */ = {isa = PBXBuildFile; fileRef = 163E8B12118B3ADD00ED9231 /* SimpleFontDataATSUI.mm */; };
    355354                185BCF280F3279CE000EA262 /* ThreadTimers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 185BCF260F3279CE000EA262 /* ThreadTimers.cpp */; };
    356355                185BCF290F3279CE000EA262 /* ThreadTimers.h in Headers */ = {isa = PBXBuildFile; fileRef = 185BCF270F3279CE000EA262 /* ThreadTimers.h */; };
     
    993992                37C236101097EE7700EF9F72 /* ComplexTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */; };
    994993                37C236111097EE7700EF9F72 /* ComplexTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C2360F1097EE7700EF9F72 /* ComplexTextController.h */; };
    995                 37C238211098C84200EF9F72 /* ComplexTextControllerATSUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C2381F1098C84200EF9F72 /* ComplexTextControllerATSUI.cpp */; };
    996994                37C238221098C84200EF9F72 /* ComplexTextControllerCoreText.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37C238201098C84200EF9F72 /* ComplexTextControllerCoreText.mm */; };
    997995                37C28A6810F659CC008C7813 /* TypesettingFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C28A6710F659CC008C7813 /* TypesettingFeatures.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    48644862                B2AFFC800D00A5C10030074D /* FontMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC780D00A5C10030074D /* FontMac.mm */; };
    48654863                B2AFFC830D00A5C10030074D /* GlyphPageTreeNodeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */; };
    4866                 B2AFFC930D00A5DF0030074D /* ShapeArabic.c in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC880D00A5DF0030074D /* ShapeArabic.c */; };
    4867                 B2AFFC940D00A5DF0030074D /* ShapeArabic.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AFFC890D00A5DF0030074D /* ShapeArabic.h */; };
    48684864                B2AFFC950D00A5DF0030074D /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8A0D00A5DF0030074D /* StringImplMac.mm */; };
    48694865                B2AFFC960D00A5DF0030074D /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8B0D00A5DF0030074D /* StringMac.mm */; };
     
    73367332                15D17D1F147231EB005EBCA6 /* InspectorFileSystemAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFileSystemAgent.h; sourceTree = "<group>"; };
    73377333                163E88F5118A39D200ED9231 /* SimpleFontDataCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleFontDataCoreText.cpp; sourceTree = "<group>"; };
    7338                 163E8B12118B3ADD00ED9231 /* SimpleFontDataATSUI.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleFontDataATSUI.mm; sourceTree = "<group>"; };
    73397334                185BCF260F3279CE000EA262 /* ThreadTimers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadTimers.cpp; sourceTree = "<group>"; };
    73407335                185BCF270F3279CE000EA262 /* ThreadTimers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadTimers.h; sourceTree = "<group>"; };
     
    80358030                37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexTextController.cpp; sourceTree = "<group>"; };
    80368031                37C2360F1097EE7700EF9F72 /* ComplexTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComplexTextController.h; sourceTree = "<group>"; };
    8037                 37C2381F1098C84200EF9F72 /* ComplexTextControllerATSUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexTextControllerATSUI.cpp; sourceTree = "<group>"; };
    80388032                37C238201098C84200EF9F72 /* ComplexTextControllerCoreText.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ComplexTextControllerCoreText.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
    80398033                37C28A6710F659CC008C7813 /* TypesettingFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypesettingFeatures.h; sourceTree = "<group>"; };
     
    1206212056                B2AFFC860D00A5DF0030074D /* mac-encodings.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "mac-encodings.txt"; sourceTree = "<group>"; };
    1206312057                B2AFFC870D00A5DF0030074D /* make-charset-table.pl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.perl; path = "make-charset-table.pl"; sourceTree = "<group>"; };
    12064                 B2AFFC880D00A5DF0030074D /* ShapeArabic.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ShapeArabic.c; sourceTree = "<group>"; };
    12065                 B2AFFC890D00A5DF0030074D /* ShapeArabic.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShapeArabic.h; sourceTree = "<group>"; };
    1206612058                B2AFFC8A0D00A5DF0030074D /* StringImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = StringImplMac.mm; sourceTree = "<group>"; };
    1206712059                B2AFFC8B0D00A5DF0030074D /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = StringMac.mm; sourceTree = "<group>"; };
     
    1957519567                                37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */,
    1957619568                                37C2360F1097EE7700EF9F72 /* ComplexTextController.h */,
    19577                                 37C2381F1098C84200EF9F72 /* ComplexTextControllerATSUI.cpp */,
    1957819569                                37C238201098C84200EF9F72 /* ComplexTextControllerCoreText.mm */,
    1957919570                                49AF2D6B14435D210016A784 /* DisplayRefreshMonitorMac.cpp */,
     
    1959719588                                E4B41E110CBF90EF00AF2ECE /* MediaPlayerPrivateQTKit.mm */,
    1959819589                                0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */,
    19599                                 163E8B12118B3ADD00ED9231 /* SimpleFontDataATSUI.mm */,
    1960019590                                163E88F5118A39D200ED9231 /* SimpleFontDataCoreText.cpp */,
    1960119591                                B2AFFC770D00A5C10030074D /* SimpleFontDataMac.mm */,
     
    1984819838                                B2AFFC860D00A5DF0030074D /* mac-encodings.txt */,
    1984919839                                B2AFFC870D00A5DF0030074D /* make-charset-table.pl */,
    19850                                 B2AFFC880D00A5DF0030074D /* ShapeArabic.c */,
    19851                                 B2AFFC890D00A5DF0030074D /* ShapeArabic.h */,
    1985219840                                B2AFFC8A0D00A5DF0030074D /* StringImplMac.mm */,
    1985319841                                B2AFFC8B0D00A5DF0030074D /* StringMac.mm */,
     
    2461024598                                A6D169641346B4C1000EB770 /* ShadowRoot.h in Headers */,
    2461124599                                A80E6CE80A1989CA007FB8C5 /* ShadowValue.h in Headers */,
    24612                                 B2AFFC940D00A5DF0030074D /* ShapeArabic.h in Headers */,
    2461324600                                1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */,
    2461424601                                97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */,
     
    2576225749                                6550B6A1099DF0270090D781 /* Comment.cpp in Sources */,
    2576325750                                37C236101097EE7700EF9F72 /* ComplexTextController.cpp in Sources */,
    25764                                 37C238211098C84200EF9F72 /* ComplexTextControllerATSUI.cpp in Sources */,
    2576525751                                37C238221098C84200EF9F72 /* ComplexTextControllerCoreText.mm in Sources */,
    2576625752                                4A6A0C5B15232F2400B09C6E /* ComposedShadowTreeWalker.cpp in Sources */,
     
    2779227778                                A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */,
    2779327779                                A80E6CF40A1989CA007FB8C5 /* ShadowValue.cpp in Sources */,
    27794                                 B2AFFC930D00A5DF0030074D /* ShapeArabic.c in Sources */,
    2779527780                                1A4A954D0B4EDCCB002D8C3C /* SharedBuffer.cpp in Sources */,
    2779627781                                512DD8E30D91E2B4000F89EE /* SharedBufferCF.cpp in Sources */,
     
    2780227787                                41D168ED10226E89009BC827 /* SharedWorkerThread.cpp in Sources */,
    2780327788                                B2C3DA640D006CD600EF6F26 /* SimpleFontData.cpp in Sources */,
    27804                                 163E8B13118B3ADD00ED9231 /* SimpleFontDataATSUI.mm in Sources */,
    2780527789                                163E88F7118A39D200ED9231 /* SimpleFontDataCoreText.cpp in Sources */,
    2780627790                                B2AFFC7F0D00A5C10030074D /* SimpleFontDataMac.mm in Sources */,
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r115373 r123181  
    131131    int m_purgePreventCount;
    132132
    133 #if USE(CORE_TEXT) || OS(ANDROID)
     133#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || OS(ANDROID)
    134134    friend class ComplexTextController;
    135135#endif
  • trunk/Source/WebCore/platform/graphics/SimpleFontData.h

    r116238 r123181  
    3737#include <wtf/text/StringHash.h>
    3838
    39 #if USE(ATSUI)
    40 typedef struct OpaqueATSUStyle* ATSUStyle;
    41 #endif
    42 
    43 #if PLATFORM(MAC) || USE(CORE_TEXT)
     39#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    4440#include <wtf/RetainPtr.h>
    4541#endif
     
    177173#endif
    178174
    179 #if PLATFORM(MAC) || USE(CORE_TEXT)
     175#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    180176    CFDictionaryRef getCFStringAttributes(TypesettingFeatures, FontOrientation) const;
    181 #endif
    182 
    183 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    184177    bool canRenderCombiningCharacterSequence(const UChar*, size_t) const;
    185 #endif
    186 
    187 #if USE(ATSUI)
    188     void checkShapesArabic() const;
    189     bool shapesArabic() const
    190     {
    191         if (!m_checkedShapesArabic)
    192             checkShapesArabic();
    193         return m_shapesArabic;
    194     }
    195178#endif
    196179
     
    291274#endif
    292275
    293 
    294 #if USE(ATSUI)
    295 public:
    296     mutable HashMap<unsigned, ATSUStyle> m_ATSUStyleMap;
    297     mutable bool m_ATSUMirrors;
    298     mutable bool m_checkedShapesArabic;
    299     mutable bool m_shapesArabic;
    300 
    301 private:
    302 #endif
    303 
    304 #if PLATFORM(MAC) || USE(CORE_TEXT)
     276#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    305277    mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes;
    306 #endif
    307 
    308 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    309278    mutable OwnPtr<HashMap<String, bool> > m_combiningCharacterSequenceSupport;
    310279#endif
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp

    r122674 r123181  
    3333#include <wtf/StdLibExtras.h>
    3434#include <wtf/unicode/CharacterNames.h>
    35 
    36 #if (PLATFORM(MAC) || PLATFORM(CHROMIUM)) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1050
    37 // Undefined when compiling agains the 10.5 SDK.
    38 #define kCTVersionNumber10_6 0x00030000
    39 #endif
    4035
    4136using namespace std;
     
    317312}
    318313
    319 #if USE(CORE_TEXT) && USE(ATSUI)
    320 static inline bool shouldUseATSUIAPI()
    321 {
    322     enum TypeRenderingAPIToUse { UnInitialized, UseATSUI, UseCoreText };
    323     static TypeRenderingAPIToUse apiToUse = UnInitialized;
    324 
    325     if (UNLIKELY(apiToUse == UnInitialized)) {
    326         if (&CTGetCoreTextVersion != 0 && CTGetCoreTextVersion() >= kCTVersionNumber10_6)
    327             apiToUse = UseCoreText;
    328         else
    329             apiToUse = UseATSUI;
    330     }
    331 
    332     return apiToUse == UseATSUI;
    333 }
    334 #endif
    335 
    336314CFIndex ComplexTextController::ComplexTextRun::indexAt(size_t i) const
    337315{
    338 #if USE(CORE_TEXT) && USE(ATSUI)
    339     return shouldUseATSUIAPI() ? m_atsuiIndices[i] : m_coreTextIndices[i];
    340 #elif USE(ATSUI)
    341     return m_atsuiIndices[i];
    342 #elif USE(CORE_TEXT)
    343316    return m_coreTextIndices[i];
    344 #endif
    345 }
    346 
    347 void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, unsigned length, unsigned stringLocation, const SimpleFontData* fontData)
    348 {
    349     if (!fontData) {
    350         // Create a run of missing glyphs from the primary font.
    351         m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont(), cp, stringLocation, length, m_run.ltr()));
    352         return;
    353     }
    354 
    355 #if USE(CORE_TEXT) && USE(ATSUI)
    356     if (shouldUseATSUIAPI())
    357         return collectComplexTextRunsForCharactersATSUI(cp, length, stringLocation, fontData);
    358     return collectComplexTextRunsForCharactersCoreText(cp, length, stringLocation, fontData);
    359 #elif USE(ATSUI)
    360     return collectComplexTextRunsForCharactersATSUI(cp, length, stringLocation, fontData);
    361 #elif USE(CORE_TEXT)
    362     return collectComplexTextRunsForCharactersCoreText(cp, length, stringLocation, fontData);
    363 #endif
    364 }
    365 
    366 ComplexTextController::ComplexTextRun::ComplexTextRun(const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)
    367     : m_fontData(fontData)
    368     , m_characters(characters)
    369     , m_stringLocation(stringLocation)
    370     , m_stringLength(stringLength)
    371     , m_indexEnd(stringLength)
    372     , m_isMonotonic(true)
    373 {
    374 #if USE(CORE_TEXT) && USE(ATSUI)
    375     shouldUseATSUIAPI() ? createTextRunFromFontDataATSUI(ltr) : createTextRunFromFontDataCoreText(ltr);
    376 #elif USE(ATSUI)
    377     createTextRunFromFontDataATSUI(ltr);
    378 #elif USE(CORE_TEXT)
    379     createTextRunFromFontDataCoreText(ltr);
    380 #endif
    381317}
    382318
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h

    r95391 r123181  
    3636typedef unsigned short CGGlyph;
    3737
    38 #if USE(CORE_TEXT)
    3938typedef const struct __CTRun * CTRunRef;
    4039typedef const struct __CTLine * CTLineRef;
    41 #endif
    42 #if USE(ATSUI)
    43 typedef struct OpaqueATSUTextLayout*    ATSUTextLayout;
    44 typedef struct ATSGlyphVector*          ATSULineRef;
    45 typedef UInt32 ATSULayoutOperationSelector;
    46 typedef UInt32 ATSULayoutOperationCallbackStatus;
    47 #endif
    4840
    4941namespace WebCore {
     
    5547// ComplexTextController is responsible for rendering and measuring glyphs for
    5648// complex scripts on OS X.
    57 // The underlying API can be selected at compile time based on USE(ATSUI) and
    58 // USE(CORE_TEXT).  If both are defined then the Core Text APIs are used for
    59 // OS Versions >= 10.6, ATSUI is used otherwise.
    6049class ComplexTextController {
    6150public:
     
    8574    class ComplexTextRun : public RefCounted<ComplexTextRun> {
    8675    public:
    87 #if USE(CORE_TEXT)
    8876        static PassRefPtr<ComplexTextRun> create(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange)
    8977        {
    9078            return adoptRef(new ComplexTextRun(ctRun, fontData, characters, stringLocation, stringLength, runRange));
    9179        }
    92 #endif
    93 #if USE(ATSUI)
    94         static PassRefPtr<ComplexTextRun> create(ATSUTextLayout atsuTextLayout, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr, bool directionalOverride)
    95         {
    96             return adoptRef(new ComplexTextRun(atsuTextLayout, fontData, characters, stringLocation, stringLength, ltr, directionalOverride));
    97         }
    98 #endif
     80
    9981        static PassRefPtr<ComplexTextRun> create(const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)
    10082        {
     
    11698
    11799    private:
    118 #if USE(CORE_TEXT)
    119100        ComplexTextRun(CTRunRef, const SimpleFontData*, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange);
    120         void createTextRunFromFontDataCoreText(bool ltr);
    121 #endif
    122 #if USE(ATSUI)
    123         ComplexTextRun(ATSUTextLayout, const SimpleFontData*, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr, bool directionalOverride);
    124         void createTextRunFromFontDataATSUI(bool ltr);
    125 #endif
    126101        ComplexTextRun(const SimpleFontData*, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr);
    127 
    128 #if USE(ATSUI)
    129         static OSStatus overrideLayoutOperation(ATSULayoutOperationSelector, ATSULineRef, URefCon, void*, ATSULayoutOperationCallbackStatus*);
    130 #endif
    131102
    132103        unsigned m_glyphCount;
     
    135106        unsigned m_stringLocation;
    136107        size_t m_stringLength;
    137 #if USE(CORE_TEXT)
    138108        Vector<CFIndex, 64> m_coreTextIndicesVector;
    139109        const CFIndex* m_coreTextIndices;
    140 #endif
    141 #if USE(ATSUI)
    142         Vector<CFIndex, 64> m_atsuiIndices;
    143 #endif
    144110        CFIndex m_indexEnd;
    145111        Vector<CFIndex, 64> m_glyphEndOffsets;
     
    148114        Vector<CGSize, 64> m_advancesVector;
    149115        const CGSize* m_advances;
    150 #if USE(ATSUI)
    151         bool m_directionalOverride;
    152 #endif
    153116        bool m_isMonotonic;
    154117    };
     
    156119    void collectComplexTextRuns();
    157120
    158     // collectComplexTextRunsForCharacters() is a stub function that calls through to the ATSUI or Core Text variants based
    159     // on the API in use.
    160121    void collectComplexTextRunsForCharacters(const UChar*, unsigned length, unsigned stringLocation, const SimpleFontData*);
    161     void collectComplexTextRunsForCharactersATSUI(const UChar*, unsigned length, unsigned stringLocation, const SimpleFontData*);
    162     void collectComplexTextRunsForCharactersCoreText(const UChar*, unsigned length, unsigned stringLocation, const SimpleFontData*);
    163122    void adjustGlyphsAndAdvances();
    164123
     
    170129    Vector<UChar, 256> m_smallCapsBuffer;
    171130
    172 #if USE(CORE_TEXT)
    173131    // Retain lines rather than their runs for better performance.
    174132    Vector<RetainPtr<CTLineRef> > m_coreTextLines;
    175 #endif
    176133    Vector<RefPtr<ComplexTextRun>, 16> m_complexTextRuns;
    177134    Vector<CGSize, 256> m_adjustedAdvances;
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm

    r122670 r123181  
    2525#include "config.h"
    2626
    27 #if USE(CORE_TEXT)
    28 
    2927#include "ComplexTextController.h"
    3028
     
    136134// Missing glyphs run constructor. Core Text will not generate a run of missing glyphs, instead falling back on
    137135// glyphs from LastResort. We want to use the primary font's missing glyph in order to match the fast text code path.
    138 void ComplexTextController::ComplexTextRun::createTextRunFromFontDataCoreText(bool ltr)
     136ComplexTextController::ComplexTextRun::ComplexTextRun(const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)
     137    : m_fontData(fontData)
     138    , m_characters(characters)
     139    , m_stringLocation(stringLocation)
     140    , m_stringLength(stringLength)
     141    , m_indexEnd(stringLength)
     142    , m_isMonotonic(true)
    139143{
    140144    m_coreTextIndicesVector.reserveInitialCapacity(m_stringLength);
     
    181185}
    182186
    183 void ComplexTextController::collectComplexTextRunsForCharactersCoreText(const UChar* cp, unsigned length, unsigned stringLocation, const SimpleFontData* fontData)
    184 {
    185     ASSERT_ARG(fontData, fontData);
     187void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, unsigned length, unsigned stringLocation, const SimpleFontData* fontData)
     188{
     189    if (!fontData) {
     190        // Create a run of missing glyphs from the primary font.
     191        m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont(), cp, stringLocation, length, m_run.ltr()));
     192        return;
     193    }
    186194
    187195    bool isSystemFallback = false;
     
    296304
    297305} // namespace WebCore
    298 
    299 #endif // USE(CORE_TEXT)
  • trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm

    r122670 r123181  
    143143void SimpleFontData::platformInit()
    144144{
    145 #if USE(ATSUI)
    146     m_ATSUMirrors = false;
    147     m_checkedShapesArabic = false;
    148     m_shapesArabic = false;
    149 #endif
    150 
    151145    m_syntheticBoldOffset = m_platformData.m_syntheticBold ? 1.0f : 0.f;
    152146
     
    320314            fontCache()->releaseFontData(m_derivedFontData->emphasisMark.leakPtr());
    321315    }
    322 
    323 #if USE(ATSUI)
    324     HashMap<unsigned, ATSUStyle>::iterator end = m_ATSUStyleMap.end();
    325     for (HashMap<unsigned, ATSUStyle>::iterator it = m_ATSUStyleMap.begin(); it != end; ++it)
    326         ATSUDisposeStyle(it->second);
    327 #endif
    328316}
    329317
Note: See TracChangeset for help on using the changeset viewer.