OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkTypes.h" | 9 #include "SkTypes.h" |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 * Helper function to decode an SkStream. | 60 * Helper function to decode an SkStream. |
61 * @param stream SkStream to decode. Must be at the beginning. | 61 * @param stream SkStream to decode. Must be at the beginning. |
62 * @param bm SkBitmap to decode into. Only used if wicMode is kDecodeBoun
ds_WICMode or | 62 * @param bm SkBitmap to decode into. Only used if wicMode is kDecodeBoun
ds_WICMode or |
63 * kDecodePixels_WICMode, in which case it must not be NULL. | 63 * kDecodePixels_WICMode, in which case it must not be NULL. |
64 * @param format Out parameter for the SkImageDecoder::Format of the SkStre
am. Only used if | 64 * @param format Out parameter for the SkImageDecoder::Format of the SkStre
am. Only used if |
65 * wicMode is kDecodeFormat_WICMode. | 65 * wicMode is kDecodeFormat_WICMode. |
66 */ | 66 */ |
67 bool decodeStream(SkStream* stream, SkBitmap* bm, WICModes wicMode, Format*
format) const; | 67 bool decodeStream(SkStream* stream, SkBitmap* bm, WICModes wicMode, Format*
format) const; |
68 | 68 |
69 protected: | 69 protected: |
70 Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE; | 70 Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) override; |
71 }; | 71 }; |
72 | 72 |
73 struct FormatConversion { | 73 struct FormatConversion { |
74 GUID fGuidFormat; | 74 GUID fGuidFormat; |
75 SkImageDecoder::Format fFormat; | 75 SkImageDecoder::Format fFormat; |
76 }; | 76 }; |
77 | 77 |
78 static const FormatConversion gFormatConversions[] = { | 78 static const FormatConversion gFormatConversions[] = { |
79 { GUID_ContainerFormatBmp, SkImageDecoder::kBMP_Format }, | 79 { GUID_ContainerFormatBmp, SkImageDecoder::kBMP_Format }, |
80 { GUID_ContainerFormatGif, SkImageDecoder::kGIF_Format }, | 80 { GUID_ContainerFormatGif, SkImageDecoder::kGIF_Format }, |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) { | 455 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) { |
456 SkImageDecoder::Format format; | 456 SkImageDecoder::Format format; |
457 SkImageDecoder_WIC codec; | 457 SkImageDecoder_WIC codec; |
458 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM
ode, &format)) { | 458 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM
ode, &format)) { |
459 format = SkImageDecoder::kUnknown_Format; | 459 format = SkImageDecoder::kUnknown_Format; |
460 } | 460 } |
461 return format; | 461 return format; |
462 } | 462 } |
463 | 463 |
464 static SkImageDecoder_FormatReg gFormatReg(get_format_wic); | 464 static SkImageDecoder_FormatReg gFormatReg(get_format_wic); |
OLD | NEW |