aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkBmpRLECodec.h
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-10-09 11:07:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-09 11:07:34 -0700
commite6dd004c1b8a81dc37a370570877b8b7d6dbe308 (patch)
tree16ecfdede3939dcd7f1b3db311371d974477e7c5 /src/codec/SkBmpRLECodec.h
parent79da63fa0bec40b560597c79c2e1231fa51aef36 (diff)
Fill incomplete images in SkCodec parent class
Rather than implementing some sort of "fill" in every SkCodec subclass for incomplete images, let's make the parent class handle this situation. This includes an API change to SkCodec.h SkCodec::getScanlines() now returns the number of lines it read successfully, rather than an SkCodec::Result enum. getScanlines() most often fails on an incomplete input, in which case it is useful to know how many lines were successfully decoded - this provides more information than kIncomplete vs kSuccess. We do lose information when the API is used improperly, as we are no longer able to return kInvalidParameter or kScanlineNotStarted. Known Issues: Does not work for incomplete fFrameIsSubset gifs. Does not work for incomplete icos. BUG=skia: Review URL: https://codereview.chromium.org/1332053002
Diffstat (limited to 'src/codec/SkBmpRLECodec.h')
-rw-r--r--src/codec/SkBmpRLECodec.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/codec/SkBmpRLECodec.h b/src/codec/SkBmpRLECodec.h
index 8721969a85..fcf910d8e5 100644
--- a/src/codec/SkBmpRLECodec.h
+++ b/src/codec/SkBmpRLECodec.h
@@ -46,7 +46,7 @@ protected:
Result onGetPixels(const SkImageInfo& dstInfo, void* dst,
size_t dstRowBytes, const Options&, SkPMColor*,
- int*) override;
+ int*, int*) override;
SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo,
const SkCodec::Options& options, SkPMColor inputColorPtr[],
@@ -84,10 +84,10 @@ private:
const SkImageInfo& dstInfo, uint32_t x, uint32_t y,
uint8_t red, uint8_t green, uint8_t blue);
- Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
- const Options& opts) override;
+ int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
+ const Options& opts) override;
- SkSampler* getSampler() override;
+ SkSampler* getSampler(bool createIfNecessary) override;
SkAutoTUnref<SkColorTable> fColorTable; // owned
const uint32_t fNumColors;