| epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 8 | |
| 9 | #include "SkImageDecoder.h" |
| 10 | #include "SkBitmap.h" |
| scroggo@google.com | f8d7d27 | 2013-02-22 21:38:35 +0000 | [diff] [blame] | 11 | #include "SkImagePriv.h" |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 12 | #include "SkPixelRef.h" |
| 13 | #include "SkStream.h" |
| 14 | #include "SkTemplates.h" |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 15 | #include "SkCanvas.h" |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 16 | |
| robertphillips@google.com | 15e9d3e | 2012-06-21 20:25:03 +0000 | [diff] [blame] | 17 | SK_DEFINE_INST_COUNT(SkImageDecoder::Peeker) |
| 18 | SK_DEFINE_INST_COUNT(SkImageDecoder::Chooser) |
| 19 | SK_DEFINE_INST_COUNT(SkImageDecoderFactory) |
| 20 | |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 21 | static SkBitmap::Config gDeviceConfig = SkBitmap::kNo_Config; |
| 22 | |
| 23 | SkBitmap::Config SkImageDecoder::GetDeviceConfig() |
| 24 | { |
| 25 | return gDeviceConfig; |
| 26 | } |
| 27 | |
| 28 | void SkImageDecoder::SetDeviceConfig(SkBitmap::Config config) |
| 29 | { |
| 30 | gDeviceConfig = config; |
| 31 | } |
| 32 | |
| 33 | /////////////////////////////////////////////////////////////////////////////// |
| 34 | |
| 35 | SkImageDecoder::SkImageDecoder() |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 36 | : fPeeker(NULL) |
| 37 | , fChooser(NULL) |
| 38 | , fAllocator(NULL) |
| 39 | , fSampleSize(1) |
| 40 | , fDefaultPref(SkBitmap::kNo_Config) |
| 41 | , fDitherImage(true) |
| 42 | , fUsePrefTable(false) |
| 43 | , fPreferQualityOverSpeed(false) { |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | SkImageDecoder::~SkImageDecoder() { |
| reed@google.com | 82065d6 | 2011-02-07 15:30:46 +0000 | [diff] [blame] | 47 | SkSafeUnref(fPeeker); |
| 48 | SkSafeUnref(fChooser); |
| 49 | SkSafeUnref(fAllocator); |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | SkImageDecoder::Format SkImageDecoder::getFormat() const { |
| 53 | return kUnknown_Format; |
| 54 | } |
| 55 | |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 56 | const char* SkImageDecoder::getFormatName() const { |
| scroggo@google.com | f98118e | 2013-05-15 14:53:49 +0000 | [diff] [blame^] | 57 | return GetFormatName(this->getFormat()); |
| 58 | } |
| 59 | |
| 60 | const char* SkImageDecoder::GetFormatName(Format format) { |
| 61 | switch (format) { |
| scroggo@google.com | 39edf4c | 2013-04-25 17:33:51 +0000 | [diff] [blame] | 62 | case kUnknown_Format: |
| 63 | return "Unknown Format"; |
| 64 | case kBMP_Format: |
| 65 | return "BMP"; |
| 66 | case kGIF_Format: |
| 67 | return "GIF"; |
| 68 | case kICO_Format: |
| 69 | return "ICO"; |
| 70 | case kJPEG_Format: |
| 71 | return "JPEG"; |
| 72 | case kPNG_Format: |
| 73 | return "PNG"; |
| 74 | case kWBMP_Format: |
| 75 | return "WBMP"; |
| 76 | case kWEBP_Format: |
| 77 | return "WEBP"; |
| 78 | default: |
| 79 | SkASSERT(!"Invalid format type!"); |
| 80 | } |
| 81 | return "Unknown Format"; |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 82 | } |
| 83 | |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 84 | SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker* peeker) { |
| 85 | SkRefCnt_SafeAssign(fPeeker, peeker); |
| 86 | return peeker; |
| 87 | } |
| 88 | |
| 89 | SkImageDecoder::Chooser* SkImageDecoder::setChooser(Chooser* chooser) { |
| 90 | SkRefCnt_SafeAssign(fChooser, chooser); |
| 91 | return chooser; |
| 92 | } |
| 93 | |
| 94 | SkBitmap::Allocator* SkImageDecoder::setAllocator(SkBitmap::Allocator* alloc) { |
| 95 | SkRefCnt_SafeAssign(fAllocator, alloc); |
| 96 | return alloc; |
| 97 | } |
| 98 | |
| 99 | void SkImageDecoder::setSampleSize(int size) { |
| 100 | if (size < 1) { |
| 101 | size = 1; |
| 102 | } |
| 103 | fSampleSize = size; |
| 104 | } |
| 105 | |
| 106 | bool SkImageDecoder::chooseFromOneChoice(SkBitmap::Config config, int width, |
| 107 | int height) const { |
| 108 | Chooser* chooser = fChooser; |
| 109 | |
| 110 | if (NULL == chooser) { // no chooser, we just say YES to decoding :) |
| 111 | return true; |
| 112 | } |
| 113 | chooser->begin(1); |
| 114 | chooser->inspect(0, config, width, height); |
| 115 | return chooser->choose() == 0; |
| 116 | } |
| 117 | |
| 118 | bool SkImageDecoder::allocPixelRef(SkBitmap* bitmap, |
| 119 | SkColorTable* ctable) const { |
| 120 | return bitmap->allocPixels(fAllocator, ctable); |
| 121 | } |
| 122 | |
| 123 | /////////////////////////////////////////////////////////////////////////////// |
| reed@android.com | b6137c3 | 2009-07-29 20:56:52 +0000 | [diff] [blame] | 124 | |
| reed@android.com | 3f1f06a | 2010-03-03 21:04:12 +0000 | [diff] [blame] | 125 | void SkImageDecoder::setPrefConfigTable(const SkBitmap::Config pref[6]) { |
| 126 | if (NULL == pref) { |
| 127 | fUsePrefTable = false; |
| 128 | } else { |
| 129 | fUsePrefTable = true; |
| 130 | memcpy(fPrefTable, pref, sizeof(fPrefTable)); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | SkBitmap::Config SkImageDecoder::getPrefConfig(SrcDepth srcDepth, |
| 135 | bool srcHasAlpha) const { |
| 136 | SkBitmap::Config config; |
| 137 | |
| 138 | if (fUsePrefTable) { |
| 139 | int index = 0; |
| 140 | switch (srcDepth) { |
| 141 | case kIndex_SrcDepth: |
| 142 | index = 0; |
| 143 | break; |
| 144 | case k16Bit_SrcDepth: |
| 145 | index = 2; |
| 146 | break; |
| 147 | case k32Bit_SrcDepth: |
| 148 | index = 4; |
| 149 | break; |
| 150 | } |
| 151 | if (srcHasAlpha) { |
| 152 | index += 1; |
| 153 | } |
| 154 | config = fPrefTable[index]; |
| 155 | } else { |
| 156 | config = fDefaultPref; |
| 157 | } |
| 158 | |
| 159 | if (SkBitmap::kNo_Config == config) { |
| 160 | config = SkImageDecoder::GetDeviceConfig(); |
| 161 | } |
| 162 | return config; |
| 163 | } |
| 164 | |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 165 | bool SkImageDecoder::decode(SkStream* stream, SkBitmap* bm, |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 166 | SkBitmap::Config pref, Mode mode, bool reuseBitmap) { |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 167 | // we reset this to false before calling onDecode |
| 168 | fShouldCancelDecode = false; |
| reed@android.com | 3f1f06a | 2010-03-03 21:04:12 +0000 | [diff] [blame] | 169 | // assign this, for use by getPrefConfig(), in case fUsePrefTable is false |
| 170 | fDefaultPref = pref; |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 171 | |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 172 | if (reuseBitmap) { |
| 173 | SkAutoLockPixels alp(*bm); |
| 174 | if (NULL != bm->getPixels()) { |
| 175 | return this->onDecode(stream, bm, mode); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | // pass a temporary bitmap, so that if we return false, we are assured of |
| 180 | // leaving the caller's bitmap untouched. |
| 181 | SkBitmap tmp; |
| reed@android.com | 3f1f06a | 2010-03-03 21:04:12 +0000 | [diff] [blame] | 182 | if (!this->onDecode(stream, &tmp, mode)) { |
| reed@android.com | 62900b4 | 2009-02-11 15:07:19 +0000 | [diff] [blame] | 183 | return false; |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 184 | } |
| reed@android.com | 62900b4 | 2009-02-11 15:07:19 +0000 | [diff] [blame] | 185 | bm->swap(tmp); |
| 186 | return true; |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 187 | } |
| 188 | |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 189 | bool SkImageDecoder::decodeSubset(SkBitmap* bm, const SkIRect& rect, |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 190 | SkBitmap::Config pref) { |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 191 | // we reset this to false before calling onDecodeSubset |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 192 | fShouldCancelDecode = false; |
| 193 | // assign this, for use by getPrefConfig(), in case fUsePrefTable is false |
| 194 | fDefaultPref = pref; |
| 195 | |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 196 | return this->onDecodeSubset(bm, rect); |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | bool SkImageDecoder::buildTileIndex(SkStream* stream, |
| 200 | int *width, int *height) { |
| 201 | // we reset this to false before calling onBuildTileIndex |
| 202 | fShouldCancelDecode = false; |
| 203 | |
| 204 | return this->onBuildTileIndex(stream, width, height); |
| 205 | } |
| 206 | |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 207 | bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize, |
| 208 | int dstX, int dstY, int width, int height, |
| 209 | int srcX, int srcY) { |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 210 | int w = width / sampleSize; |
| 211 | int h = height / sampleSize; |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 212 | if (src->getConfig() == SkBitmap::kIndex8_Config) { |
| 213 | // kIndex8 does not allow drawing via an SkCanvas, as is done below. |
| 214 | // Instead, use extractSubset. Note that this shares the SkPixelRef and |
| 215 | // SkColorTable. |
| 216 | // FIXME: Since src is discarded in practice, this holds on to more |
| 217 | // pixels than is strictly necessary. Switch to a copy if memory |
| 218 | // savings are more important than speed here. This also means |
| 219 | // that the pixels in dst can not be reused (though there is no |
| 220 | // allocation, which was already done on src). |
| 221 | int x = (dstX - srcX) / sampleSize; |
| 222 | int y = (dstY - srcY) / sampleSize; |
| 223 | SkIRect subset = SkIRect::MakeXYWH(x, y, w, h); |
| 224 | return src->extractSubset(dst, subset); |
| 225 | } |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 226 | // if the destination has no pixels then we must allocate them. |
| 227 | if (dst->isNull()) { |
| 228 | dst->setConfig(src->getConfig(), w, h); |
| 229 | dst->setIsOpaque(src->isOpaque()); |
| 230 | |
| 231 | if (!this->allocPixelRef(dst, NULL)) { |
| 232 | SkDEBUGF(("failed to allocate pixels needed to crop the bitmap")); |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 233 | return false; |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 234 | } |
| 235 | } |
| 236 | // check to see if the destination is large enough to decode the desired |
| 237 | // region. If this assert fails we will just draw as much of the source |
| 238 | // into the destination that we can. |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 239 | if (dst->width() < w || dst->height() < h) { |
| 240 | SkDEBUGF(("SkImageDecoder::cropBitmap does not have a large enough bitmap.\n")); |
| 241 | } |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 242 | |
| 243 | // Set the Src_Mode for the paint to prevent transparency issue in the |
| 244 | // dest in the event that the dest was being re-used. |
| 245 | SkPaint paint; |
| 246 | paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
| 247 | |
| 248 | SkCanvas canvas(*dst); |
| 249 | canvas.drawSprite(*src, (srcX - dstX) / sampleSize, |
| 250 | (srcY - dstY) / sampleSize, |
| 251 | &paint); |
| scroggo@google.com | 7e6fcee | 2013-05-03 20:14:28 +0000 | [diff] [blame] | 252 | return true; |
| commit-bot@chromium.org | a936e37 | 2013-03-14 14:42:18 +0000 | [diff] [blame] | 253 | } |
| 254 | |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 255 | /////////////////////////////////////////////////////////////////////////////// |
| 256 | |
| 257 | bool SkImageDecoder::DecodeFile(const char file[], SkBitmap* bm, |
| reed@android.com | b3ade9d | 2009-06-15 13:04:45 +0000 | [diff] [blame] | 258 | SkBitmap::Config pref, Mode mode, Format* format) { |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 259 | SkASSERT(file); |
| 260 | SkASSERT(bm); |
| 261 | |
| mike@reedtribe.org | f381162 | 2013-03-19 02:18:33 +0000 | [diff] [blame] | 262 | SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(file)); |
| 263 | if (stream.get()) { |
| 264 | if (SkImageDecoder::DecodeStream(stream, bm, pref, mode, format)) { |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 265 | bm->pixelRef()->setURI(file); |
| tomhudson@google.com | 1a36621 | 2012-01-03 14:42:08 +0000 | [diff] [blame] | 266 | return true; |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 267 | } |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 268 | } |
| 269 | return false; |
| 270 | } |
| 271 | |
| 272 | bool SkImageDecoder::DecodeMemory(const void* buffer, size_t size, SkBitmap* bm, |
| reed@android.com | b3ade9d | 2009-06-15 13:04:45 +0000 | [diff] [blame] | 273 | SkBitmap::Config pref, Mode mode, Format* format) { |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 274 | if (0 == size) { |
| 275 | return false; |
| 276 | } |
| 277 | SkASSERT(buffer); |
| 278 | |
| 279 | SkMemoryStream stream(buffer, size); |
| reed@android.com | b3ade9d | 2009-06-15 13:04:45 +0000 | [diff] [blame] | 280 | return SkImageDecoder::DecodeStream(&stream, bm, pref, mode, format); |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 281 | } |
| 282 | |
| scroggo@google.com | f8d7d27 | 2013-02-22 21:38:35 +0000 | [diff] [blame] | 283 | class TargetAllocator : public SkBitmap::Allocator { |
| 284 | |
| 285 | public: |
| 286 | TargetAllocator(void* target) |
| 287 | : fTarget(target) {} |
| 288 | |
| 289 | virtual bool allocPixelRef(SkBitmap* bm, SkColorTable* ct) SK_OVERRIDE { |
| 290 | // SkColorTable is not supported by Info/Target model. |
| 291 | SkASSERT(NULL == ct); |
| 292 | bm->setPixels(fTarget); |
| 293 | return true; |
| 294 | } |
| 295 | |
| 296 | private: |
| 297 | void* fTarget; |
| 298 | }; |
| 299 | |
| 300 | bool SkImageDecoder::DecodeMemoryToTarget(const void* buffer, size_t size, |
| 301 | SkImage::Info* info, |
| 302 | const SkBitmapFactory::Target* target) { |
| 303 | if (NULL == info) { |
| 304 | return false; |
| 305 | } |
| 306 | // FIXME: Just to get this working, implement in terms of existing |
| 307 | // ImageDecoder calls. |
| 308 | SkBitmap bm; |
| 309 | SkMemoryStream stream(buffer, size); |
| 310 | SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(&stream)); |
| 311 | if (decoder.get() != NULL && decoder->decode(&stream, &bm, kDecodeBounds_Mode)) { |
| 312 | // Now set info properly |
| 313 | if (!SkBitmapToImageInfo(bm, info)) { |
| 314 | return false; |
| 315 | } |
| 316 | |
| 317 | // SkBitmapToImageInfo will return false if Index8 is used. kIndex8 |
| 318 | // is not supported by the Info/Target model, since kIndex8 requires |
| 319 | // an SkColorTable, which this model does not keep track of. |
| 320 | SkASSERT(bm.config() != SkBitmap::kIndex8_Config); |
| 321 | |
| 322 | if (NULL == target) { |
| 323 | return true; |
| 324 | } |
| 325 | |
| scroggo@google.com | f98118e | 2013-05-15 14:53:49 +0000 | [diff] [blame^] | 326 | if (target->fRowBytes != SkToU32(bm.rowBytes())) { |
| scroggo@google.com | f8d7d27 | 2013-02-22 21:38:35 +0000 | [diff] [blame] | 327 | if (target->fRowBytes < SkImageMinRowBytes(*info)) { |
| 328 | SkASSERT(!"Desired row bytes is too small"); |
| 329 | return false; |
| 330 | } |
| 331 | bm.setConfig(bm.config(), bm.width(), bm.height(), target->fRowBytes); |
| 332 | } |
| 333 | |
| 334 | TargetAllocator allocator(target->fAddr); |
| 335 | decoder->setAllocator(&allocator); |
| 336 | stream.rewind(); |
| 337 | bool success = decoder->decode(&stream, &bm, kDecodePixels_Mode); |
| 338 | // Remove the allocator, since it's on the stack. |
| 339 | decoder->setAllocator(NULL); |
| 340 | return success; |
| 341 | } |
| 342 | return false; |
| 343 | } |
| 344 | |
| 345 | |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 346 | bool SkImageDecoder::DecodeStream(SkStream* stream, SkBitmap* bm, |
| reed@android.com | b3ade9d | 2009-06-15 13:04:45 +0000 | [diff] [blame] | 347 | SkBitmap::Config pref, Mode mode, Format* format) { |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 348 | SkASSERT(stream); |
| 349 | SkASSERT(bm); |
| 350 | |
| 351 | bool success = false; |
| 352 | SkImageDecoder* codec = SkImageDecoder::Factory(stream); |
| 353 | |
| 354 | if (NULL != codec) { |
| 355 | success = codec->decode(stream, bm, pref, mode); |
| reed@android.com | b3ade9d | 2009-06-15 13:04:45 +0000 | [diff] [blame] | 356 | if (success && format) { |
| 357 | *format = codec->getFormat(); |
| scroggo@google.com | 39edf4c | 2013-04-25 17:33:51 +0000 | [diff] [blame] | 358 | if (kUnknown_Format == *format) { |
| 359 | if (stream->rewind()) { |
| 360 | *format = GetStreamFormat(stream); |
| 361 | } |
| 362 | } |
| reed@android.com | b3ade9d | 2009-06-15 13:04:45 +0000 | [diff] [blame] | 363 | } |
| reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 364 | delete codec; |
| 365 | } |
| 366 | return success; |
| 367 | } |
| scroggo@google.com | c4ebdb0 | 2013-05-01 21:17:27 +0000 | [diff] [blame] | 368 | |
| scroggo@google.com | 8244998 | 2013-05-01 21:40:58 +0000 | [diff] [blame] | 369 | /** |
| 370 | * This function leaks, but that is okay because it is not intended |
| 371 | * to be called. It is only here so that the linker will include the |
| 372 | * decoders. |
| 373 | * Make sure to keep it in sync with images.gyp, so only the encoders |
| 374 | * which are created on a platform are linked. |
| 375 | */ |
| 376 | void force_linking(); |
| 377 | void force_linking() { |
| 378 | SkASSERT(false); |
| 379 | CreateJPEGImageDecoder(); |
| 380 | CreateWEBPImageDecoder(); |
| 381 | CreateBMPImageDecoder(); |
| 382 | CreateICOImageDecoder(); |
| 383 | CreateWBMPImageDecoder(); |
| 384 | // Only link GIF and PNG on platforms that build them. See images.gyp |
| scroggo@google.com | c4ebdb0 | 2013-05-01 21:17:27 +0000 | [diff] [blame] | 385 | #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_NACL) |
| scroggo@google.com | 8244998 | 2013-05-01 21:40:58 +0000 | [diff] [blame] | 386 | CreateGIFImageDecoder(); |
| scroggo@google.com | c4ebdb0 | 2013-05-01 21:17:27 +0000 | [diff] [blame] | 387 | #endif |
| 388 | #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) |
| scroggo@google.com | 8244998 | 2013-05-01 21:40:58 +0000 | [diff] [blame] | 389 | CreatePNGImageDecoder(); |
| scroggo@google.com | c4ebdb0 | 2013-05-01 21:17:27 +0000 | [diff] [blame] | 390 | #endif |
| scroggo@google.com | c4ebdb0 | 2013-05-01 21:17:27 +0000 | [diff] [blame] | 391 | } |