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

Unified Diff: src/codec/SkCodec_libgif.cpp

Issue 1256373002: Pass the destination pointer to next (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/codec/SkCodec_libgif.cpp
diff --git a/src/codec/SkCodec_libgif.cpp b/src/codec/SkCodec_libgif.cpp
index 9b15151f1066d876500cd980caad2f936af2980f..3fa35ee0b1d019140dd912d95eba98eb80f7c1ca 100644
--- a/src/codec/SkCodec_libgif.cpp
+++ b/src/codec/SkCodec_libgif.cpp
@@ -428,7 +428,8 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
// animated gifs where we draw on top of the
// previous frame.
if (!skipBackground) {
- SkSwizzler::Fill(dst, dstInfo, dstRowBytes, height, fillIndex, colorTable);
+ SkSwizzler::Fill(dst, dstInfo, dstRowBytes, height,
+ fillIndex, colorTable);
}
// Modify the dst pointer
@@ -441,12 +442,11 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
// Create the subset swizzler
swizzler.reset(SkSwizzler::CreateSwizzler(
SkSwizzler::kIndex, colorTable, subsetDstInfo,
- subsetDst, dstRowBytes, zeroInit));
+ zeroInit));
} else {
// Create the fully dimensional swizzler
swizzler.reset(SkSwizzler::CreateSwizzler(
- SkSwizzler::kIndex, colorTable, dstInfo, dst,
- dstRowBytes, zeroInit));
+ SkSwizzler::kIndex, colorTable, dstInfo, zeroInit));
}
// Stores output from dgiflib and input to the swizzler
@@ -466,29 +466,35 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
if (!skipBackground) {
memset(buffer.get(), fillIndex, innerWidth);
for (; y < innerHeight; y++) {
- swizzler->next(buffer.get(), iter.nextY());
+ void* dstRow = SkTAddOffset<void>(dst,
+ dstRowBytes * iter.nextY());
+ swizzler->next(buffer.get(), dstRow);
}
}
return gif_error(SkStringPrintf(
"Could not decode line %d of %d.\n",
y, height - 1).c_str(), kIncompleteInput);
}
- swizzler->next(buffer.get(), iter.nextY());
+ void* dstRow = SkTAddOffset<void>(
+ dst, dstRowBytes * iter.nextY());
+ swizzler->next(buffer.get(), dstRow);
}
} else {
// Standard mode
+ void* dstRow = dst;
for (int32_t y = 0; y < innerHeight; y++) {
if (GIF_ERROR == DGifGetLine(fGif, buffer.get(),
innerWidth)) {
if (!skipBackground) {
- SkSwizzler::Fill(swizzler->getDstRow(), dstInfo, dstRowBytes,
+ SkSwizzler::Fill(dstRow, dstInfo, dstRowBytes,
innerHeight - y, fillIndex, colorTable);
}
return gif_error(SkStringPrintf(
"Could not decode line %d of %d.\n",
y, height - 1).c_str(), kIncompleteInput);
}
- swizzler->next(buffer.get());
+ swizzler->next(buffer.get(), dstRow);
+ dstRow = SkTAddOffset<void>(dstRow, dstRowBytes);
}
}

Powered by Google App Engine
This is Rietveld 408576698