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

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: Rebase on merged SkCodec and SkScanlineDecoder 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 4ae57c057ab2d7c51d698e565be12a1c224560f7..b44052a38f0bc3a7ff6292f287771b464f2ad8ef 100644
--- a/src/codec/SkBmpCodec.cpp
+++ b/src/codec/SkBmpCodec.cpp
@@ -550,18 +550,6 @@ int32_t SkBmpCodec::getDstRow(int32_t y, int32_t height) const {
}
/*
- * Get the destination row to start filling from
- * Used to fill the remainder of the image on incomplete input for bmps
- * This is tricky since bmps may be kTopDown or kBottomUp. For kTopDown,
- * 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 {
- return (SkCodec::kTopDown_SkScanlineOrder == fRowOrder) ?
- SkTAddOffset<void*>(dst, y * dstRowBytes) : dst;
-}
-
-/*
* Compute the number of colors in the color table
*/
uint32_t SkBmpCodec::computeNumColors(uint32_t numColors) {
@@ -593,14 +581,10 @@ SkCodec::Result SkBmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
return prepareToDecode(dstInfo, options, inputColorPtr, inputColorCount);
}
-SkCodec::Result SkBmpCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {
+uint32_t SkBmpCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {
// Create a new image info representing the portion of the image to decode
SkImageInfo rowInfo = this->dstInfo().makeWH(this->dstInfo().width(), count);
// Decode the requested rows
return this->decodeRows(rowInfo, dst, rowBytes, this->options());
}
-
-int SkBmpCodec::onNextScanline() const {
- return this->getDstRow(this->INHERITED::onNextScanline(), this->dstInfo().height());
-}

Powered by Google App Engine
This is Rietveld 408576698