| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Since we've just instantiated a fresh decoder, there's no need to reset its | 75 // Since we've just instantiated a fresh decoder, there's no need to reset its |
| 76 // data. | 76 // data. |
| 77 decoder->setDataInternal(data.release(), dataComplete, false); | 77 decoder->setDataInternal(data.release(), dataComplete, false); |
| 78 | 78 |
| 79 return decoder; | 79 return decoder; |
| 80 } | 80 } |
| 81 | 81 |
| 82 std::unique_ptr<DeferredImageDecoder> DeferredImageDecoder::createForTesting( | 82 std::unique_ptr<DeferredImageDecoder> DeferredImageDecoder::createForTesting( |
| 83 std::unique_ptr<ImageDecoder> actualDecoder) { | 83 std::unique_ptr<ImageDecoder> actualDecoder) { |
| 84 return wrapUnique(new DeferredImageDecoder(std::move(actualDecoder))); | 84 return WTF::wrapUnique(new DeferredImageDecoder(std::move(actualDecoder))); |
| 85 } | 85 } |
| 86 | 86 |
| 87 DeferredImageDecoder::DeferredImageDecoder( | 87 DeferredImageDecoder::DeferredImageDecoder( |
| 88 std::unique_ptr<ImageDecoder> actualDecoder) | 88 std::unique_ptr<ImageDecoder> actualDecoder) |
| 89 : m_allDataReceived(false), | 89 : m_allDataReceived(false), |
| 90 m_actualDecoder(std::move(actualDecoder)), | 90 m_actualDecoder(std::move(actualDecoder)), |
| 91 m_repetitionCount(cAnimationNone), | 91 m_repetitionCount(cAnimationNone), |
| 92 m_canYUVDecode(false), | 92 m_canYUVDecode(false), |
| 93 m_hasHotSpot(false) {} | 93 m_hasHotSpot(false) {} |
| 94 | 94 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 RefPtr<SharedBuffer> data = passData; | 152 RefPtr<SharedBuffer> data = passData; |
| 153 if (m_actualDecoder) { | 153 if (m_actualDecoder) { |
| 154 m_allDataReceived = allDataReceived; | 154 m_allDataReceived = allDataReceived; |
| 155 if (pushDataToDecoder) | 155 if (pushDataToDecoder) |
| 156 m_actualDecoder->setData(data, allDataReceived); | 156 m_actualDecoder->setData(data, allDataReceived); |
| 157 prepareLazyDecodedFrames(); | 157 prepareLazyDecodedFrames(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 if (m_frameGenerator) { | 160 if (m_frameGenerator) { |
| 161 if (!m_rwBuffer) | 161 if (!m_rwBuffer) |
| 162 m_rwBuffer = wrapUnique(new SkRWBuffer(data->size())); | 162 m_rwBuffer = WTF::wrapUnique(new SkRWBuffer(data->size())); |
| 163 | 163 |
| 164 const char* segment = 0; | 164 const char* segment = 0; |
| 165 for (size_t length = data->getSomeData(segment, m_rwBuffer->size()); length; | 165 for (size_t length = data->getSomeData(segment, m_rwBuffer->size()); length; |
| 166 length = data->getSomeData(segment, m_rwBuffer->size())) { | 166 length = data->getSomeData(segment, m_rwBuffer->size())) { |
| 167 DCHECK_GE(data->size(), m_rwBuffer->size() + length); | 167 DCHECK_GE(data->size(), m_rwBuffer->size() + length); |
| 168 const size_t remaining = data->size() - m_rwBuffer->size() - length; | 168 const size_t remaining = data->size() - m_rwBuffer->size() - length; |
| 169 m_rwBuffer->append(segment, length, remaining); | 169 m_rwBuffer->append(segment, length, remaining); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 } | 172 } |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 namespace WTF { | 364 namespace WTF { |
| 365 template <> | 365 template <> |
| 366 struct VectorTraits<blink::DeferredFrameData> | 366 struct VectorTraits<blink::DeferredFrameData> |
| 367 : public SimpleClassVectorTraits<blink::DeferredFrameData> { | 367 : public SimpleClassVectorTraits<blink::DeferredFrameData> { |
| 368 STATIC_ONLY(VectorTraits); | 368 STATIC_ONLY(VectorTraits); |
| 369 static const bool canInitializeWithMemset = | 369 static const bool canInitializeWithMemset = |
| 370 false; // Not all DeferredFrameData members initialize to 0. | 370 false; // Not all DeferredFrameData members initialize to 0. |
| 371 }; | 371 }; |
| 372 } | 372 } |
| OLD | NEW |