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

Side by Side Diff: src/codec/SkSwizzler.cpp

Issue 1400343005: Reenable warnings in src/codec (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 unified diff | Download patch
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 return new SkSwizzler(proc, ctable, srcOffset, srcWidth, bpp); 693 return new SkSwizzler(proc, ctable, srcOffset, srcWidth, bpp);
694 } 694 }
695 695
696 SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidth, int bpp) 696 SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable, int srcOffset, int srcWidth, int bpp)
697 : fRowProc(proc) 697 : fRowProc(proc)
698 , fColorTable(ctable) 698 , fColorTable(ctable)
699 , fSrcOffset(srcOffset) 699 , fSrcOffset(srcOffset)
700 , fX0(srcOffset) 700 , fX0(srcOffset)
701 , fSrcWidth(srcWidth) 701 , fSrcWidth(srcWidth)
702 , fDstWidth(srcWidth) 702 , fDstWidth(srcWidth)
703 , fSampleX(1)
703 , fBPP(bpp) 704 , fBPP(bpp)
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 713
714 // check that fX0 is less than original width 714 // check that fX0 is less than original width
715 SkASSERT(fX0 >= 0 && fX0 < fSrcWidth); 715 SkASSERT(fX0 >= 0 && fX0 < fSrcWidth);
716 return fDstWidth; 716 return fDstWidth;
717 } 717 }
718 718
719 SkSwizzler::ResultAlpha SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRIC T src) { 719 SkSwizzler::ResultAlpha SkSwizzler::swizzle(void* dst, const uint8_t* SK_RESTRIC T src) {
720 SkASSERT(nullptr != dst && nullptr != src); 720 SkASSERT(nullptr != dst && nullptr != src);
721 return fRowProc(dst, src, fDstWidth, fBPP, fSampleX * fBPP, fX0 * fBPP, fCol orTable); 721 return fRowProc(dst, src, fDstWidth, fBPP, fSampleX * fBPP, fX0 * fBPP, fCol orTable);
722 } 722 }
OLDNEW
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698