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

Unified Diff: src/codec/SkSwizzler.cpp

Issue 1075243003: Implementing filling for SkBmpCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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
« src/codec/SkSwizzler.h ('K') | « src/codec/SkSwizzler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkSwizzler.cpp
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index 754b08883544928f7066456b409420d52a596e84..350100be2deae41db07a8c1c4a0f7f83f8e18d7f 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -423,12 +423,17 @@ SkSwizzler::ResultAlpha SkSwizzler::next(const uint8_t* SK_RESTRICT src,
}
void SkSwizzler::Fill(void* dst, const SkImageInfo& dstInfo, size_t dstRowBytes, uint32_t y,
- uint32_t colorOrIndex, SkPMColor* colorTable) {
+ uint32_t colorOrIndex, const SkPMColor* colorTable, bool bottomUp) {
SkASSERT(dst != NULL);
SkASSERT(y < (uint32_t) dstInfo.height());
// Get dst start row
- void* dstRow = SkTAddOffset<void*>(dst, y * dstRowBytes);
+ void* dstRow;
+ if (bottomUp) {
+ dstRow = dst;
+ } else {
+ dstRow = SkTAddOffset<void*>(dst, y * dstRowBytes);
+ }
// Calculate remaining bytes. This is tricky since the final row may not be padded.
const size_t totalBytes = dstInfo.getSafeSize(dstRowBytes);
« src/codec/SkSwizzler.h ('K') | « src/codec/SkSwizzler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698