| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 bm->eraseColor(SK_ColorTRANSPARENT); | 233 bm->eraseColor(SK_ColorTRANSPARENT); |
| 234 const UINT stride = (UINT) bm->rowBytes(); | 234 const UINT stride = (UINT) bm->rowBytes(); |
| 235 hr = piBitmapSourceConverted->CopyPixels( | 235 hr = piBitmapSourceConverted->CopyPixels( |
| 236 NULL, //Get all the pixels | 236 NULL, //Get all the pixels |
| 237 stride, | 237 stride, |
| 238 stride * height, | 238 stride * height, |
| 239 reinterpret_cast<BYTE *>(bm->getPixels()) | 239 reinterpret_cast<BYTE *>(bm->getPixels()) |
| 240 ); | 240 ); |
| 241 | 241 |
| 242 // Note: we don't need to premultiply here since we specified PBGRA | 242 // Note: we don't need to premultiply here since we specified PBGRA |
| 243 if (ComputeIsOpaque(*bm)) { | 243 if (SkBitmap::ComputeIsOpaque(*bm)) { |
| 244 bm->setAlphaType(kOpaque_SkAlphaType); | 244 bm->setAlphaType(kOpaque_SkAlphaType); |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 return SUCCEEDED(hr); | 248 return SUCCEEDED(hr); |
| 249 } | 249 } |
| 250 | 250 |
| 251 ///////////////////////////////////////////////////////////////////////// | 251 ///////////////////////////////////////////////////////////////////////// |
| 252 | 252 |
| 253 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*); | 253 extern SkImageDecoder* image_decoder_from_stream(SkStreamRewindable*); |
| (...skipping 201 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 |