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

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

Issue 15565008: Fix release build warnings for unused variables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: use assert result Created 7 years, 7 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 | « no previous file | 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 outFontIdentifier->fString.set(fontRec.fFileName); 405 outFontIdentifier->fString.set(fontRec.fFileName);
406 // outFontIdentifier->fStyle = fontRec.fStyle; 406 // outFontIdentifier->fStyle = fontRec.fStyle;
407 } 407 }
408 408
409 if (NULL != outFamilyName) { 409 if (NULL != outFamilyName) {
410 if (exactNameMatch) { 410 if (exactNameMatch) {
411 outFamilyName->set(familyName); 411 outFamilyName->set(familyName);
412 } else { 412 } else {
413 // find familyName from list of names 413 // find familyName from list of names
414 const char* familyName = NULL; 414 const char* familyName = NULL;
415 bool found = fFamilyNameDict.findKey(familyRecID, &familyName); 415 SkAssertResult(fFamilyNameDict.findKey(familyRecID, &familyName));
416 SkASSERT(found && familyName); 416 SkASSERT(familyName);
417 outFamilyName->set(familyName); 417 outFamilyName->set(familyName);
418 } 418 }
419 } 419 }
420 420
421 if (NULL != outStyle) { 421 if (NULL != outStyle) {
422 *outStyle = fontRec.fStyle; 422 *outStyle = fontRec.fStyle;
423 } 423 }
424 424
425 return true; 425 return true;
426 } 426 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 SkFontID origFontI D, 535 SkFontID origFontI D,
536 const SkPaintOptio nsAndroid& opts) { 536 const SkPaintOptio nsAndroid& opts) {
537 // Skia does not support font fallback by default. This enables clients such 537 // Skia does not support font fallback by default. This enables clients such
538 // as WebKit to customize their font selection. In any case, clients can use 538 // as WebKit to customize their font selection. In any case, clients can use
539 // GetFallbackFamilyNameForChar() to get the fallback font for individual 539 // GetFallbackFamilyNameForChar() to get the fallback font for individual
540 // characters. 540 // characters.
541 if (!opts.isUsingFontFallbacks()) { 541 if (!opts.isUsingFontFallbacks()) {
542 return NULL; 542 return NULL;
543 } 543 }
544 544
545 const SkTypeface* origTypeface = SkTypefaceCache::FindByID(origFontID);
546 const SkTypeface* currTypeface = SkTypefaceCache::FindByID(currFontID); 545 const SkTypeface* currTypeface = SkTypefaceCache::FindByID(currFontID);
547 546
548 FallbackFontList* currentFallbackList = findFallbackFontList(opts.getLanguag e()); 547 FallbackFontList* currentFallbackList = findFallbackFontList(opts.getLanguag e());
549 SkASSERT(currentFallbackList); 548 SkASSERT(currentFallbackList);
550 549
551 SkASSERT(origTypeface != 0);
552 SkASSERT(currTypeface != 0); 550 SkASSERT(currTypeface != 0);
553 551
554 // we must convert currTypeface into a FontRecID 552 // we must convert currTypeface into a FontRecID
555 FontRecID currFontRecID = ((FontConfigTypeface*)currTypeface)->getIdentity() .fID; 553 FontRecID currFontRecID = ((FontConfigTypeface*)currTypeface)->getIdentity() .fID;
556 554
557 // TODO lookup the index next font in the chain 555 // TODO lookup the index next font in the chain
558 int currFallbackFontIndex = currentFallbackList->find(currFontRecID); 556 int currFallbackFontIndex = currentFallbackList->find(currFontRecID);
559 int nextFallbackFontIndex = currFallbackFontIndex + 1; 557 int nextFallbackFontIndex = currFallbackFontIndex + 1;
560 SkASSERT(-1 == nextFallbackFontIndex); 558 SkASSERT(-1 == nextFallbackFontIndex);
561 559
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 SkFontConfigInterfaceAndroid* fontConfig = getSingletonInterface(); 612 SkFontConfigInterfaceAndroid* fontConfig = getSingletonInterface();
615 return fontConfig->nextLogicalTypeface(currFontID, origFontID, options); 613 return fontConfig->nextLogicalTypeface(currFontID, origFontID, options);
616 614
617 } 615 }
618 616
619 /////////////////////////////////////////////////////////////////////////////// 617 ///////////////////////////////////////////////////////////////////////////////
620 618
621 SkFontMgr* SkFontMgr::Factory() { 619 SkFontMgr* SkFontMgr::Factory() {
622 return NULL; 620 return NULL;
623 } 621 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698