Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

Issue 2565323003: Move gif image decoder to SkCodec (Closed)
Patch Set: Fix DeferredImageDecoderTestWoPlatform.mixImagesGif Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // This method indicates whether the provided frame has enough data to decode 383 // This method indicates whether the provided frame has enough data to decode
384 // successive frames that depend on it. It is used by clearCacheExceptFrame 384 // successive frames that depend on it. It is used by clearCacheExceptFrame
385 // to determine which frame to keep in cache when the indicated frame is not 385 // to determine which frame to keep in cache when the indicated frame is not
386 // yet sufficiently decoded. 386 // yet sufficiently decoded.
387 // 387 //
388 // The default condition is that the frame status needs to be FramePartial or 388 // The default condition is that the frame status needs to be FramePartial or
389 // FrameComplete, since the data of previous frames is copied in 389 // FrameComplete, since the data of previous frames is copied in
390 // initFrameBuffer() before setting the status to FramePartial. For WebP, 390 // initFrameBuffer() before setting the status to FramePartial. For WebP,
391 // however, the status needs to be FrameComplete since the complete buffer is 391 // however, the status needs to be FrameComplete since the complete buffer is
392 // used to do alpha blending in WEBPImageDecoder::applyPostProcessing(). 392 // used to do alpha blending in WEBPImageDecoder::applyPostProcessing().
393 // And gif is also treated differently, since it relies on SkCodec which
394 // requires the complete required previous frame.
393 // 395 //
394 // Before calling this, verify that frame |index| exists by checking that 396 // Before calling this, verify that frame |index| exists by checking that
395 // |index| is smaller than |m_frameBufferCache|.size(). 397 // |index| is smaller than |m_frameBufferCache|.size().
396 virtual bool FrameStatusSufficientForSuccessors(size_t index) { 398 virtual bool FrameStatusSufficientForSuccessors(size_t index) {
397 DCHECK(index < frame_buffer_cache_.size()); 399 DCHECK(index < frame_buffer_cache_.size());
398 return frame_buffer_cache_[index].GetStatus() != ImageFrame::kFrameEmpty; 400 return frame_buffer_cache_[index].GetStatus() != ImageFrame::kFrameEmpty;
399 } 401 }
400 402
401 private: 403 private:
402 enum class SniffResult { JPEG, PNG, GIF, WEBP, ICO, BMP, kInvalid }; 404 enum class SniffResult { JPEG, PNG, GIF, WEBP, ICO, BMP, kInvalid };
(...skipping 25 matching lines...) Expand all
428 bool has_histogrammed_color_space_ = false; 430 bool has_histogrammed_color_space_ = false;
429 431
430 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; 432 sk_sp<SkColorSpace> embedded_color_space_ = nullptr;
431 bool source_to_target_color_transform_needs_update_ = false; 433 bool source_to_target_color_transform_needs_update_ = false;
432 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; 434 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_;
433 }; 435 };
434 436
435 } // namespace blink 437 } // namespace blink
436 438
437 #endif 439 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698