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 | 9 |
10 #define WIN32_LEAN_AND_MEAN | 10 #define WIN32_LEAN_AND_MEAN |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 bm->eraseColor(SK_ColorTRANSPARENT); | 215 bm->eraseColor(SK_ColorTRANSPARENT); |
216 const UINT stride = bm->rowBytes(); | 216 const UINT stride = bm->rowBytes(); |
217 hr = piBitmapSourceConverted->CopyPixels( | 217 hr = piBitmapSourceConverted->CopyPixels( |
218 NULL, //Get all the pixels | 218 NULL, //Get all the pixels |
219 stride, | 219 stride, |
220 stride * height, | 220 stride * height, |
221 reinterpret_cast<BYTE *>(bm->getPixels()) | 221 reinterpret_cast<BYTE *>(bm->getPixels()) |
222 ); | 222 ); |
223 | 223 |
224 // Note: we don't need to premultiply here since we specified PBGRA | 224 // Note: we don't need to premultiply here since we specified PBGRA |
225 bm->computeAndSetOpaquePredicate(); | 225 if (ComputeIsOpaque(*bm)) { |
| 226 bm->setAlphaType(kOpaque_SkAlphaType); |
| 227 } |
226 } | 228 } |
227 | 229 |
228 return SUCCEEDED(hr); | 230 return SUCCEEDED(hr); |
229 } | 231 } |
230 | 232 |
231 ///////////////////////////////////////////////////////////////////////// | 233 ///////////////////////////////////////////////////////////////////////// |
232 | 234 |
233 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*); | 235 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*); |
234 | 236 |
235 SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) { | 237 SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) { | 437 static SkImageDecoder::Format get_format_wic(SkStreamRewindable* stream) { |
436 SkImageDecoder::Format format; | 438 SkImageDecoder::Format format; |
437 SkImageDecoder_WIC codec; | 439 SkImageDecoder_WIC codec; |
438 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM
ode, &format)) { | 440 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM
ode, &format)) { |
439 format = SkImageDecoder::kUnknown_Format; | 441 format = SkImageDecoder::kUnknown_Format; |
440 } | 442 } |
441 return format; | 443 return format; |
442 } | 444 } |
443 | 445 |
444 static SkImageDecoder_FormatReg gFormatReg(get_format_wic); | 446 static SkImageDecoder_FormatReg gFormatReg(get_format_wic); |
OLD | NEW |