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

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

Issue 343813002: Explicitly compare FontVariant to enumerators. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 } 834 }
835 835
836 runCache.remove(cachedResults); 836 runCache.remove(cachedResults);
837 } 837 }
838 838
839 // Add a space as pre-context to the buffer. This prevents showing dotte d-circle 839 // Add a space as pre-context to the buffer. This prevents showing dotte d-circle
840 // for combining marks at the beginning of runs. 840 // for combining marks at the beginning of runs.
841 static const uint16_t preContext = ' '; 841 static const uint16_t preContext = ' ';
842 hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0); 842 hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0);
843 843
844 if (fontDescription.variant() && u_islower(m_normalizedBuffer[currentRun ->startIndex()])) { 844 if (fontDescription.variant() == FontVariantSmallCaps && u_islower(m_nor malizedBuffer[currentRun->startIndex()])) {
845 String upperText = String(m_normalizedBuffer.get() + currentRun->sta rtIndex(), currentRun->numCharacters()).upper(); 845 String upperText = String(m_normalizedBuffer.get() + currentRun->sta rtIndex(), currentRun->numCharacters()).upper();
846 ASSERT(!upperText.is8Bit()); // m_normalizedBuffer is 16 bit, theref ore upperText is 16 bit, even after we call makeUpper(). 846 ASSERT(!upperText.is8Bit()); // m_normalizedBuffer is 16 bit, theref ore upperText is 16 bit, even after we call makeUpper().
847 hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.charact ers16()), currentRun->numCharacters(), 0, currentRun->numCharacters()); 847 hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.charact ers16()), currentRun->numCharacters(), 0, currentRun->numCharacters());
848 } else { 848 } else {
849 hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffe r.get() + currentRun->startIndex()), currentRun->numCharacters(), 0, currentRun- >numCharacters()); 849 hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffe r.get() + currentRun->startIndex()), currentRun->numCharacters(), 0, currentRun- >numCharacters());
850 } 850 }
851 851
852 if (fontDescription.orientation() == Vertical) 852 if (fontDescription.orientation() == Vertical)
853 face->setScriptForVerticalGlyphSubstitution(harfBuzzBuffer.get()); 853 face->setScriptForVerticalGlyphSubstitution(harfBuzzBuffer.get());
854 854
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 point.x() + fromX, point.x() + toX, 1122 point.x() + fromX, point.x() + toX,
1123 point.y(), height); 1123 point.y(), height);
1124 } 1124 }
1125 1125
1126 return Font::pixelSnappedSelectionRect( 1126 return Font::pixelSnappedSelectionRect(
1127 point.x() + toX, point.x() + fromX, 1127 point.x() + toX, point.x() + fromX,
1128 point.y(), height); 1128 point.y(), height);
1129 } 1129 }
1130 1130
1131 } // namespace WebCore 1131 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/fonts/WidthIterator.cpp ('k') | Source/platform/fonts/mac/ComplexTextController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698