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

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

Issue 1394003004: Add flag to force complex text for tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details. 16 * Library General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Library General Public License 18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to 19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 * 22 *
23 */ 23 */
24 24
25 #include "config.h" 25 #include "config.h"
26 #include "platform/fonts/Font.h" 26 #include "platform/fonts/Font.h"
27 27
28 #include "platform/LayoutTestSupport.h"
28 #include "platform/LayoutUnit.h" 29 #include "platform/LayoutUnit.h"
29 #include "platform/RuntimeEnabledFeatures.h" 30 #include "platform/RuntimeEnabledFeatures.h"
30 #include "platform/fonts/Character.h" 31 #include "platform/fonts/Character.h"
31 #include "platform/fonts/FontCache.h" 32 #include "platform/fonts/FontCache.h"
32 #include "platform/fonts/FontFallbackList.h" 33 #include "platform/fonts/FontFallbackList.h"
33 #include "platform/fonts/GlyphBuffer.h" 34 #include "platform/fonts/GlyphBuffer.h"
34 #include "platform/fonts/GlyphPageTreeNode.h" 35 #include "platform/fonts/GlyphPageTreeNode.h"
35 #include "platform/fonts/SimpleFontData.h" 36 #include "platform/fonts/SimpleFontData.h"
36 #include "platform/fonts/shaping/HarfBuzzFace.h" 37 #include "platform/fonts/shaping/HarfBuzzFace.h"
37 #include "platform/fonts/shaping/HarfBuzzShaper.h" 38 #include "platform/fonts/shaping/HarfBuzzShaper.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 FontCachePurgePreventer purgePreventer; 304 FontCachePurgePreventer purgePreventer;
304 305
305 if (codePath(TextRunPaintInfo(run)) != ComplexPath && !fontDescription().typ esettingFeatures()) 306 if (codePath(TextRunPaintInfo(run)) != ComplexPath && !fontDescription().typ esettingFeatures())
306 return offsetForPositionForSimpleText(run, x, includePartialGlyphs); 307 return offsetForPositionForSimpleText(run, x, includePartialGlyphs);
307 308
308 return offsetForPositionForComplexText(run, x, includePartialGlyphs); 309 return offsetForPositionForComplexText(run, x, includePartialGlyphs);
309 } 310 }
310 311
311 CodePath Font::codePath(const TextRunPaintInfo& runInfo) const 312 CodePath Font::codePath(const TextRunPaintInfo& runInfo) const
312 { 313 {
313 if (RuntimeEnabledFeatures::alwaysUseComplexTextEnabled()) 314 if (RuntimeEnabledFeatures::alwaysUseComplexTextEnabled()
315 || LayoutTestSupport::alwaysUseComplexTextForTest()) {
314 return ComplexPath; 316 return ComplexPath;
317 }
315 318
316 const TextRun& run = runInfo.run; 319 const TextRun& run = runInfo.run;
317 320
318 if (fontDescription().typesettingFeatures() && (runInfo.from || runInfo.to ! = run.length())) 321 if (fontDescription().typesettingFeatures() && (runInfo.from || runInfo.to ! = run.length()))
319 return ComplexPath; 322 return ComplexPath;
320 323
321 if (m_fontDescription.featureSettings() && m_fontDescription.featureSettings ()->size() > 0 && m_fontDescription.letterSpacing() == 0) 324 if (m_fontDescription.featureSettings() && m_fontDescription.featureSettings ()->size() > 0 && m_fontDescription.letterSpacing() == 0)
322 return ComplexPath; 325 return ComplexPath;
323 326
324 if (m_fontDescription.isVerticalBaseline()) 327 if (m_fontDescription.isVerticalBaseline())
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 { 826 {
824 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); 827 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts();
825 } 828 }
826 829
827 bool Font::isFallbackValid() const 830 bool Font::isFallbackValid() const
828 { 831 {
829 return !m_fontFallbackList || m_fontFallbackList->isValid(); 832 return !m_fontFallbackList || m_fontFallbackList->isValid();
830 } 833 }
831 834
832 } // namespace blink 835 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/LayoutTestSupport.cpp ('k') | third_party/WebKit/Source/web/WebKit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698