1805 void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties,
1806 const SkMatrix* deviceMatrix,
1807 void (*proc)(const SkDescriptor*, void*),
1808 void* context, bool ignoreGamma) const {
1809 SkScalerContext::Rec rec;
1810
1811 SkScalerContext::MakeRec(*this, deviceProperties, deviceMatrix, &rec); <===この中
1812 if (ignoreGamma) {
1813 rec.setLuminanceColor(0);
1814 }
1541 void SkScalerContext::MakeRec(const SkPaint& paint,
1542 const SkDeviceProperties* deviceProperties,
1543 const SkMatrix* deviceMatrix,
1544 Rec* rec) {
(略)
1691 #ifdef SK_BUILD_FOR_ANDROID
1692 rec->fLanguage = paint.getLanguage(); <========================ここ
1693 rec->fFontVariant = paint.getFontVariant();
1694 #endif
1695
1696
1701 SkFontHost::FilterRec(rec, typeface);
1702
1703
1704 }
32 struct SkScalerContextRec {
33 uint32_t fOrigFontID;
34 uint32_t fFontID;
35 SkScalar fTextSize, fPreScaleX, fPreSkewX;
36 SkScalar fPost2x2[2][2];
37 SkScalar fFrameWidth, fMiterLimit;
38 #ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
39 SkScalar fHintingScaleFactor;
40 #endif
41 #ifdef SK_BUILD_FOR_ANDROID
42 SkLanguage fLanguage; <=================================
43 SkPaint::FontVariant fFontVariant;
44 #endif
45
46
47 uint32_t fLumBits;
48 uint8_t fDeviceGamma;
49 uint8_t fPaintGamma;
50 uint8_t fContrast;
51 uint8_t fReservedAlign;
989 SkFontID SkFontHost::NextLogicalFont(const SkScalerContextRec& rec) {
990 SkAutoMutexAcquire ac(gFamilyHeadAndNameListMutex);
991 return nextLogicalFontLocked(rec);
992 }
994 static SkFontID nextLogicalFontLocked(const SkScalerContextRec& rec) {
995 loadSystemFontsLocked();
996
997 const SkTypeface* origTypeface = findFromUniqueIDLocked(rec.fOrigFontID);
998 const SkTypeface* currTypeface = findFromUniqueIDLocked(rec.fFontID);
999
1000 FallbackFontList* currentFallbackList =
1001 getFallbackFontListLocked(rec.fLanguage); <=====
1002 SkASSERT(currentFallbackList);
1003
1004 SkASSERT(origTypeface != 0);
1005 SkASSERT(currTypeface != 0);
1006
1007
1008
1009 SkFontID plainFontID = findTypefaceLocked(currTypeface, SkTypeface::kNormal)->uniqueID();
1010
1011
1016 int plainFallbackFontIndex = findFallbackFontIndex(plainFontID, currentFallbackList);
1017 int nextFallbackFontIndex = plainFallbackFontIndex + 1;
1018
1019
1020
1021 SkPaint::FontVariant recPreference = rec.fFontVariant;
1022 if (recPreference == SkPaint::kDefault_Variant) {
1023 recPreference = SkPaint::kCompact_Variant;
1024 }
1025 SkFontID nextFontID = 0;
1026 while (nextFallbackFontIndex < currentFallbackList->fList.count()) {
1027 bool normalFont =
1028 (currentFallbackList->fList[nextFallbackFontIndex].fVariant == SkPaint::kDefault_Variant);
1029 bool fontChosen = (currentFallbackList->fList[nextFallbackFontIndex].fVariant == recPreference);
1030 if (normalFont || fontChosen) {
1031 const SkTypeface* nextTypeface =
1032 findFromUniqueIDLocked(currentFallbackList->fList[nextFallbackFontIndex].fFontID);
1033 nextFontID = findTypefaceLocked(nextTypeface, origTypeface->style())->uniqueID();
1034 break;
1035 }
1036 nextFallbackFontIndex++;
1037 }
1038
1039 SkDEBUGF(("---- nextLogicalFont: currFontID=%d, origFontID=%d, plainFontID=%d, "
1040 "plainFallbackFontIndex=%d, nextFallbackFontIndex=%d "
1041 "=> nextFontID=%d", rec.fFontID, rec.fOrigFontID, plainFontID,
1042 plainFallbackFontIndex, nextFallbackFontIndex, nextFontID));
1043 return nextFontID;
1044 }