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

Side by Side Diff: Source/platform/fonts/Font.cpp

Issue 1130913007: Removing primaryFontHasGlyphForCharacter method (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase patch Created 5 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
« no previous file with comments | « Source/platform/fonts/Font.h ('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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. 6 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 // FIXME: It would be nicer to use the missing glyph from the last resort fo nt instead. 564 // FIXME: It would be nicer to use the missing glyph from the last resort fo nt instead.
565 ASSERT(primaryFont()); 565 ASSERT(primaryFont());
566 GlyphData data = primaryFont()->missingGlyphData(); 566 GlyphData data = primaryFont()->missingGlyphData();
567 if (variant == NormalVariant) { 567 if (variant == NormalVariant) {
568 page->setGlyphDataForCharacter(c, data.glyph, data.fontData); 568 page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
569 data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyph PageTreeLevel(), node->level())); 569 data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyph PageTreeLevel(), node->level()));
570 } 570 }
571 return data; 571 return data;
572 } 572 }
573 573
574 bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const
575 {
576 ASSERT(primaryFont());
577 unsigned pageNumber = (character / GlyphPage::size);
578
579 GlyphPageTreeNode* node = GlyphPageTreeNode::getNormalRootChild(primaryFont( ), pageNumber);
580 GlyphPage* page = node->page();
581
582 return page && page->glyphForCharacter(character);
583 }
584
585 // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the 574 // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
586 // standard emphasis marks do so. 575 // standard emphasis marks do so.
587 bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphDa ta) const 576 bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphDa ta) const
588 { 577 {
589 if (mark.isEmpty()) 578 if (mark.isEmpty())
590 return false; 579 return false;
591 580
592 UChar32 character = mark[0]; 581 UChar32 character = mark[0];
593 582
594 if (U16_IS_SURROGATE(character)) { 583 if (U16_IS_SURROGATE(character)) {
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 { 871 {
883 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); 872 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts();
884 } 873 }
885 874
886 bool Font::isFallbackValid() const 875 bool Font::isFallbackValid() const
887 { 876 {
888 return !m_fontFallbackList || m_fontFallbackList->isValid(); 877 return !m_fontFallbackList || m_fontFallbackList->isValid();
889 } 878 }
890 879
891 } // namespace blink 880 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698