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

Unified Diff: src/codec/SkSwizzler.cpp

Issue 1407603003: Fix SkSwizzler bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments 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
« 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 8d13e56bd25a44e221c7f4bc290e51cf4922449f..341b3a10bfea219db03e133697080474febac7dd 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -690,12 +690,12 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc,
}
SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable,
- int deltaSrc, int srcWidth)
+ int deltaSrc, int subsetWidth)
: fRowProc(proc)
, fColorTable(ctable)
, fDeltaSrc(deltaSrc)
- , fSrcWidth(srcWidth)
- , fDstWidth(srcWidth)
+ , fSubsetWidth(subsetWidth)
+ , fDstWidth(subsetWidth)
, fSampleX(1)
, fX0(0)
{}
@@ -705,10 +705,10 @@ int SkSwizzler::onSetSampleX(int sampleX) {
// way to report failure?
fSampleX = sampleX;
fX0 = get_start_coord(sampleX);
- 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;
}
« 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