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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | 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 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkFontConfigParser_android.h" 8 #include "SkFontConfigParser_android.h"
9 #include "SkTDArray.h" 9 #include "SkTDArray.h"
10 #include "SkTSearch.h" 10 #include "SkTSearch.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 *fontFamilies.append() = fallbackFonts[i]; 580 *fontFamilies.append() = fallbackFonts[i];
581 } 581 }
582 } 582 }
583 583
584 void SkFontConfigParser::GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilie s, 584 void SkFontConfigParser::GetTestFontFamilies(SkTDArray<FontFamily*> &fontFamilie s,
585 const char* testMainConfigFile, 585 const char* testMainConfigFile,
586 const char* testFallbackConfigFile) { 586 const char* testFallbackConfigFile) {
587 parseConfigFile(testMainConfigFile, fontFamilies); 587 parseConfigFile(testMainConfigFile, fontFamilies);
588 588
589 SkTDArray<FontFamily*> fallbackFonts; 589 SkTDArray<FontFamily*> fallbackFonts;
590 if (NULL != testFallbackConfigFile) { 590 if (testFallbackConfigFile) {
591 parseConfigFile(testFallbackConfigFile, fallbackFonts); 591 parseConfigFile(testFallbackConfigFile, fallbackFonts);
592 } 592 }
593 593
594 // Append all fallback fonts to system fonts 594 // Append all fallback fonts to system fonts
595 for (int i = 0; i < fallbackFonts.count(); ++i) { 595 for (int i = 0; i < fallbackFonts.count(); ++i) {
596 fallbackFonts[i]->fIsFallbackFont = true; 596 fallbackFonts[i]->fIsFallbackFont = true;
597 *fontFamilies.append() = fallbackFonts[i]; 597 *fontFamilies.append() = fallbackFonts[i];
598 } 598 }
599 } 599 }
600 600
601 SkLanguage SkLanguage::getParent() const { 601 SkLanguage SkLanguage::getParent() const {
602 SkASSERT(!fTag.isEmpty()); 602 SkASSERT(!fTag.isEmpty());
603 const char* tag = fTag.c_str(); 603 const char* tag = fTag.c_str();
604 604
605 // strip off the rightmost "-.*" 605 // strip off the rightmost "-.*"
606 const char* parentTagEnd = strrchr(tag, '-'); 606 const char* parentTagEnd = strrchr(tag, '-');
607 if (parentTagEnd == NULL) { 607 if (parentTagEnd == NULL) {
608 return SkLanguage(); 608 return SkLanguage();
609 } 609 }
610 size_t parentTagLen = parentTagEnd - tag; 610 size_t parentTagLen = parentTagEnd - tag;
611 return SkLanguage(tag, parentTagLen); 611 return SkLanguage(tag, parentTagLen);
612 } 612 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698