@@ -2032,7 +2032,7 @@ gfxFont::DrawEmphasisMarks(const gfxTextRun* aShapedText, gfxPoint* aPt,
20322032void
20332033gfxFont::Draw (const gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
20342034 gfxPoint *aPt, const TextRunDrawParams& aRunParams,
2035- uint16_t aOrientation)
2035+ gfx::ShapedTextFlags aOrientation)
20362036{
20372037 NS_ASSERTION (aRunParams.drawMode == DrawMode::GLYPH_PATH ||
20382038 !(int (aRunParams.drawMode) & int(DrawMode::GLYPH_PATH )),
@@ -2057,7 +2057,7 @@ gfxFont::Draw(const gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
20572057 fontParams.haveColorGlyphs = GetFontEntry ()->TryGetColorGlyphs ();
20582058 fontParams.contextPaint = aRunParams.runContextPaint ;
20592059 fontParams.isVerticalFont =
2060- aOrientation == gfxTextRunFactory ::TEXT_ORIENT_VERTICAL_UPRIGHT ;
2060+ aOrientation == gfx::ShapedTextFlags ::TEXT_ORIENT_VERTICAL_UPRIGHT ;
20612061
20622062 bool sideways = false ;
20632063 gfxPoint origPt = *aPt;
@@ -2071,7 +2071,7 @@ gfxFont::Draw(const gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
20712071 // with 90-degree CW rotation.
20722072 const gfxFloat
20732073 rotation = (aOrientation ==
2074- gfxTextRunFactory ::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT )
2074+ gfx::ShapedTextFlags ::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT )
20752075 ? -M_PI / 2.0 : M_PI / 2.0 ;
20762076 gfxMatrix mat =
20772077 aRunParams.context ->CurrentMatrix ().
@@ -2192,7 +2192,7 @@ gfxFont::Draw(const gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
21922192 // adjust updated aPt to account for the transform we were using
21932193 gfxFloat advance = aPt->x - origPt.x ;
21942194 if (aOrientation ==
2195- gfxTextRunFactory ::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT ) {
2195+ gfx::ShapedTextFlags ::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT ) {
21962196 *aPt = gfxPoint (origPt.x , origPt.y - advance);
21972197 } else {
21982198 *aPt = gfxPoint (origPt.x , origPt.y + advance);
@@ -2290,7 +2290,7 @@ UnionRange(gfxFloat aX, gfxFloat* aDestMin, gfxFloat* aDestMax)
22902290static bool
22912291NeedsGlyphExtents (gfxFont *aFont, const gfxTextRun *aTextRun)
22922292{
2293- return (aTextRun->GetFlags () & gfxTextRunFactory ::TEXT_NEED_BOUNDING_BOX ) ||
2293+ return (aTextRun->GetFlags () & gfx::ShapedTextFlags ::TEXT_NEED_BOUNDING_BOX ) ||
22942294 aFont->GetFontEntry ()->IsUserFont ();
22952295}
22962296
@@ -2318,7 +2318,7 @@ gfxFont::Measure(const gfxTextRun *aTextRun,
23182318 BoundingBoxType aBoundingBoxType,
23192319 DrawTarget* aRefDrawTarget,
23202320 Spacing *aSpacing,
2321- uint16_t aOrientation)
2321+ gfx::ShapedTextFlags aOrientation)
23222322{
23232323 // If aBoundingBoxType is TIGHT_HINTED_OUTLINE_EXTENTS
23242324 // and the underlying cairo font may be antialiased,
@@ -2341,7 +2341,7 @@ gfxFont::Measure(const gfxTextRun *aTextRun,
23412341 const int32_t appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit ();
23422342 // Current position in appunits
23432343 gfxFont::Orientation orientation =
2344- aOrientation == gfxTextRunFactory ::TEXT_ORIENT_VERTICAL_UPRIGHT
2344+ aOrientation == gfx::ShapedTextFlags ::TEXT_ORIENT_VERTICAL_UPRIGHT
23452345 ? eVertical : eHorizontal;
23462346 const gfxFont::Metrics& fontMetrics = GetMetrics (orientation);
23472347
@@ -2571,7 +2571,7 @@ gfxFont::GetShapedWord(DrawTarget *aDrawTarget,
25712571 Script aRunScript,
25722572 bool aVertical,
25732573 int32_t aAppUnitsPerDevUnit,
2574- uint16_t aFlags,
2574+ gfx::ShapedTextFlags aFlags,
25752575 RoundingFlags aRounding,
25762576 gfxTextPerfMetrics *aTextPerf GFX_MAYBE_UNUSED )
25772577{
@@ -2669,7 +2669,7 @@ gfxFont::CacheHashEntry::KeyEquals(const KeyTypePointer aKey) const
26692669 }
26702670 return true ;
26712671 }
2672- NS_ASSERTION ((aKey->mFlags & gfxTextRunFactory:: TEXT_IS_8BIT ) == 0 &&
2672+ NS_ASSERTION (! (aKey->mFlags & gfx::ShapedTextFlags:: TEXT_IS_8BIT ) &&
26732673 !aKey->mTextIs8Bit, "didn't expect 8-bit text here");
26742674 return (0 == memcmp (sw->TextUnicode (), aKey->mText .mDouble ,
26752675 aKey->mLength * sizeof (char16_t )));
@@ -2872,7 +2872,7 @@ gfxFont::ShapeTextWithoutWordCache(DrawTarget *aDrawTarget,
28722872 } else if (ch == ' \n ' ) {
28732873 aTextRun->SetIsNewline (aOffset + i);
28742874 } else if (IsInvalidControlChar (ch) &&
2875- !(aTextRun->GetFlags () & gfxTextRunFactory ::TEXT_HIDE_CONTROL_CHARACTERS )) {
2875+ !(aTextRun->GetFlags () & gfx::ShapedTextFlags ::TEXT_HIDE_CONTROL_CHARACTERS )) {
28762876 if (GetFontEntry ()->IsUserFont () && HasCharacter (ch)) {
28772877 ShapeFragmentWithoutWordCache (aDrawTarget, aText + i,
28782878 aOffset + i, 1 ,
@@ -2966,13 +2966,13 @@ gfxFont::SplitAndInitTextRun(DrawTarget *aDrawTarget,
29662966 InitWordCache ();
29672967
29682968 // the only flags we care about for ShapedWord construction/caching
2969- uint16_t flags = aTextRun->GetFlags ();
2970- flags &= (gfxTextRunFactory ::TEXT_IS_RTL |
2971- gfxTextRunFactory ::TEXT_DISABLE_OPTIONAL_LIGATURES |
2972- gfxTextRunFactory ::TEXT_USE_MATH_SCRIPT |
2973- gfxTextRunFactory ::TEXT_ORIENT_MASK );
2969+ gfx::ShapedTextFlags flags = aTextRun->GetFlags ();
2970+ flags &= (gfx::ShapedTextFlags ::TEXT_IS_RTL |
2971+ gfx::ShapedTextFlags ::TEXT_DISABLE_OPTIONAL_LIGATURES |
2972+ gfx::ShapedTextFlags ::TEXT_USE_MATH_SCRIPT |
2973+ gfx::ShapedTextFlags ::TEXT_ORIENT_MASK );
29742974 if (sizeof (T) == sizeof (uint8_t )) {
2975- flags |= gfxTextRunFactory ::TEXT_IS_8BIT ;
2975+ flags |= gfx::ShapedTextFlags ::TEXT_IS_8BIT ;
29762976 }
29772977
29782978 uint32_t wordStart = 0 ;
@@ -3018,13 +3018,13 @@ gfxFont::SplitAndInitTextRun(DrawTarget *aDrawTarget,
30183018 return false ;
30193019 }
30203020 } else if (length > 0 ) {
3021- uint16_t wordFlags = flags;
3021+ gfx::ShapedTextFlags wordFlags = flags;
30223022 // in the 8-bit version of this method, TEXT_IS_8BIT was
30233023 // already set as part of |flags|, so no need for a per-word
30243024 // adjustment here
30253025 if (sizeof (T) == sizeof (char16_t )) {
30263026 if (wordIs8Bit) {
3027- wordFlags |= gfxTextRunFactory ::TEXT_IS_8BIT ;
3027+ wordFlags |= gfx::ShapedTextFlags ::TEXT_IS_8BIT ;
30283028 }
30293029 }
30303030 gfxShapedWord* sw = GetShapedWord (aDrawTarget,
@@ -3041,11 +3041,12 @@ gfxFont::SplitAndInitTextRun(DrawTarget *aDrawTarget,
30413041
30423042 if (boundary) {
30433043 // word was terminated by a space: add that to the textrun
3044- uint16_t orientation = flags & gfxTextRunFactory::TEXT_ORIENT_MASK ;
3045- if (orientation == gfxTextRunFactory::TEXT_ORIENT_VERTICAL_MIXED ) {
3044+ gfx::ShapedTextFlags orientation =
3045+ flags & gfx::ShapedTextFlags::TEXT_ORIENT_MASK ;
3046+ if (orientation == gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_MIXED ) {
30463047 orientation = aVertical ?
3047- gfxTextRunFactory ::TEXT_ORIENT_VERTICAL_UPRIGHT :
3048- gfxTextRunFactory ::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT ;
3048+ gfx::ShapedTextFlags ::TEXT_ORIENT_VERTICAL_UPRIGHT :
3049+ gfx::ShapedTextFlags ::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT ;
30493050 }
30503051 if (boundary != ' ' ||
30513052 !aTextRun->SetSpaceGlyphIfSimple (this , aRunStart + i, ch,
@@ -3061,7 +3062,7 @@ gfxFont::SplitAndInitTextRun(DrawTarget *aDrawTarget,
30613062 GetShapedWord (aDrawTarget, &boundary, 1 ,
30623063 gfxShapedWord::HashMix (0 , boundary),
30633064 aRunScript, aVertical, appUnitsPerDevUnit,
3064- flags | gfxTextRunFactory ::TEXT_IS_8BIT ,
3065+ flags | gfx::ShapedTextFlags ::TEXT_IS_8BIT ,
30653066 rounding, tp);
30663067 if (sw) {
30673068 aTextRun->CopyGlyphDataFrom (sw, aRunStart + i);
@@ -3090,7 +3091,7 @@ gfxFont::SplitAndInitTextRun(DrawTarget *aDrawTarget,
30903091 } else if (ch == ' \n ' ) {
30913092 aTextRun->SetIsNewline (aRunStart + i);
30923093 } else if (IsInvalidControlChar (ch) &&
3093- !(aTextRun->GetFlags () & gfxTextRunFactory ::TEXT_HIDE_CONTROL_CHARACTERS )) {
3094+ !(aTextRun->GetFlags () & gfx::ShapedTextFlags ::TEXT_HIDE_CONTROL_CHARACTERS )) {
30943095 if (GetFontEntry ()->IsUserFont () && HasCharacter (ch)) {
30953096 ShapeFragmentWithoutWordCache (aDrawTarget, aString + i,
30963097 aRunStart + i, 1 ,
@@ -3135,7 +3136,7 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget,
31353136 uint32_t aOffset,
31363137 uint32_t aLength,
31373138 uint8_t aMatchType,
3138- uint16_t aOrientation,
3139+ gfx::ShapedTextFlags aOrientation,
31393140 Script aScript,
31403141 bool aSyntheticLower,
31413142 bool aSyntheticUpper)
@@ -3157,7 +3158,7 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget,
31573158 RunCaseAction runAction = kNoChange ;
31583159 uint32_t runStart = 0 ;
31593160 bool vertical =
3160- aOrientation == gfxTextRunFactory ::TEXT_ORIENT_VERTICAL_UPRIGHT ;
3161+ aOrientation == gfx::ShapedTextFlags ::TEXT_ORIENT_VERTICAL_UPRIGHT ;
31613162
31623163 for (uint32_t i = 0 ; i <= aLength; ++i) {
31633164 uint32_t extraCodeUnits = 0 ; // Will be set to 1 if we need to consume
@@ -3257,7 +3258,9 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget,
32573258 };
32583259 RefPtr<gfxTextRun> tempRun (
32593260 gfxTextRun::Create (¶ms, convertedString.Length (),
3260- aTextRun->GetFontGroup (), 0 , 0 ));
3261+ aTextRun->GetFontGroup (),
3262+ gfx::ShapedTextFlags (),
3263+ nsTextFrameUtils::Flags ()));
32613264 tempRun->AddGlyphRun (f, aMatchType, 0 , true , aOrientation);
32623265 if (!f->SplitAndInitTextRun (aDrawTarget, tempRun.get (),
32633266 convertedString.BeginReading (),
@@ -3267,7 +3270,9 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget,
32673270 } else {
32683271 RefPtr<gfxTextRun> mergedRun (
32693272 gfxTextRun::Create (¶ms, runLength,
3270- aTextRun->GetFontGroup (), 0 , 0 ));
3273+ aTextRun->GetFontGroup (),
3274+ gfx::ShapedTextFlags (),
3275+ nsTextFrameUtils::Flags ()));
32713276 MergeCharactersInTextRun (mergedRun.get (), tempRun.get (),
32723277 charsToMergeArray.Elements (),
32733278 deletedCharsArray.Elements ());
@@ -3308,7 +3313,7 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget,
33083313 uint32_t aOffset,
33093314 uint32_t aLength,
33103315 uint8_t aMatchType,
3311- uint16_t aOrientation,
3316+ gfx::ShapedTextFlags aOrientation,
33123317 Script aScript,
33133318 bool aSyntheticLower,
33143319 bool aSyntheticUpper)
0 commit comments