| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> | 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> |
| 4 * Copyright (C) 2008, Google Inc. All rights reserved. | 4 * Copyright (C) 2008, Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 RefPtr<SharedBuffer> data = passData; | 51 RefPtr<SharedBuffer> data = passData; |
| 52 | 52 |
| 53 if (m_decoder) { | 53 if (m_decoder) { |
| 54 m_decoder->setData(data.release(), allDataReceived); | 54 m_decoder->setData(data.release(), allDataReceived); |
| 55 // If the decoder is pre-instantiated, it means we've already validated the | 55 // If the decoder is pre-instantiated, it means we've already validated the |
| 56 // data/signature at some point. | 56 // data/signature at some point. |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { | 60 if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) { |
| 61 m_decoder = DeferredImageDecoder::create( | 61 m_decoder = DeferredImageDecoder::create(data, allDataReceived, |
| 62 data, allDataReceived, ImageDecoder::AlphaPremultiplied, | 62 ImageDecoder::AlphaPremultiplied, |
| 63 ImageDecoder::ColorSpaceTagged, nullptr); | 63 ColorBehavior::tag()); |
| 64 } else { | 64 } else { |
| 65 m_decoder = DeferredImageDecoder::create( | 65 m_decoder = DeferredImageDecoder::create( |
| 66 data, allDataReceived, ImageDecoder::AlphaPremultiplied, | 66 data, allDataReceived, ImageDecoder::AlphaPremultiplied, |
| 67 ImageDecoder::ColorSpaceTransformed, | 67 ColorBehavior::transformToGlobalTarget()); |
| 68 ImageDecoder::globalTargetColorSpace()); | |
| 69 } | 68 } |
| 70 | 69 |
| 71 // Insufficient data is not a failure. | 70 // Insufficient data is not a failure. |
| 72 return m_decoder || !ImageDecoder::hasSufficientDataToSniffImageType(*data); | 71 return m_decoder || !ImageDecoder::hasSufficientDataToSniffImageType(*data); |
| 73 } | 72 } |
| 74 | 73 |
| 75 String ImageSource::filenameExtension() const { | 74 String ImageSource::filenameExtension() const { |
| 76 return m_decoder ? m_decoder->filenameExtension() : String(); | 75 return m_decoder ? m_decoder->filenameExtension() : String(); |
| 77 } | 76 } |
| 78 | 77 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 146 |
| 148 bool ImageSource::frameIsCompleteAtIndex(size_t index) const { | 147 bool ImageSource::frameIsCompleteAtIndex(size_t index) const { |
| 149 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); | 148 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); |
| 150 } | 149 } |
| 151 | 150 |
| 152 size_t ImageSource::frameBytesAtIndex(size_t index) const { | 151 size_t ImageSource::frameBytesAtIndex(size_t index) const { |
| 153 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; | 152 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; |
| 154 } | 153 } |
| 155 | 154 |
| 156 } // namespace blink | 155 } // namespace blink |
| OLD | NEW |