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

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: Thanks windows bot! 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 | « src/codec/SkCodec_libbmp.cpp ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libgif.cpp
diff --git a/src/codec/SkCodec_libgif.cpp b/src/codec/SkCodec_libgif.cpp
index 9b15151f1066d876500cd980caad2f936af2980f..cf935777d18ef2ad6fd388ee80055166a7042e7d 100644
--- a/src/codec/SkCodec_libgif.cpp
+++ b/src/codec/SkCodec_libgif.cpp
@@ -428,25 +428,25 @@ 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
const int32_t dstBytesPerPixel =
SkColorTypeBytesPerPixel(dstColorType);
- void* subsetDst = SkTAddOffset<void*>(dst,
+ dst = SkTAddOffset<void*>(dst,
dstRowBytes * imageTop +
dstBytesPerPixel * imageLeft);
// 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->swizzle(dstRow, buffer.get());
}
}
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->swizzle(dstRow, buffer.get());
}
} 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->swizzle(dstRow, buffer.get());
+ dstRow = SkTAddOffset<void>(dstRow, dstRowBytes);
}
}
« no previous file with comments | « src/codec/SkCodec_libbmp.cpp ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698