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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1006583005: SkCodec: add wbmp class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "SamplePipeControllers.h" 9 #include "SamplePipeControllers.h"
10 #include "SkCommonFlags.h" 10 #include "SkCommonFlags.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 switch (fMode) { 87 switch (fMode) {
88 case kNormal_Mode: 88 case kNormal_Mode:
89 switch (codec->getPixels(decodeInfo, bitmap.getPixels(), bitmap.rowB ytes())) { 89 switch (codec->getPixels(decodeInfo, bitmap.getPixels(), bitmap.rowB ytes())) {
90 case SkImageGenerator::kSuccess: 90 case SkImageGenerator::kSuccess:
91 // We consider incomplete to be valid, since we should still decode what is 91 // We consider incomplete to be valid, since we should still decode what is
92 // available. 92 // available.
93 case SkImageGenerator::kIncompleteInput: 93 case SkImageGenerator::kIncompleteInput:
94 break; 94 break;
95 case SkImageGenerator::kInvalidConversion: 95 case SkImageGenerator::kInvalidConversion:
96 bitmap.reset();
97 if (SkInstallDiscardablePixelRef(codec.detach(), &bitmap)) {
msarett 2015/03/26 12:37:35 What does this do? I'm just not sure I understand
scroggo 2015/03/26 14:37:57 SkInstallDiscardablePixelRef is declared in SkImag
hal.canary 2015/03/26 17:10:53 I am removing this code for now.
98 break;
99 }
96 return Error::Nonfatal("Incompatible colortype conversion"); 100 return Error::Nonfatal("Incompatible colortype conversion");
101
97 default: 102 default:
98 // Everything else is considered a failure. 103 // Everything else is considered a failure.
99 return SkStringPrintf("Couldn't getPixels %s.", fPath.c_str( )); 104 return SkStringPrintf("Couldn't getPixels %s.", fPath.c_str( ));
100 } 105 }
101 break; 106 break;
102 case kScanline_Mode: { 107 case kScanline_Mode: {
103 SkScanlineDecoder* scanlineDecoder = codec->getScanlineDecoder(decod eInfo); 108 SkScanlineDecoder* scanlineDecoder = codec->getScanlineDecoder(decod eInfo);
104 if (NULL == scanlineDecoder) { 109 if (NULL == scanlineDecoder) {
105 return Error::Nonfatal("Cannot use scanline decoder for all imag es"); 110 return Error::Nonfatal("Cannot use scanline decoder for all imag es");
106 } 111 }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 surfaces.unrefAll(); 621 surfaces.unrefAll();
617 return ""; 622 return "";
618 } 623 }
619 SkISize size() const SK_OVERRIDE { return fSize; } 624 SkISize size() const SK_OVERRIDE { return fSize; }
620 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this. 625 Name name() const SK_OVERRIDE { sk_throw(); return ""; } // No one shou ld be calling this.
621 } proxy(fW, fH, pic, src.size()); 626 } proxy(fW, fH, pic, src.size());
622 return fSink->draw(proxy, bitmap, stream, log); 627 return fSink->draw(proxy, bitmap, stream, log);
623 } 628 }
624 629
625 } // namespace DM 630 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | gyp/codec.gyp » ('j') | src/codec/SkCodec_wbmp.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698