Also use SkToU32 instead of a flat cast.
R=djsollen@google.com
Review URL: https://codereview.chromium.org/
14565005
git-svn-id: http://skia.googlecode.com/svn/trunk@9139
2bbb7eff-a529-9590-31e7-
b0007b416f81
*/
static Format GetStreamFormat(SkStream*);
+ /** Return a readable string of the Format provided.
+ */
+ static const char* GetFormatName(Format);
+
/** Return a readable string of the value returned by getFormat().
*/
const char* getFormatName() const;
}
const char* SkImageDecoder::getFormatName() const {
- switch (this->getFormat()) {
+ return GetFormatName(this->getFormat());
+}
+
+const char* SkImageDecoder::GetFormatName(Format format) {
+ switch (format) {
case kUnknown_Format:
return "Unknown Format";
case kBMP_Format:
return true;
}
- if (target->fRowBytes != (uint32_t) bm.rowBytes()) {
+ if (target->fRowBytes != SkToU32(bm.rowBytes())) {
if (target->fRowBytes < SkImageMinRowBytes(*info)) {
SkASSERT(!"Desired row bytes is too small");
return false;