Index: src/codec/SkSwizzler.cpp |
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp |
index ce2c946f18a3d0f62b9111eb8c5a5e25f05b101b..de691243403c7d72f258e5d554391f9f81bd8282 100644 |
--- a/src/codec/SkSwizzler.cpp |
+++ b/src/codec/SkSwizzler.cpp |
@@ -693,13 +693,14 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc, |
return new SkSwizzler(proc, ctable, srcOffset, srcWidth, bpp); |
} |
-SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidth, int bpp) |
+SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int subsetWidth, |
+ int bpp) |
: fRowProc(proc) |
, fColorTable(ctable) |
, fSrcOffset(srcOffset) |
, fX0(srcOffset) |
- , fSrcWidth(srcWidth) |
- , fDstWidth(srcWidth) |
+ , fSubsetWidth(subsetWidth) |
+ , fDstWidth(subsetWidth) |
, fSampleX(1) |
, fBPP(bpp) |
{} |
@@ -709,10 +710,10 @@ int SkSwizzler::onSetSampleX(int sampleX) { |
// way to report failure? |
fSampleX = sampleX; |
fX0 = get_start_coord(sampleX) + fSrcOffset; |
- fDstWidth = get_scaled_dimension(fSrcWidth, sampleX); |
+ fDstWidth = get_scaled_dimension(fSubsetWidth, sampleX); |
- // check that fX0 is less than original width |
- SkASSERT(fX0 >= 0 && fX0 < fSrcWidth); |
+ // check that fX0 is valid |
+ SkASSERT(fX0 >= 0); |
return fDstWidth; |
} |