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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp

Issue 1812273003: Eliminate copies of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 * 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 24 matching lines...) Expand all
35 GIFImageDecoder::GIFImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOp tion colorOptions, size_t maxDecodedBytes) 35 GIFImageDecoder::GIFImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOp tion colorOptions, size_t maxDecodedBytes)
36 : ImageDecoder(alphaOption, colorOptions, maxDecodedBytes) 36 : ImageDecoder(alphaOption, colorOptions, maxDecodedBytes)
37 , m_repetitionCount(cAnimationLoopOnce) 37 , m_repetitionCount(cAnimationLoopOnce)
38 { 38 {
39 } 39 }
40 40
41 GIFImageDecoder::~GIFImageDecoder() 41 GIFImageDecoder::~GIFImageDecoder()
42 { 42 {
43 } 43 }
44 44
45 void GIFImageDecoder::onSetData(SharedBuffer* data) 45 void GIFImageDecoder::onSetData(SegmentReader* data)
46 { 46 {
47 if (m_reader) 47 if (m_reader)
48 m_reader->setData(data); 48 m_reader->setData(data);
49 } 49 }
50 50
51 int GIFImageDecoder::repetitionCount() const 51 int GIFImageDecoder::repetitionCount() const
52 { 52 {
53 // This value can arrive at any point in the image data stream. Most GIFs 53 // This value can arrive at any point in the image data stream. Most GIFs
54 // in the wild declare it near the beginning of the file, so it usually is 54 // in the wild declare it near the beginning of the file, so it usually is
55 // set by the time we've decoded the size, but (depending on the GIF and the 55 // set by the time we've decoded the size, but (depending on the GIF and the
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 // Update our status to be partially complete. 369 // Update our status to be partially complete.
370 buffer->setStatus(ImageFrame::FramePartial); 370 buffer->setStatus(ImageFrame::FramePartial);
371 371
372 // Reset the alpha pixel tracker for this frame. 372 // Reset the alpha pixel tracker for this frame.
373 m_currentBufferSawAlpha = false; 373 m_currentBufferSawAlpha = false;
374 return true; 374 return true;
375 } 375 }
376 376
377 } // namespace blink 377 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698