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

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

Issue 1820073002: Add SkEncodedInfo to report properties of encoded image data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
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 "SkBmpStandardCodec.h" 8 #include "SkBmpStandardCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
11 #include "SkStream.h" 11 #include "SkStream.h"
12 12
13 /* 13 /*
14 * Creates an instance of the decoder 14 * Creates an instance of the decoder
15 * Called only by NewFromStream 15 * Called only by NewFromStream
16 */ 16 */
17 SkBmpStandardCodec::SkBmpStandardCodec(const SkImageInfo& info, SkStream* stream , 17 SkBmpStandardCodec::SkBmpStandardCodec(const SkEncodedInfo& info, SkStream* stre am,
18 uint16_t bitsPerPixel, uint32_t numColors , 18 uint16_t bitsPerPixel, uint32_t numColors ,
19 uint32_t bytesPerColor, uint32_t offset, 19 uint32_t bytesPerColor, uint32_t offset,
20 SkCodec::SkScanlineOrder rowOrder, 20 SkCodec::SkScanlineOrder rowOrder,
21 bool isOpaque, bool inIco) 21 bool isOpaque, bool inIco)
22 : INHERITED(info, stream, bitsPerPixel, rowOrder) 22 : INHERITED(info, stream, bitsPerPixel, rowOrder)
23 , fColorTable(nullptr) 23 , fColorTable(nullptr)
24 , fNumColors(numColors) 24 , fNumColors(numColors)
25 , fBytesPerColor(bytesPerColor) 25 , fBytesPerColor(bytesPerColor)
26 , fOffset(offset) 26 , fOffset(offset)
27 , fSwizzler(nullptr) 27 , fSwizzler(nullptr)
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 319 }
320 } 320 }
321 321
322 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { 322 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const {
323 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); 323 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
324 if (colorPtr) { 324 if (colorPtr) {
325 return get_color_table_fill_value(colorType, colorPtr, 0); 325 return get_color_table_fill_value(colorType, colorPtr, 0);
326 } 326 }
327 return INHERITED::onGetFillValue(colorType); 327 return INHERITED::onGetFillValue(colorType);
328 } 328 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698