| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 std::unique_ptr<ImageDecoder> decoder = | 177 std::unique_ptr<ImageDecoder> decoder = |
| 178 ImageDecoder::create(data, true, ImageDecoder::AlphaPremultiplied, | 178 ImageDecoder::create(data, true, ImageDecoder::AlphaPremultiplied, |
| 179 ImageDecoder::ColorSpaceApplied); | 179 ImageDecoder::ColorSpaceApplied); |
| 180 // getYUVComponentSizes was already called and was successful, so | 180 // getYUVComponentSizes was already called and was successful, so |
| 181 // ImageDecoder::create must succeed. | 181 // ImageDecoder::create must succeed. |
| 182 ASSERT(decoder); | 182 ASSERT(decoder); |
| 183 | 183 |
| 184 std::unique_ptr<ImagePlanes> imagePlanes = | 184 std::unique_ptr<ImagePlanes> imagePlanes = |
| 185 wrapUnique(new ImagePlanes(planes, rowBytes)); | 185 makeUnique<ImagePlanes>(planes, rowBytes); |
| 186 decoder->setImagePlanes(std::move(imagePlanes)); | 186 decoder->setImagePlanes(std::move(imagePlanes)); |
| 187 | 187 |
| 188 ASSERT(decoder->canDecodeToYUV()); | 188 ASSERT(decoder->canDecodeToYUV()); |
| 189 | 189 |
| 190 if (decoder->decodeToYUV()) { | 190 if (decoder->decodeToYUV()) { |
| 191 setHasAlpha(0, false); // YUV is always opaque | 191 setHasAlpha(0, false); // YUV is always opaque |
| 192 return true; | 192 return true; |
| 193 } | 193 } |
| 194 | 194 |
| 195 ASSERT(decoder->failed()); | 195 ASSERT(decoder->failed()); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // Setting a dummy ImagePlanes object signals to the decoder that we want to | 375 // Setting a dummy ImagePlanes object signals to the decoder that we want to |
| 376 // do YUV decoding. | 376 // do YUV decoding. |
| 377 std::unique_ptr<ImagePlanes> dummyImagePlanes = wrapUnique(new ImagePlanes); | 377 std::unique_ptr<ImagePlanes> dummyImagePlanes = wrapUnique(new ImagePlanes); |
| 378 decoder->setImagePlanes(std::move(dummyImagePlanes)); | 378 decoder->setImagePlanes(std::move(dummyImagePlanes)); |
| 379 | 379 |
| 380 return updateYUVComponentSizes(decoder.get(), sizeInfo->fSizes, | 380 return updateYUVComponentSizes(decoder.get(), sizeInfo->fSizes, |
| 381 sizeInfo->fWidthBytes); | 381 sizeInfo->fWidthBytes); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace blink | 384 } // namespace blink |
| OLD | NEW |