| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 bool allDataReceived) { | 49 bool allDataReceived) { |
| 50 RefPtr<SharedBuffer> data = passData; | 50 RefPtr<SharedBuffer> data = passData; |
| 51 | 51 |
| 52 if (m_decoder) { | 52 if (m_decoder) { |
| 53 m_decoder->setData(data.release(), allDataReceived); | 53 m_decoder->setData(data.release(), allDataReceived); |
| 54 // If the decoder is pre-instantiated, it means we've already validated the | 54 // If the decoder is pre-instantiated, it means we've already validated the |
| 55 // data/signature at some point. | 55 // data/signature at some point. |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 | 58 |
| 59 m_decoder = DeferredImageDecoder::create( | 59 m_decoder = DeferredImageDecoder::create(data, allDataReceived, |
| 60 data, allDataReceived, ImageDecoder::AlphaPremultiplied, | 60 ImageDecoder::AlphaPremultiplied, |
| 61 ImageDecoder::GammaAndColorProfileApplied); | 61 ImageDecoder::ColorSpaceApplied); |
| 62 | 62 |
| 63 // Insufficient data is not a failure. | 63 // Insufficient data is not a failure. |
| 64 return m_decoder || !ImageDecoder::hasSufficientDataToSniffImageType(*data); | 64 return m_decoder || !ImageDecoder::hasSufficientDataToSniffImageType(*data); |
| 65 } | 65 } |
| 66 | 66 |
| 67 String ImageSource::filenameExtension() const { | 67 String ImageSource::filenameExtension() const { |
| 68 return m_decoder ? m_decoder->filenameExtension() : String(); | 68 return m_decoder ? m_decoder->filenameExtension() : String(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool ImageSource::isSizeAvailable() { | 71 bool ImageSource::isSizeAvailable() { |
| 72 return m_decoder && m_decoder->isSizeAvailable(); | 72 return m_decoder && m_decoder->isSizeAvailable(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool ImageSource::hasColorProfile() const { | 75 bool ImageSource::hasColorProfile() const { |
| 76 return m_decoder && m_decoder->hasColorProfile(); | 76 return m_decoder && m_decoder->hasColorSpace(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 IntSize ImageSource::size( | 79 IntSize ImageSource::size( |
| 80 RespectImageOrientationEnum shouldRespectOrientation) const { | 80 RespectImageOrientationEnum shouldRespectOrientation) const { |
| 81 return frameSizeAtIndex(0, shouldRespectOrientation); | 81 return frameSizeAtIndex(0, shouldRespectOrientation); |
| 82 } | 82 } |
| 83 | 83 |
| 84 IntSize ImageSource::frameSizeAtIndex( | 84 IntSize ImageSource::frameSizeAtIndex( |
| 85 size_t index, | 85 size_t index, |
| 86 RespectImageOrientationEnum shouldRespectOrientation) const { | 86 RespectImageOrientationEnum shouldRespectOrientation) const { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 bool ImageSource::frameIsCompleteAtIndex(size_t index) const { | 140 bool ImageSource::frameIsCompleteAtIndex(size_t index) const { |
| 141 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); | 141 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); |
| 142 } | 142 } |
| 143 | 143 |
| 144 size_t ImageSource::frameBytesAtIndex(size_t index) const { | 144 size_t ImageSource::frameBytesAtIndex(size_t index) const { |
| 145 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; | 145 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace blink | 148 } // namespace blink |
| OLD | NEW |