| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 //Get the size of the bitmap. | 180 //Get the size of the bitmap. |
| 181 UINT width; | 181 UINT width; |
| 182 UINT height; | 182 UINT height; |
| 183 if (SUCCEEDED(hr)) { | 183 if (SUCCEEDED(hr)) { |
| 184 hr = piBitmapSourceOriginal->GetSize(&width, &height); | 184 hr = piBitmapSourceOriginal->GetSize(&width, &height); |
| 185 } | 185 } |
| 186 | 186 |
| 187 //Exit early if we're only looking for the bitmap bounds. | 187 //Exit early if we're only looking for the bitmap bounds. |
| 188 if (SUCCEEDED(hr)) { | 188 if (SUCCEEDED(hr)) { |
| 189 bm->setConfig(SkImageInfo::MakeN32Premul(width, height)); | 189 bm->setInfo(SkImageInfo::MakeN32Premul(width, height)); |
| 190 if (kDecodeBounds_WICMode == wicMode) { | 190 if (kDecodeBounds_WICMode == wicMode) { |
| 191 return true; | 191 return true; |
| 192 } | 192 } |
| 193 if (!this->allocPixelRef(bm, NULL)) { | 193 if (!this->allocPixelRef(bm, NULL)) { |
| 194 return false; | 194 return false; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 //Create a format converter. | 198 //Create a format converter. |
| 199 SkTScopedComPtr<IWICFormatConverter> piFormatConverter; | 199 SkTScopedComPtr<IWICFormatConverter> piFormatConverter; |
| (...skipping 255 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 |