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

Side by Side Diff: src/images/SkImageDecoder_pkm.cpp

Issue 816273002: remove dead SK_SUPPORT_LEGACY_IMAGEDECODER_CHOOSER code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/images/SkImageDecoder_libwebp.cpp ('k') | src/ports/SkImageDecoder_empty.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 2014 Google Inc. 2 * Copyright 2014 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 "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkScaledBitmapSampler.h" 10 #include "SkScaledBitmapSampler.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 unsigned char* buf = (unsigned char*)autoMal.get(); 42 unsigned char* buf = (unsigned char*)autoMal.get();
43 43
44 // Make sure original PKM header is there... 44 // Make sure original PKM header is there...
45 SkASSERT(etc1_pkm_is_valid(buf)); 45 SkASSERT(etc1_pkm_is_valid(buf));
46 46
47 const unsigned short width = etc1_pkm_get_width(buf); 47 const unsigned short width = etc1_pkm_get_width(buf);
48 const unsigned short height = etc1_pkm_get_height(buf); 48 const unsigned short height = etc1_pkm_get_height(buf);
49 49
50 #ifdef SK_SUPPORT_LEGACY_IMAGEDECODER_CHOOSER
51 // should we allow the Chooser (if present) to pick a config for us???
52 if (!this->chooseFromOneChoice(kN32_SkColorType, width, height)) {
53 return kFailure;
54 }
55 #endif
56
57 // Setup the sampler... 50 // Setup the sampler...
58 SkScaledBitmapSampler sampler(width, height, this->getSampleSize()); 51 SkScaledBitmapSampler sampler(width, height, this->getSampleSize());
59 52
60 // Set the config... 53 // Set the config...
61 bm->setInfo(SkImageInfo::MakeN32(sampler.scaledWidth(), sampler.scaledHeight (), 54 bm->setInfo(SkImageInfo::MakeN32(sampler.scaledWidth(), sampler.scaledHeight (),
62 kOpaque_SkAlphaType)); 55 kOpaque_SkAlphaType));
63 if (SkImageDecoder::kDecodeBounds_Mode == mode) { 56 if (SkImageDecoder::kDecodeBounds_Mode == mode) {
64 return kSuccess; 57 return kSuccess;
65 } 58 }
66 59
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 static SkImageDecoder_DecodeReg gReg(sk_libpkm_dfactory); 119 static SkImageDecoder_DecodeReg gReg(sk_libpkm_dfactory);
127 120
128 static SkImageDecoder::Format get_format_pkm(SkStreamRewindable* stream) { 121 static SkImageDecoder::Format get_format_pkm(SkStreamRewindable* stream) {
129 if (is_pkm(stream)) { 122 if (is_pkm(stream)) {
130 return SkImageDecoder::kPKM_Format; 123 return SkImageDecoder::kPKM_Format;
131 } 124 }
132 return SkImageDecoder::kUnknown_Format; 125 return SkImageDecoder::kUnknown_Format;
133 } 126 }
134 127
135 static SkImageDecoder_FormatReg gFormatReg(get_format_pkm); 128 static SkImageDecoder_FormatReg gFormatReg(get_format_pkm);
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libwebp.cpp ('k') | src/ports/SkImageDecoder_empty.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698