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

Side by Side Diff: Source/platform/fonts/shaping/HarfBuzzShaper.cpp

Issue 754743004: Don't return false for RenderStyle::operator== while fonts load. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed review issue and regressions. Created 6 years 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 | « Source/platform/fonts/Font.cpp ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 832
833 hb_buffer_set_language(harfBuzzBuffer.get(), hb_language_from_string(loc ale.data(), locale.length())); 833 hb_buffer_set_language(harfBuzzBuffer.get(), hb_language_from_string(loc ale.data(), locale.length()));
834 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); 834 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script());
835 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction()); 835 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction());
836 836
837 const UChar* src = m_normalizedBuffer.get() + currentRun->startIndex(); 837 const UChar* src = m_normalizedBuffer.get() + currentRun->startIndex();
838 std::wstring key(src, src + currentRun->numCharacters()); 838 std::wstring key(src, src + currentRun->numCharacters());
839 839
840 CachedShapingResults* cachedResults = runCache.find(key); 840 CachedShapingResults* cachedResults = runCache.find(key);
841 if (cachedResults) { 841 if (cachedResults) {
842 if (cachedResults->dir == currentRun->direction() && cachedResults-> font == *m_font && cachedResults->locale == localeString) { 842 if (cachedResults->dir == currentRun->direction() && cachedResults-> font == *m_font
843 && !cachedResults->font.loadingCustomFonts() && !m_font->loading CustomFonts() && cachedResults->locale == localeString) {
843 currentRun->applyShapeResult(cachedResults->buffer); 844 currentRun->applyShapeResult(cachedResults->buffer);
844 setGlyphPositionsForHarfBuzzRun(currentRun, cachedResults->buffe r); 845 setGlyphPositionsForHarfBuzzRun(currentRun, cachedResults->buffe r);
845 846
846 hb_buffer_clear_contents(harfBuzzBuffer.get()); 847 hb_buffer_clear_contents(harfBuzzBuffer.get());
847 848
848 runCache.moveToBack(cachedResults); 849 runCache.moveToBack(cachedResults);
849 850
850 continue; 851 continue;
851 } 852 }
852 853
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 fromX = 0; 1143 fromX = 0;
1143 if (!foundToX) 1144 if (!foundToX)
1144 toX = m_run.rtl() ? 0 : m_totalWidth; 1145 toX = m_run.rtl() ? 0 : m_totalWidth;
1145 1146
1146 if (fromX < toX) 1147 if (fromX < toX)
1147 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); 1148 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height);
1148 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); 1149 return FloatRect(point.x() + toX, point.y(), fromX - toX, height);
1149 } 1150 }
1150 1151
1151 } // namespace blink 1152 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698