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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 m_repetitionCount = m_actualDecoder->repetitionCount(); | 309 m_repetitionCount = m_actualDecoder->repetitionCount(); |
310 m_actualDecoder.reset(); | 310 m_actualDecoder.reset(); |
311 // Hold on to m_rwBuffer, which is still needed by createFrameAtIndex. | 311 // Hold on to m_rwBuffer, which is still needed by createFrameAtIndex. |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 sk_sp<SkImage> DeferredImageDecoder::createFrameImageAtIndex( | 315 sk_sp<SkImage> DeferredImageDecoder::createFrameImageAtIndex( |
316 size_t index, | 316 size_t index, |
317 bool knownToBeOpaque) { | 317 bool knownToBeOpaque) { |
318 const SkISize& decodedSize = m_frameGenerator->getFullSize(); | 318 const SkISize& decodedSize = m_frameGenerator->getFullSize(); |
319 ASSERT(decodedSize.width() > 0); | 319 DCHECK_GT(decodedSize.width(), 0); |
320 ASSERT(decodedSize.height() > 0); | 320 DCHECK_GT(decodedSize.height(), 0); |
321 | 321 |
322 sk_sp<SkROBuffer> roBuffer(m_rwBuffer->newRBufferSnapshot()); | 322 sk_sp<SkROBuffer> roBuffer(m_rwBuffer->newRBufferSnapshot()); |
323 RefPtr<SegmentReader> segmentReader = | 323 RefPtr<SegmentReader> segmentReader = |
324 SegmentReader::createFromSkROBuffer(std::move(roBuffer)); | 324 SegmentReader::createFromSkROBuffer(std::move(roBuffer)); |
325 | 325 |
326 SkImageInfo info = SkImageInfo::MakeN32( | 326 SkImageInfo info = SkImageInfo::MakeN32( |
327 decodedSize.width(), decodedSize.height(), | 327 decodedSize.width(), decodedSize.height(), |
328 knownToBeOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType, | 328 knownToBeOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType, |
329 m_colorSpaceForSkImages); | 329 m_colorSpaceForSkImages); |
330 | 330 |
(...skipping 30 matching lines...) Expand all Loading... |
361 | 361 |
362 namespace WTF { | 362 namespace WTF { |
363 template <> | 363 template <> |
364 struct VectorTraits<blink::DeferredFrameData> | 364 struct VectorTraits<blink::DeferredFrameData> |
365 : public SimpleClassVectorTraits<blink::DeferredFrameData> { | 365 : public SimpleClassVectorTraits<blink::DeferredFrameData> { |
366 STATIC_ONLY(VectorTraits); | 366 STATIC_ONLY(VectorTraits); |
367 static const bool canInitializeWithMemset = | 367 static const bool canInitializeWithMemset = |
368 false; // Not all DeferredFrameData members initialize to 0. | 368 false; // Not all DeferredFrameData members initialize to 0. |
369 }; | 369 }; |
370 } | 370 } |
OLD | NEW |