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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 repetition_count_ = actual_decoder_->RepetitionCount(); | 306 repetition_count_ = actual_decoder_->RepetitionCount(); |
307 actual_decoder_.reset(); | 307 actual_decoder_.reset(); |
308 // Hold on to m_rwBuffer, which is still needed by createFrameAtIndex. | 308 // Hold on to m_rwBuffer, which is still needed by createFrameAtIndex. |
309 } | 309 } |
310 } | 310 } |
311 | 311 |
312 sk_sp<SkImage> DeferredImageDecoder::CreateFrameImageAtIndex( | 312 sk_sp<SkImage> DeferredImageDecoder::CreateFrameImageAtIndex( |
313 size_t index, | 313 size_t index, |
314 bool known_to_be_opaque) { | 314 bool known_to_be_opaque) { |
315 const SkISize& decoded_size = frame_generator_->GetFullSize(); | 315 const SkISize& decoded_size = frame_generator_->GetFullSize(); |
316 ASSERT(decoded_size.width() > 0); | 316 DCHECK_GT(decoded_size.width(), 0); |
317 ASSERT(decoded_size.height() > 0); | 317 DCHECK_GE(decoded_size.height(), 0); |
tkent
2017/04/11 22:43:25
Should be DCHECK_GT, not DCHCK_GE
Hwanseung Lee
2017/04/11 22:52:21
Done.
| |
318 | 318 |
319 sk_sp<SkROBuffer> ro_buffer(rw_buffer_->newRBufferSnapshot()); | 319 sk_sp<SkROBuffer> ro_buffer(rw_buffer_->newRBufferSnapshot()); |
320 RefPtr<SegmentReader> segment_reader = | 320 RefPtr<SegmentReader> segment_reader = |
321 SegmentReader::CreateFromSkROBuffer(std::move(ro_buffer)); | 321 SegmentReader::CreateFromSkROBuffer(std::move(ro_buffer)); |
322 | 322 |
323 SkImageInfo info = SkImageInfo::MakeN32( | 323 SkImageInfo info = SkImageInfo::MakeN32( |
324 decoded_size.width(), decoded_size.height(), | 324 decoded_size.width(), decoded_size.height(), |
325 known_to_be_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType, | 325 known_to_be_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType, |
326 color_space_for_sk_images_); | 326 color_space_for_sk_images_); |
327 | 327 |
(...skipping 30 matching lines...) Expand all 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 |