aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkFont.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-08 15:48:26 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-08 15:48:26 +0000
commitefadb4b63c428b4f99399c097879981e6efa8870 (patch)
treefa14fc00a5cbb8b3d6c93db48fb3c9df87fe5de1 /src/core/SkFont.cpp
parentbafee11dd17d0d0c5e693ef2ba7b4d6a4b1e3786 (diff)
fix warning about uninitialized typeface_encoding by folding glyph case into switch
git-svn-id: http://skia.googlecode.com/svn/trunk@14094 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkFont.cpp')
-rw-r--r--src/core/SkFont.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/SkFont.cpp b/src/core/SkFont.cpp
index 847ca2f9f8..1516211fa6 100644
--- a/src/core/SkFont.cpp
+++ b/src/core/SkFont.cpp
@@ -85,11 +85,6 @@ int SkFont::textToGlyphs(const void* text, size_t byteLength, SkTextEncoding enc
return count;
}
- if (kGlyphID_SkTextEncoding == encoding) {
- memcpy(glyphs, text, count << 1);
- return count;
- }
-
// TODO: unify/eliminate SkTypeface::Encoding with SkTextEncoding
SkTypeface::Encoding typeface_encoding;
switch (encoding) {
@@ -103,7 +98,9 @@ int SkFont::textToGlyphs(const void* text, size_t byteLength, SkTextEncoding enc
typeface_encoding = SkTypeface::kUTF32_Encoding;
break;
case kGlyphID_SkTextEncoding:
- SkASSERT(0); // can't get here
+ // we can early exit, since we already have glyphIDs
+ memcpy(glyphs, text, count << 1);
+ return count;
}
(void)fTypeface->charsToGlyphs(text, typeface_encoding, glyphs, count);