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

Unified Diff: src/codec/SkBmpCodec.cpp

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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
Index: src/codec/SkBmpCodec.cpp
diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp
index 406a603dceefe3916714cb9cf394baefac094d00..27010fabc00c518311b84879819ab54f8f813fb8 100644
--- a/src/codec/SkBmpCodec.cpp
+++ b/src/codec/SkBmpCodec.cpp
@@ -556,9 +556,9 @@ int32_t SkBmpCodec::getDstRow(int32_t y, int32_t height) {
* we start filling from where we left off, but for kBottomUp we start
* filling at the top of the image.
*/
-void* SkBmpCodec::getDstStartRow(void* dst, size_t dstRowBytes, int32_t y) const {
+void* SkBmpCodec::onGetFillDst(void* dst, size_t dstRowBytes, uint32_t decodedScanlines) const {
return (SkScanlineDecoder::kTopDown_SkScanlineOrder == fRowOrder) ?
- SkTAddOffset<void*>(dst, y * dstRowBytes) : dst;
+ INHERITED::onGetFillDst(dst, dstRowBytes, decodedScanlines) : dst;
}
/*
@@ -580,7 +580,7 @@ uint32_t SkBmpCodec::computeNumColors(uint32_t numColors) {
class SkBmpScanlineDecoder : public SkScanlineDecoder {
public:
SkBmpScanlineDecoder(SkBmpCodec* codec)
- : INHERITED(codec->getInfo())
+ : INHERITED(codec, codec->getInfo())
, fCodec(codec)
{}
@@ -610,7 +610,7 @@ public:
return fCodec->prepareToDecode(dstInfo, options, inputColorPtr, inputColorCount);
}
- SkCodec::Result onGetScanlines(void* dst, int count, size_t rowBytes) override {
+ uint32_t onGetScanlines(void* dst, int count, size_t rowBytes) override {
// Create a new image info representing the portion of the image to decode
SkImageInfo rowInfo = this->dstInfo().makeWH(this->dstInfo().width(), count);
@@ -622,14 +622,14 @@ public:
return fCodec->fRowOrder;
}
- int onGetY() const override {
- return fCodec->getDstRow(this->INHERITED::onGetY(), this->dstInfo().height());
+ int onGetY(int encodedY) const override {
+ return fCodec->getDstRow(encodedY, this->dstInfo().height());
}
// TODO(msarett): Override default skipping with something more clever.
private:
- SkAutoTDelete<SkBmpCodec> fCodec;
+ SkBmpCodec* fCodec; // Owned by parent class
typedef SkScanlineDecoder INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698