From 9e0c2fcdafa8f2cfe2113e6335eff4efe3e28c86 Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Tue, 2 Jun 2009 18:54:28 +0000 Subject: [PATCH] fix break in setConfig() where we always reset the bitmap remove use of non-standard ssize_t in SkSfntUtils.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@197 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkBitmap.cpp | 2 ++ src/utils/SkSfntUtils.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 616429cc62..4f44286b84 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -253,7 +253,9 @@ void SkBitmap::setConfig(Config c, int width, int height, int rowBytes) { fBytesPerPixel = (uint8_t)ComputeBytesPerPixel(c); SkDEBUGCODE(this->validate();) + return; + // if we got here, we had an error, so we reset the bitmap to empty err: this->reset(); } diff --git a/src/utils/SkSfntUtils.cpp b/src/utils/SkSfntUtils.cpp index 36f1f97da9..60c7844bd6 100644 --- a/src/utils/SkSfntUtils.cpp +++ b/src/utils/SkSfntUtils.cpp @@ -25,10 +25,10 @@ static Sk64 parse_be64(const uint8_t*& p) { bool SkSfntUtils::ReadTable_head(SkFontID fontID, SkSfntTable_head* head) { static const uint32_t gTag = SkSetFourByteTag('h', 'e', 'a', 'd'); - static const ssize_t gSize = 54; + static const size_t gSize = 54; uint8_t storage[gSize]; - ssize_t size = SkFontHost::GetTableData(fontID, gTag, 0, gSize, storage); + size_t size = SkFontHost::GetTableData(fontID, gTag, 0, gSize, storage); if (size != gSize) { return false; } @@ -57,10 +57,10 @@ bool SkSfntUtils::ReadTable_head(SkFontID fontID, SkSfntTable_head* head) { bool SkSfntUtils::ReadTable_maxp(SkFontID fontID, SkSfntTable_maxp* maxp) { static const uint32_t gTag = SkSetFourByteTag('m', 'a', 'x', 'p'); - static const ssize_t gSize = 32; + static const size_t gSize = 32; uint8_t storage[gSize]; - ssize_t size = SkFontHost::GetTableData(fontID, gTag, 0, gSize, storage); + size_t size = SkFontHost::GetTableData(fontID, gTag, 0, gSize, storage); if (size != gSize) { return false; }