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

Unified Diff: src/codec/SkMaskSwizzler.cpp

Issue 1407603003: Fix SkSwizzler bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added test and rebase Created 5 years, 2 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/SkMaskSwizzler.h ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkMaskSwizzler.cpp
diff --git a/src/codec/SkMaskSwizzler.cpp b/src/codec/SkMaskSwizzler.cpp
index 72dca28057ff5c82b13f6b6eaa883970011fee4d..958df61cc76ebb0961c104b2ee9388c890733f04 100644
--- a/src/codec/SkMaskSwizzler.cpp
+++ b/src/codec/SkMaskSwizzler.cpp
@@ -367,11 +367,11 @@ SkMaskSwizzler* SkMaskSwizzler::CreateMaskSwizzler(const SkImageInfo& dstInfo,
* Constructor for mask swizzler
*
*/
-SkMaskSwizzler::SkMaskSwizzler(SkMasks* masks, RowProc proc, int srcOffset, int srcWidth)
+SkMaskSwizzler::SkMaskSwizzler(SkMasks* masks, RowProc proc, int srcOffset, int subsetWidth)
: fMasks(masks)
, fRowProc(proc)
- , fSrcWidth(srcWidth)
- , fDstWidth(srcWidth)
+ , fSubsetWidth(subsetWidth)
+ , fDstWidth(subsetWidth)
, fSampleX(1)
, fSrcOffset(srcOffset)
, fX0(srcOffset)
@@ -383,10 +383,10 @@ int SkMaskSwizzler::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;
}
« no previous file with comments | « src/codec/SkMaskSwizzler.h ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698