| 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) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // Returns a caller-owned decoder of the appropriate type. Returns nullptr
if | 99 // Returns a caller-owned decoder of the appropriate type. Returns nullptr
if |
| 100 // we can't sniff a supported type from the provided data (possibly | 100 // we can't sniff a supported type from the provided data (possibly |
| 101 // because there isn't enough data yet). | 101 // because there isn't enough data yet). |
| 102 // Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes(). | 102 // Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes(). |
| 103 static std::unique_ptr<ImageDecoder> create(PassRefPtr<SegmentReader> data,
bool dataComplete, | 103 static std::unique_ptr<ImageDecoder> create(PassRefPtr<SegmentReader> data,
bool dataComplete, |
| 104 AlphaOption, GammaAndColorProfileOption); | 104 AlphaOption, GammaAndColorProfileOption); |
| 105 static std::unique_ptr<ImageDecoder> create(PassRefPtr<SharedBuffer> data, b
ool dataComplete, | 105 static std::unique_ptr<ImageDecoder> create(PassRefPtr<SharedBuffer> data, b
ool dataComplete, |
| 106 AlphaOption alphaoption, GammaAndColorProfileOption colorOptions) | 106 AlphaOption alphaoption, GammaAndColorProfileOption colorOptions) |
| 107 { | 107 { |
| 108 return create(SegmentReader::createFromSharedBuffer(data), dataComplete,
alphaoption, colorOptions); | 108 return create(SegmentReader::createFromSharedBuffer(std::move(data)), da
taComplete, alphaoption, colorOptions); |
| 109 } | 109 } |
| 110 | 110 |
| 111 | 111 |
| 112 virtual String filenameExtension() const = 0; | 112 virtual String filenameExtension() const = 0; |
| 113 | 113 |
| 114 bool isAllDataReceived() const { return m_isAllDataReceived; } | 114 bool isAllDataReceived() const { return m_isAllDataReceived; } |
| 115 | 115 |
| 116 // Returns true if the buffer holds enough data to instantiate a decoder. | 116 // Returns true if the buffer holds enough data to instantiate a decoder. |
| 117 // This is useful for callers to determine whether a decoder instantiation | 117 // This is useful for callers to determine whether a decoder instantiation |
| 118 // failure is due to insufficient or bad data. | 118 // failure is due to insufficient or bad data. |
| 119 static bool hasSufficientDataToSniffImageType(const SharedBuffer&); | 119 static bool hasSufficientDataToSniffImageType(const SharedBuffer&); |
| 120 | 120 |
| 121 void setData(PassRefPtr<SegmentReader> data, bool allDataReceived) | 121 void setData(PassRefPtr<SegmentReader> data, bool allDataReceived) |
| 122 { | 122 { |
| 123 if (m_failed) | 123 if (m_failed) |
| 124 return; | 124 return; |
| 125 m_data = data; | 125 m_data = data; |
| 126 m_isAllDataReceived = allDataReceived; | 126 m_isAllDataReceived = allDataReceived; |
| 127 onSetData(m_data.get()); | 127 onSetData(m_data.get()); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) | 130 void setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) |
| 131 { | 131 { |
| 132 setData(SegmentReader::createFromSharedBuffer(data), allDataReceived); | 132 setData(SegmentReader::createFromSharedBuffer(std::move(data)), allDataR
eceived); |
| 133 } | 133 } |
| 134 | 134 |
| 135 virtual void onSetData(SegmentReader* data) { } | 135 virtual void onSetData(SegmentReader* data) { } |
| 136 | 136 |
| 137 bool isSizeAvailable() | 137 bool isSizeAvailable() |
| 138 { | 138 { |
| 139 if (m_failed) | 139 if (m_failed) |
| 140 return false; | 140 return false; |
| 141 if (!m_sizeAvailable) | 141 if (!m_sizeAvailable) |
| 142 decodeSize(); | 142 decodeSize(); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 ImageFrame::ICCProfile m_colorProfile; | 361 ImageFrame::ICCProfile m_colorProfile; |
| 362 | 362 |
| 363 #if USE(QCMSLIB) | 363 #if USE(QCMSLIB) |
| 364 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; | 364 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; |
| 365 #endif | 365 #endif |
| 366 }; | 366 }; |
| 367 | 367 |
| 368 } // namespace blink | 368 } // namespace blink |
| 369 | 369 |
| 370 #endif | 370 #endif |
| OLD | NEW |