summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/chromium/FontLinux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/chromium/FontLinux.cpp')
-rw-r--r--WebCore/platform/graphics/chromium/FontLinux.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index 696cd9c..a242523 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -130,7 +130,7 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
if (textMode & cTextFill) {
// If we also filled, we don't want to draw shadows twice.
// See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
- paint.setLooper(0)->safeUnref();
+ SkSafeUnref(paint.setLooper(0));
}
canvas->drawPosText(glyphs, numGlyphs << 1, pos, paint);
@@ -313,7 +313,7 @@ public:
// So we allow that to run first, then do a second pass over the range it
// found and take the largest subregion that stays within a single font.
const FontData* glyphData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false, false).fontData;
- int endOfRun;
+ unsigned endOfRun;
for (endOfRun = 1; endOfRun < m_item.item.length; ++endOfRun) {
const FontData* nextGlyphData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos + endOfRun], false, false).fontData;
if (nextGlyphData != glyphData)
@@ -406,7 +406,7 @@ private:
// Harfbuzz will do the same thing for us using the GSUB table.
// 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
// for characters like '\n' otherwise.
- for (unsigned i = 0; i < originalRun.length(); ++i) {
+ for (int i = 0; i < originalRun.length(); ++i) {
UChar ch = originalRun[i];
UBlockCode block = ::ublock_getCode(ch);
if (block == UBLOCK_COMBINING_DIACRITICAL_MARKS || (Font::treatAsSpace(ch) && ch != ' ')) {
@@ -428,7 +428,7 @@ private:
normalizedString.extract(m_normalizedBuffer.get(), normalizedString.length() + 1, error);
ASSERT(U_SUCCESS(error));
- for (unsigned i = 0; i < normalizedString.length(); ++i) {
+ for (int i = 0; i < normalizedString.length(); ++i) {
if (Font::treatAsSpace(m_normalizedBuffer[i]))
m_normalizedBuffer[i] = ' ';
}
@@ -517,7 +517,7 @@ private:
// glyph.
unsigned logClustersIndex = isRTL ? m_item.num_glyphs - 1 : 0;
- for (int iter = 0; iter < m_item.num_glyphs; ++iter) {
+ for (unsigned iter = 0; iter < m_item.num_glyphs; ++iter) {
// Glyphs are stored in logical order, but for layout purposes we
// always go left to right.
int i = isRTL ? m_item.num_glyphs - iter - 1 : iter;
@@ -683,7 +683,7 @@ static int glyphIndexForXPositionInScriptRun(const TextRunWalker& walker, int x)
x -= truncateFixedPointToInteger(advances[glyphIndex]);
}
} else {
- for (glyphIndex = 0; glyphIndex < walker.length(); ++glyphIndex) {
+ for (glyphIndex = 0; static_cast<unsigned>(glyphIndex) < walker.length(); ++glyphIndex) {
if (x < truncateFixedPointToInteger(advances[glyphIndex]))
break;
x -= truncateFixedPointToInteger(advances[glyphIndex]);
@@ -741,7 +741,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
if (walker.rtl())
basePosition -= walker.numCodePoints();
- if (x >= 0 && x < walker.width()) {
+ if (x >= 0 && static_cast<unsigned>(x) < walker.width()) {
// The x value in question is within this script run. We consider
// each glyph in presentation order and stop when we find the one
// covering this position.
@@ -803,7 +803,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
if (walker.rtl())
base -= walker.width();
- if (fromX == -1 && from < walker.numCodePoints()) {
+ if (fromX == -1 && from >= 0 && static_cast<unsigned>(from) < walker.numCodePoints()) {
// |from| is within this script run. So we index the clusters log to
// find which glyph this code-point contributed to and find its x
// position.
@@ -813,7 +813,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
} else
from -= walker.numCodePoints();
- if (toX == -1 && to < walker.numCodePoints()) {
+ if (toX == -1 && to >= 0 && static_cast<unsigned>(to) < walker.numCodePoints()) {
int glyph = walker.logClusters()[to];
toX = base + walker.xPositions()[glyph];
toAdvance = walker.advances()[glyph];