Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: src/ports/SkFontConfigInterface_android.cpp

Issue 21053009: Upstream changes from Android (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/images/SkMovie_gif.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 The Android Open Source Project 3 * Copyright 2013 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkFontConfigInterface.h" 9 #include "SkFontConfigInterface.h"
10 #include "SkTypeface_android.h" 10 #include "SkTypeface_android.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 } 586 }
587 587
588 FallbackFontList* currentFallbackList = findFallbackFontList(opts.getLanguag e()); 588 FallbackFontList* currentFallbackList = findFallbackFontList(opts.getLanguag e());
589 SkASSERT(currentFallbackList); 589 SkASSERT(currentFallbackList);
590 590
591 // we must convert currTypeface into a FontRecID 591 // we must convert currTypeface into a FontRecID
592 FontRecID currFontRecID = INVALID_FONT_REC_ID; 592 FontRecID currFontRecID = INVALID_FONT_REC_ID;
593 const SkTypeface* currTypeface = SkTypefaceCache::FindByID(currFontID); 593 const SkTypeface* currTypeface = SkTypefaceCache::FindByID(currFontID);
594 // non-system fonts are not in the font cache so if we are asked to fallback 594 // non-system fonts are not in the font cache so if we are asked to fallback
595 // for a non-system font we will start at the front of the chain. 595 // for a non-system font we will start at the front of the chain.
596 if (NULL != currTypeface && currFontID == origFontID) { 596 if (NULL != currTypeface && currFontID != origFontID) {
597 currFontRecID = ((FontConfigTypeface*)currTypeface)->getIdentity().fID; 597 currFontRecID = ((FontConfigTypeface*)currTypeface)->getIdentity().fID;
598 SkASSERT(INVALID_FONT_REC_ID != currFontRecID); 598 SkASSERT(INVALID_FONT_REC_ID != currFontRecID);
599 } 599 }
600 600
601 // lookup the index next font in the chain 601 // lookup the index next font in the chain
602 int currFallbackFontIndex = currentFallbackList->find(currFontRecID); 602 int currFallbackFontIndex = currentFallbackList->find(currFontRecID);
603 // We add 1 to the returned index for 2 reasons: (1) if find succeeds it mov es 603 // We add 1 to the returned index for 2 reasons: (1) if find succeeds it mov es
604 // our index to the next entry in the list; (2) if find() fails it returns 604 // our index to the next entry in the list; (2) if find() fails it returns
605 // -1 and incrementing it will set our starting index to 0 (the head of the list) 605 // -1 and incrementing it will set our starting index to 0 (the head of the list)
606 int nextFallbackFontIndex = currFallbackFontIndex + 1; 606 int nextFallbackFontIndex = currFallbackFontIndex + 1;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 return SkCreateTypefaceForScriptNG(getHBScriptFromHBScriptOld(script), style , fontVariant); 811 return SkCreateTypefaceForScriptNG(getHBScriptFromHBScriptOld(script), style , fontVariant);
812 } 812 }
813 813
814 #endif 814 #endif
815 815
816 /////////////////////////////////////////////////////////////////////////////// 816 ///////////////////////////////////////////////////////////////////////////////
817 817
818 SkFontMgr* SkFontMgr::Factory() { 818 SkFontMgr* SkFontMgr::Factory() {
819 return NULL; 819 return NULL;
820 } 820 }
OLDNEW
« no previous file with comments | « src/images/SkMovie_gif.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698