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

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

Issue 1365313002: Merge SkCodec with SkScanlineDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Skip ICO in SkScaledCodec for now 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/SkBmpRLECodec.h ('k') | src/codec/SkBmpStandardCodec.h » ('j') | 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 "SkBmpRLECodec.h" 8 #include "SkBmpRLECodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
11 #include "SkScaledCodec.h" 11 #include "SkScaledCodec.h"
12 #include "SkScanlineDecoder.h"
13 #include "SkStream.h" 12 #include "SkStream.h"
14 13
15 /* 14 /*
16 * Creates an instance of the decoder 15 * Creates an instance of the decoder
17 * Called only by NewFromStream 16 * Called only by NewFromStream
18 */ 17 */
19 SkBmpRLECodec::SkBmpRLECodec(const SkImageInfo& info, SkStream* stream, 18 SkBmpRLECodec::SkBmpRLECodec(const SkImageInfo& info, SkStream* stream,
20 uint16_t bitsPerPixel, uint32_t numColors, 19 uint16_t bitsPerPixel, uint32_t numColors,
21 uint32_t bytesPerColor, uint32_t offset, 20 uint32_t bytesPerColor, uint32_t offset,
22 SkScanlineDecoder::SkScanlineOrder rowOrder, 21 SkCodec::SkScanlineOrder rowOrder,
23 size_t RLEBytes) 22 size_t RLEBytes)
24 : INHERITED(info, stream, bitsPerPixel, rowOrder) 23 : INHERITED(info, stream, bitsPerPixel, rowOrder)
25 , fColorTable(nullptr) 24 , fColorTable(nullptr)
26 , fNumColors(this->computeNumColors(numColors)) 25 , fNumColors(this->computeNumColors(numColors))
27 , fBytesPerColor(bytesPerColor) 26 , fBytesPerColor(bytesPerColor)
28 , fOffset(offset) 27 , fOffset(offset)
29 , fStreamBuffer(new uint8_t[RLEBytes]) 28 , fStreamBuffer(new uint8_t[RLEBytes])
30 , fRLEBytes(RLEBytes) 29 , fRLEBytes(RLEBytes)
31 , fCurrRLEByte(0) 30 , fCurrRLEByte(0)
32 , fSampleX(1) 31 , fSampleX(1)
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 462
464 // Set the indicated number of pixels 463 // Set the indicated number of pixels
465 for (int which = 0; x < endX; x++) { 464 for (int which = 0; x < endX; x++) {
466 setPixel(dst, dstRowBytes, dstInfo, x, y, indices[which]); 465 setPixel(dst, dstRowBytes, dstInfo, x, y, indices[which]);
467 which = !which; 466 which = !which;
468 } 467 }
469 } 468 }
470 } 469 }
471 } 470 }
472 } 471 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpRLECodec.h ('k') | src/codec/SkBmpStandardCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698