OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 void ImageBitmapFactories::ImageBitmapLoader::decodeImageOnDecoderThread( | 272 void ImageBitmapFactories::ImageBitmapLoader::decodeImageOnDecoderThread( |
273 WebTaskRunner* taskRunner, | 273 WebTaskRunner* taskRunner, |
274 DOMArrayBuffer* arrayBuffer, | 274 DOMArrayBuffer* arrayBuffer, |
275 const String& premultiplyAlphaOption, | 275 const String& premultiplyAlphaOption, |
276 const String& colorSpaceConversionOption) { | 276 const String& colorSpaceConversionOption) { |
277 ASSERT(!isMainThread()); | 277 ASSERT(!isMainThread()); |
278 | 278 |
279 ImageDecoder::AlphaOption alphaOp = ImageDecoder::AlphaPremultiplied; | 279 ImageDecoder::AlphaOption alphaOp = ImageDecoder::AlphaPremultiplied; |
280 if (premultiplyAlphaOption == "none") | 280 if (premultiplyAlphaOption == "none") |
281 alphaOp = ImageDecoder::AlphaNotPremultiplied; | 281 alphaOp = ImageDecoder::AlphaNotPremultiplied; |
282 ImageDecoder::GammaAndColorProfileOption colorSpaceOp = | 282 ImageDecoder::ColorSpaceOption colorSpaceOp = ImageDecoder::ColorSpaceApplied; |
283 ImageDecoder::GammaAndColorProfileApplied; | |
284 if (colorSpaceConversionOption == "none") | 283 if (colorSpaceConversionOption == "none") |
285 colorSpaceOp = ImageDecoder::GammaAndColorProfileIgnored; | 284 colorSpaceOp = ImageDecoder::ColorSpaceIgnored; |
286 std::unique_ptr<ImageDecoder> decoder(ImageDecoder::create( | 285 std::unique_ptr<ImageDecoder> decoder(ImageDecoder::create( |
287 SegmentReader::createFromSkData(SkData::MakeWithoutCopy( | 286 SegmentReader::createFromSkData(SkData::MakeWithoutCopy( |
288 arrayBuffer->data(), arrayBuffer->byteLength())), | 287 arrayBuffer->data(), arrayBuffer->byteLength())), |
289 true, alphaOp, colorSpaceOp)); | 288 true, alphaOp, colorSpaceOp)); |
290 sk_sp<SkImage> frame; | 289 sk_sp<SkImage> frame; |
291 if (decoder) { | 290 if (decoder) { |
292 frame = ImageBitmap::getSkImageFromDecoder(std::move(decoder)); | 291 frame = ImageBitmap::getSkImageFromDecoder(std::move(decoder)); |
293 } | 292 } |
294 taskRunner->postTask( | 293 taskRunner->postTask( |
295 BLINK_FROM_HERE, | 294 BLINK_FROM_HERE, |
(...skipping 21 matching lines...) Expand all Loading... |
317 } | 316 } |
318 m_factory->didFinishLoading(this); | 317 m_factory->didFinishLoading(this); |
319 } | 318 } |
320 | 319 |
321 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { | 320 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { |
322 visitor->trace(m_factory); | 321 visitor->trace(m_factory); |
323 visitor->trace(m_resolver); | 322 visitor->trace(m_resolver); |
324 } | 323 } |
325 | 324 |
326 } // namespace blink | 325 } // namespace blink |
OLD | NEW |