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

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

Issue 1911613002: Use SkEncodedInfo in place of SkSwizzler::SrcConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bmp bug Created 4 years, 8 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/SkSwizzler.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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 return true; 91 return true;
92 } 92 }
93 93
94 bool SkWbmpCodec::onRewind() { 94 bool SkWbmpCodec::onRewind() {
95 return read_header(this->stream(), nullptr); 95 return read_header(this->stream(), nullptr);
96 } 96 }
97 97
98 SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, const SkPMC olor* ctable, 98 SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, const SkPMC olor* ctable,
99 const Options& opts) { 99 const Options& opts) {
100 return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts); 100 return SkSwizzler::CreateSwizzler(this->getEncodedInfo(), ctable, info, opts );
101 } 101 }
102 102
103 bool SkWbmpCodec::readRow(uint8_t* row) { 103 bool SkWbmpCodec::readRow(uint8_t* row) {
104 return this->stream()->read(row, fSrcRowBytes) == fSrcRowBytes; 104 return this->stream()->read(row, fSrcRowBytes) == fSrcRowBytes;
105 } 105 }
106 106
107 SkWbmpCodec::SkWbmpCodec(int width, int height, const SkEncodedInfo& info, SkStr eam* stream) 107 SkWbmpCodec::SkWbmpCodec(int width, int height, const SkEncodedInfo& info, SkStr eam* stream)
108 : INHERITED(width, height, info, stream) 108 : INHERITED(width, height, info, stream)
109 , fSrcRowBytes(get_src_row_bytes(this->getInfo().width())) 109 , fSrcRowBytes(get_src_row_bytes(this->getInfo().width()))
110 , fSwizzler(nullptr) 110 , fSwizzler(nullptr)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 209 }
210 210
211 // Initialize the swizzler 211 // Initialize the swizzler
212 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable. get()), options)); 212 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable. get()), options));
213 SkASSERT(fSwizzler); 213 SkASSERT(fSwizzler);
214 214
215 fSrcBuffer.reset(fSrcRowBytes); 215 fSrcBuffer.reset(fSrcRowBytes);
216 216
217 return kSuccess; 217 return kSuccess;
218 } 218 }
OLDNEW
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698