| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 PassRefPtr<SharedBuffer> DeferredImageDecoder::Data() { | 130 PassRefPtr<SharedBuffer> DeferredImageDecoder::Data() { |
| 131 if (!rw_buffer_) | 131 if (!rw_buffer_) |
| 132 return nullptr; | 132 return nullptr; |
| 133 sk_sp<SkROBuffer> ro_buffer(rw_buffer_->makeROBufferSnapshot()); | 133 sk_sp<SkROBuffer> ro_buffer(rw_buffer_->makeROBufferSnapshot()); |
| 134 RefPtr<SharedBuffer> shared_buffer = SharedBuffer::Create(); | 134 RefPtr<SharedBuffer> shared_buffer = SharedBuffer::Create(); |
| 135 SkROBuffer::Iter it(ro_buffer.get()); | 135 SkROBuffer::Iter it(ro_buffer.get()); |
| 136 do { | 136 do { |
| 137 shared_buffer->Append(static_cast<const char*>(it.data()), it.size()); | 137 shared_buffer->Append(static_cast<const char*>(it.data()), it.size()); |
| 138 } while (it.next()); | 138 } while (it.next()); |
| 139 return shared_buffer.Release(); | 139 return shared_buffer; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void DeferredImageDecoder::SetData(PassRefPtr<SharedBuffer> data, | 142 void DeferredImageDecoder::SetData(PassRefPtr<SharedBuffer> data, |
| 143 bool all_data_received) { | 143 bool all_data_received) { |
| 144 SetDataInternal(std::move(data), all_data_received, true); | 144 SetDataInternal(std::move(data), all_data_received, true); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void DeferredImageDecoder::SetDataInternal(RefPtr<SharedBuffer> data, | 147 void DeferredImageDecoder::SetDataInternal(RefPtr<SharedBuffer> data, |
| 148 bool all_data_received, | 148 bool all_data_received, |
| 149 bool push_data_to_decoder) { | 149 bool push_data_to_decoder) { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 358 |
| 359 namespace WTF { | 359 namespace WTF { |
| 360 template <> | 360 template <> |
| 361 struct VectorTraits<blink::DeferredFrameData> | 361 struct VectorTraits<blink::DeferredFrameData> |
| 362 : public SimpleClassVectorTraits<blink::DeferredFrameData> { | 362 : public SimpleClassVectorTraits<blink::DeferredFrameData> { |
| 363 STATIC_ONLY(VectorTraits); | 363 STATIC_ONLY(VectorTraits); |
| 364 static const bool kCanInitializeWithMemset = | 364 static const bool kCanInitializeWithMemset = |
| 365 false; // Not all DeferredFrameData members initialize to 0. | 365 false; // Not all DeferredFrameData members initialize to 0. |
| 366 }; | 366 }; |
| 367 } | 367 } |
| OLD | NEW |