Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkScaledCodec.h" | 10 #include "SkScaledCodec.h" |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 703 , fBPP(bpp) | 703 , fBPP(bpp) |
| 704 , fSampleX(1) | 704 , fSampleX(1) |
| 705 {} | 705 {} |
| 706 | 706 |
| 707 int SkSwizzler::onSetSampleX(int sampleX) { | 707 int SkSwizzler::onSetSampleX(int sampleX) { |
| 708 SkASSERT(sampleX > 0); // Surely there is an upper limit? Should there be | 708 SkASSERT(sampleX > 0); // Surely there is an upper limit? Should there be |
| 709 // way to report failure? | 709 // way to report failure? |
| 710 fSampleX = sampleX; | 710 fSampleX = sampleX; |
| 711 fX0 = get_start_coord(sampleX) + fSrcOffset; | 711 fX0 = get_start_coord(sampleX) + fSrcOffset; |
| 712 fDstWidth = get_scaled_dimension(fSrcWidth, sampleX); | 712 fDstWidth = get_scaled_dimension(fSrcWidth, sampleX); |
| 713 | |
|
msarett
2015/10/12 18:33:29
I missed this in an earlier CL, but this check is
scroggo
2015/10/12 20:47:07
Wait, does this belong in crrev.com/1390213002? I
| |
| 714 // check that fX0 is less than original width | |
| 715 SkASSERT(fX0 >= 0 && fX0 < fSrcWidth); | |
| 716 return fDstWidth; | 713 return fDstWidth; |
| 717 } | 714 } |
| 718 | 715 |
| 719 SkSwizzler::ResultAlpha SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRIC T src) { | 716 SkSwizzler::ResultAlpha SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRIC T src) { |
| 720 SkASSERT(nullptr != dst && nullptr != src); | 717 SkASSERT(nullptr != dst && nullptr != src); |
| 721 return fRowProc(dst, src, fDstWidth, fBPP, fSampleX * fBPP, fX0 * fBPP, fCol orTable); | 718 return fRowProc(dst, src, fDstWidth, fBPP, fSampleX * fBPP, fX0 * fBPP, fCol orTable); |
| 722 } | 719 } |
| OLD | NEW |