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

Side by Side Diff: src/codec/SkPngCodec.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/SkPngCodec.h ('k') | src/codec/SkSampledCodec.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 this->allocateStorage(dstInfo); 892 this->allocateStorage(dstInfo);
893 int count = this->readRows(dstInfo, dst, rowBytes, dstInfo.height(), 0); 893 int count = this->readRows(dstInfo, dst, rowBytes, dstInfo.height(), 0);
894 if (count > dstInfo.height()) { 894 if (count > dstInfo.height()) {
895 *rowsDecoded = count; 895 *rowsDecoded = count;
896 return kIncompleteInput; 896 return kIncompleteInput;
897 } 897 }
898 898
899 return kSuccess; 899 return kSuccess;
900 } 900 }
901 901
902 uint32_t SkPngCodec::onGetFillValue(SkColorType colorType) const { 902 uint64_t SkPngCodec::onGetFillValue(const SkImageInfo& dstInfo) const {
903 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); 903 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
904 if (colorPtr) { 904 if (colorPtr) {
905 return get_color_table_fill_value(colorType, colorPtr, 0); 905 SkAlphaType alphaType = select_alpha_xform(dstInfo.alphaType(),
906 this->getInfo().alphaType());
907 return get_color_table_fill_value(dstInfo.colorType(), alphaType, colorP tr, 0,
908 fColorXform.get());
906 } 909 }
907 return INHERITED::onGetFillValue(colorType); 910 return INHERITED::onGetFillValue(dstInfo);
908 } 911 }
909 912
910 SkCodec* SkPngCodec::NewFromStream(SkStream* stream, SkPngChunkReader* chunkRead er) { 913 SkCodec* SkPngCodec::NewFromStream(SkStream* stream, SkPngChunkReader* chunkRead er) {
911 SkAutoTDelete<SkStream> streamDeleter(stream); 914 SkAutoTDelete<SkStream> streamDeleter(stream);
912 915
913 SkCodec* outCodec; 916 SkCodec* outCodec;
914 if (read_header(stream, chunkReader, &outCodec, nullptr, nullptr)) { 917 if (read_header(stream, chunkReader, &outCodec, nullptr, nullptr)) {
915 // Codec has taken ownership of the stream. 918 // Codec has taken ownership of the stream.
916 SkASSERT(outCodec); 919 SkASSERT(outCodec);
917 streamDeleter.release(); 920 streamDeleter.release();
918 return outCodec; 921 return outCodec;
919 } 922 }
920 923
921 return nullptr; 924 return nullptr;
922 } 925 }
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.h ('k') | src/codec/SkSampledCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698