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

Unified Diff: include/codec/SkScanlineDecoder.h

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 | « include/codec/SkCodec.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkScanlineDecoder.h
diff --git a/include/codec/SkScanlineDecoder.h b/include/codec/SkScanlineDecoder.h
index eac31ef40f05ca28b838c4031b037f8c3e979c6e..942c1b986ff4e33a939da8497e4b3bb27d81a061 100644
--- a/include/codec/SkScanlineDecoder.h
+++ b/include/codec/SkScanlineDecoder.h
@@ -9,8 +9,8 @@
#define SkScanlineDecoder_DEFINED
#include "SkTypes.h"
+#include "SkCodec.h"
#include "SkTemplates.h"
-#include "SkImageGenerator.h"
#include "SkImageInfo.h"
class SkScanlineDecoder : public SkNoncopyable {
@@ -40,12 +40,12 @@ public:
* @param rowBytes Number of bytes per row. Must be large enough to hold
* a scanline based on the SkImageInfo used to create this object.
*/
- SkImageGenerator::Result getScanlines(void* dst, int countLines, size_t rowBytes) {
+ SkCodec::Result getScanlines(void* dst, int countLines, size_t rowBytes) {
if ((rowBytes < fDstInfo.minRowBytes() && countLines > 1 ) || countLines <= 0
|| fCurrScanline + countLines > fDstInfo.height()) {
- return SkImageGenerator::kInvalidParameters;
+ return SkCodec::kInvalidParameters;
}
- const SkImageGenerator::Result result = this->onGetScanlines(dst, countLines, rowBytes);
+ const SkCodec::Result result = this->onGetScanlines(dst, countLines, rowBytes);
fCurrScanline += countLines;
return result;
}
@@ -58,14 +58,14 @@ public:
* will make reallyHasAlpha return true, when it could have returned
* false.
*/
- SkImageGenerator::Result skipScanlines(int countLines) {
+ SkCodec::Result skipScanlines(int countLines) {
if (fCurrScanline + countLines > fDstInfo.height()) {
// Arguably, we could just skip the scanlines which are remaining,
// and return kSuccess. We choose to return invalid so the client
// can catch their bug.
- return SkImageGenerator::kInvalidParameters;
+ return SkCodec::kInvalidParameters;
}
- const SkImageGenerator::Result result = this->onSkipScanlines(countLines);
+ const SkCodec::Result result = this->onSkipScanlines(countLines);
fCurrScanline += countLines;
return result;
}
@@ -96,7 +96,7 @@ private:
int fCurrScanline;
// Naive default version just calls onGetScanlines on temp memory.
- virtual SkImageGenerator::Result onSkipScanlines(int countLines) {
+ virtual SkCodec::Result onSkipScanlines(int countLines) {
SkAutoMalloc storage(fDstInfo.minRowBytes());
// Note that we pass 0 to rowBytes so we continue to use the same memory.
// Also note that while getScanlines checks that rowBytes is big enough,
@@ -106,7 +106,7 @@ private:
return this->onGetScanlines(storage.get(), countLines, 0);
}
- virtual SkImageGenerator::Result onGetScanlines(void* dst, int countLines,
+ virtual SkCodec::Result onGetScanlines(void* dst, int countLines,
size_t rowBytes) = 0;
};
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698