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

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

Issue 2335203002: Implement Fill() for incomplete decodes to RGBA_F16 (Closed)
Patch Set: Fix win builds Created 4 years, 3 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/SkBmpStandardCodec.h ('k') | src/codec/SkCodec.cpp » ('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 "SkBmpStandardCodec.h" 8 #include "SkBmpStandardCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 int modulus; 295 int modulus;
296 SkTDivMod(srcX, 8, &quotient, &modulus); 296 SkTDivMod(srcX, 8, &quotient, &modulus);
297 uint32_t shift = 7 - modulus; 297 uint32_t shift = 7 - modulus;
298 uint32_t alphaBit = (fSrcBuffer.get()[quotient] >> shift) & 0x1; 298 uint32_t alphaBit = (fSrcBuffer.get()[quotient] >> shift) & 0x1;
299 dstRow[dstX] &= alphaBit - 1; 299 dstRow[dstX] &= alphaBit - 1;
300 srcX += sampleX; 300 srcX += sampleX;
301 } 301 }
302 } 302 }
303 } 303 }
304 304
305 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { 305 uint64_t SkBmpStandardCodec::onGetFillValue(const SkImageInfo& dstInfo) const {
306 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); 306 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
307 if (colorPtr) { 307 if (colorPtr) {
308 return get_color_table_fill_value(colorType, colorPtr, 0); 308 return get_color_table_fill_value(dstInfo.colorType(), dstInfo.alphaType (), colorPtr, 0,
309 nullptr);
309 } 310 }
310 return INHERITED::onGetFillValue(colorType); 311 return INHERITED::onGetFillValue(dstInfo);
311 } 312 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpStandardCodec.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698