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

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

Issue 1244973003: Reland "Change fallback font collection in HarfBuzzShaper" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase (resolved conflicts) Created 5 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
« no previous file with comments | « no previous file | Source/platform/fonts/shaping/CachingWordShapeIterator.h » ('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 (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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 { 697 {
698 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); 698 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper();
699 float width = shaper.width(this, run, fallbackFonts, glyphBounds); 699 float width = shaper.width(this, run, fallbackFonts, glyphBounds);
700 return width; 700 return width;
701 } 701 }
702 702
703 // Return the code point index for the given |x| offset into the text run. 703 // Return the code point index for the given |x| offset into the text run.
704 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, 704 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
705 bool includePartialGlyphs) const 705 bool includePartialGlyphs) const
706 { 706 {
707 HashSet<const SimpleFontData*> fallbackFonts; 707 HarfBuzzShaper shaper(this, run);
708 HarfBuzzShaper shaper(this, run, &fallbackFonts);
709 RefPtr<ShapeResult> shapeResult = shaper.shapeResult(); 708 RefPtr<ShapeResult> shapeResult = shaper.shapeResult();
710 if (!shapeResult) 709 if (!shapeResult)
711 return 0; 710 return 0;
712 return shapeResult->offsetForPosition(xFloat); 711 return shapeResult->offsetForPosition(xFloat);
713 } 712 }
714 713
715 // Return the rectangle for selecting the given range of code-points in the Text Run. 714 // Return the rectangle for selecting the given range of code-points in the Text Run.
716 FloatRect Font::selectionRectForComplexText(const TextRun& run, 715 FloatRect Font::selectionRectForComplexText(const TextRun& run,
717 const FloatPoint& point, int height, int from, int to) const 716 const FloatPoint& point, int height, int from, int to) const
718 { 717 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 { 831 {
833 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); 832 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts();
834 } 833 }
835 834
836 bool Font::isFallbackValid() const 835 bool Font::isFallbackValid() const
837 { 836 {
838 return !m_fontFallbackList || m_fontFallbackList->isValid(); 837 return !m_fontFallbackList || m_fontFallbackList->isValid();
839 } 838 }
840 839
841 } // namespace blink 840 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/fonts/shaping/CachingWordShapeIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698