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

Side by Side Diff: src/codec/SkRawCodec.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/SkPngCodec.cpp ('k') | src/codec/SkSwizzler.h » ('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 2016 Google Inc. 2 * Copyright 2016 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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 SkCodec::Result SkRawCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst, 681 SkCodec::Result SkRawCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst,
682 size_t dstRowBytes, const Options& optio ns, 682 size_t dstRowBytes, const Options& optio ns,
683 SkPMColor ctable[], int* ctableCount, 683 SkPMColor ctable[], int* ctableCount,
684 int* rowsDecoded) { 684 int* rowsDecoded) {
685 if (!conversion_possible(requestedInfo, this->getInfo())) { 685 if (!conversion_possible(requestedInfo, this->getInfo())) {
686 SkCodecPrintf("Error: cannot convert input type to output type.\n"); 686 SkCodecPrintf("Error: cannot convert input type to output type.\n");
687 return kInvalidConversion; 687 return kInvalidConversion;
688 } 688 }
689 689
690 SkAutoTDelete<SkSwizzler> swizzler(SkSwizzler::CreateSwizzler( 690 SkAutoTDelete<SkSwizzler> swizzler(SkSwizzler::CreateSwizzler(
691 SkSwizzler::kRGB, nullptr, requestedInfo, options)); 691 this->getEncodedInfo(), nullptr, requestedInfo, options));
692 SkASSERT(swizzler); 692 SkASSERT(swizzler);
693 693
694 const int width = requestedInfo.width(); 694 const int width = requestedInfo.width();
695 const int height = requestedInfo.height(); 695 const int height = requestedInfo.height();
696 SkAutoTDelete<dng_image> image(fDngImage->render(width, height)); 696 SkAutoTDelete<dng_image> image(fDngImage->render(width, height));
697 if (!image) { 697 if (!image) {
698 return kInvalidInput; 698 return kInvalidInput;
699 } 699 }
700 700
701 // Because the DNG SDK can not guarantee to render to requested size, we all ow a small 701 // Because the DNG SDK can not guarantee to render to requested size, we all ow a small
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 SkISize sizeFloor = this->onGetScaledDimensions(1.f / std::floor(fullShortEd ge / shortEdge)); 772 SkISize sizeFloor = this->onGetScaledDimensions(1.f / std::floor(fullShortEd ge / shortEdge));
773 SkISize sizeCeil = this->onGetScaledDimensions(1.f / std::ceil(fullShortEdge / shortEdge)); 773 SkISize sizeCeil = this->onGetScaledDimensions(1.f / std::ceil(fullShortEdge / shortEdge));
774 return sizeFloor == dim || sizeCeil == dim; 774 return sizeFloor == dim || sizeCeil == dim;
775 } 775 }
776 776
777 SkRawCodec::~SkRawCodec() {} 777 SkRawCodec::~SkRawCodec() {}
778 778
779 SkRawCodec::SkRawCodec(SkDngImage* dngImage) 779 SkRawCodec::SkRawCodec(SkDngImage* dngImage)
780 : INHERITED(dngImage->width(), dngImage->height(), dngImage->getEncodedInfo( ), nullptr) 780 : INHERITED(dngImage->width(), dngImage->height(), dngImage->getEncodedInfo( ), nullptr)
781 , fDngImage(dngImage) {} 781 , fDngImage(dngImage) {}
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698