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

Unified Diff: src/codec/SkCodec_wbmp.cpp

Issue 1220733013: SkCodec no longer inherits from SkImageGenerator. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Manually handle the lifetime of fScanlineDecoder. Created 5 years, 5 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 | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_wbmp.cpp
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp
index 073165d2ca3140a3512c6323072fe2c16fcd1ad1..9709a689b12b5ab9e1dee519e27282a37d7e0145 100644
--- a/src/codec/SkCodec_wbmp.cpp
+++ b/src/codec/SkCodec_wbmp.cpp
@@ -100,20 +100,20 @@ SkEncodedFormat SkWbmpCodec::onGetEncodedFormat() const {
return kWBMP_SkEncodedFormat;
}
-SkImageGenerator::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
- void* pixels,
- size_t rowBytes,
- const Options&,
- SkPMColor ctable[],
- int* ctableCount) {
+SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
+ void* pixels,
+ size_t rowBytes,
+ const Options&,
+ SkPMColor ctable[],
+ int* ctableCount) {
SkCodec::RewindState rewindState = this->rewindIfNeeded();
if (rewindState == kCouldNotRewind_RewindState) {
- return SkImageGenerator::kCouldNotRewind;
+ return kCouldNotRewind;
} else if (rewindState == kRewound_RewindState) {
(void)read_header(this->stream(), NULL);
}
if (info.dimensions() != this->getInfo().dimensions()) {
- return SkImageGenerator::kInvalidScale;
+ return kInvalidScale;
}
ExpandProc proc = NULL;
switch (info.colorType()) {
@@ -133,7 +133,7 @@ SkImageGenerator::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
proc = expand_bits_to_T<uint16_t, bit_to_rgb565>;
break;
default:
- return SkImageGenerator::kInvalidConversion;
+ return kInvalidConversion;
}
SkISize size = info.dimensions();
uint8_t* dst = static_cast<uint8_t*>(pixels);
@@ -141,12 +141,12 @@ SkImageGenerator::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
SkAutoTMalloc<uint8_t> src(srcRowBytes);
for (int y = 0; y < size.height(); ++y) {
if (this->stream()->read(src.get(), srcRowBytes) != srcRowBytes) {
- return SkImageGenerator::kIncompleteInput;
+ return kIncompleteInput;
}
proc(dst, src.get(), size.width());
dst += rowBytes;
}
- return SkImageGenerator::kSuccess;
+ return kSuccess;
}
bool SkWbmpCodec::IsWbmp(SkStream* stream) {
« no previous file with comments | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698