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

Unified Diff: src/images/SkImageDecoder.cpp

Issue 14565005: Provide a function to print the name of a Format. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/images/SkImageDecoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder.cpp
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index 9ffae5f0e7f9bdac29d642641cc823ef2d806dcf..bcea23bd59aa0c755842aca07516bda879c0154e 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -54,7 +54,11 @@ SkImageDecoder::Format SkImageDecoder::getFormat() 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:
@@ -319,7 +323,7 @@ bool SkImageDecoder::DecodeMemoryToTarget(const void* buffer, size_t size,
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;
« no previous file with comments | « include/images/SkImageDecoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698