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

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

Issue 1641273003: Support decoding opaque to *premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Test opaque to premul in dm Created 4 years, 10 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 "SkCodecPriv.h" 8 #include "SkCodecPriv.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkColorTable.h" 10 #include "SkColorTable.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // We've already read all the scanlines. This is a success. 558 // We've already read all the scanlines. This is a success.
559 return kSuccess; 559 return kSuccess;
560 } 560 }
561 561
562 // read rest of file, and get additional comment and time chunks in info_ptr 562 // read rest of file, and get additional comment and time chunks in info_ptr
563 png_read_end(fPng_ptr, fInfo_ptr); 563 png_read_end(fPng_ptr, fInfo_ptr);
564 564
565 return kSuccess; 565 return kSuccess;
566 } 566 }
567 567
568 uint32_t SkPngCodec::onGetFillValue(SkColorType colorType, SkAlphaType alphaType ) const { 568 uint32_t SkPngCodec::onGetFillValue(SkColorType colorType) const {
569 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); 569 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
570 if (colorPtr) { 570 if (colorPtr) {
571 return get_color_table_fill_value(colorType, colorPtr, 0); 571 return get_color_table_fill_value(colorType, colorPtr, 0);
572 } 572 }
573 return INHERITED::onGetFillValue(colorType, alphaType); 573 return INHERITED::onGetFillValue(colorType);
574 } 574 }
575 575
576 // Subclass of SkPngCodec which supports scanline decoding 576 // Subclass of SkPngCodec which supports scanline decoding
577 class SkPngScanlineDecoder : public SkPngCodec { 577 class SkPngScanlineDecoder : public SkPngCodec {
578 public: 578 public:
579 SkPngScanlineDecoder(const SkImageInfo& srcInfo, SkStream* stream, 579 SkPngScanlineDecoder(const SkImageInfo& srcInfo, SkStream* stream,
580 SkPngChunkReader* chunkReader, png_structp png_ptr, png_infop info_p tr, int bitDepth) 580 SkPngChunkReader* chunkReader, png_structp png_ptr, png_infop info_p tr, int bitDepth)
581 : INHERITED(srcInfo, stream, chunkReader, png_ptr, info_ptr, bitDepth, 1 ) 581 : INHERITED(srcInfo, stream, chunkReader, png_ptr, info_ptr, bitDepth, 1 )
582 , fSrcRow(nullptr) 582 , fSrcRow(nullptr)
583 {} 583 {}
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 } 778 }
779 779
780 if (1 == numberPasses) { 780 if (1 == numberPasses) {
781 return new SkPngScanlineDecoder(imageInfo, streamDeleter.detach(), chunk Reader, 781 return new SkPngScanlineDecoder(imageInfo, streamDeleter.detach(), chunk Reader,
782 png_ptr, info_ptr, bitDepth); 782 png_ptr, info_ptr, bitDepth);
783 } 783 }
784 784
785 return new SkPngInterlacedScanlineDecoder(imageInfo, streamDeleter.detach(), chunkReader, 785 return new SkPngInterlacedScanlineDecoder(imageInfo, streamDeleter.detach(), chunkReader,
786 png_ptr, info_ptr, bitDepth, numbe rPasses); 786 png_ptr, info_ptr, bitDepth, numbe rPasses);
787 } 787 }
OLDNEW
« dm/DM.cpp ('K') | « src/codec/SkPngCodec.h ('k') | src/codec/SkSampledCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698