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

Side by Side Diff: Source/core/platform/graphics/chromium/DeferredImageDecoder.h

Issue 17999003: Deferred image decoding to support animated GIFs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: done Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef DeferredImageDecoder_h 26 #ifndef DeferredImageDecoder_h
27 #define DeferredImageDecoder_h 27 #define DeferredImageDecoder_h
28 28
29 #include "SkBitmap.h" 29 #include "SkBitmap.h"
30 #include "core/platform/graphics/ImageSource.h" 30 #include "core/platform/graphics/ImageSource.h"
31 #include "core/platform/graphics/IntSize.h" 31 #include "core/platform/graphics/IntSize.h"
32 #include "core/platform/image-decoders/ImageDecoder.h" 32 #include "core/platform/image-decoders/ImageDecoder.h"
33 #include <wtf/Forward.h> 33 #include "wtf/Forward.h"
34 #include "wtf/OwnPtr.h"
35 #include "wtf/Vector.h"
34 36
35 namespace WebCore { 37 namespace WebCore {
36 38
37 class ImageFrameGenerator; 39 class ImageFrameGenerator;
38 class SharedBuffer; 40 class SharedBuffer;
39 41
40 class DeferredImageDecoder { 42 class DeferredImageDecoder {
41 public: 43 public:
42 ~DeferredImageDecoder(); 44 ~DeferredImageDecoder();
43 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima geSource::AlphaOption, ImageSource::GammaAndColorProfileOption); 45 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima geSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
(...skipping 18 matching lines...) Expand all
62 size_t clearCacheExceptFrame(size_t); 64 size_t clearCacheExceptFrame(size_t);
63 bool frameHasAlphaAtIndex(size_t index) const; 65 bool frameHasAlphaAtIndex(size_t index) const;
64 bool frameIsCompleteAtIndex(size_t) const; 66 bool frameIsCompleteAtIndex(size_t) const;
65 float frameDurationAtIndex(size_t) const; 67 float frameDurationAtIndex(size_t) const;
66 unsigned frameBytesAtIndex(size_t index) const; 68 unsigned frameBytesAtIndex(size_t index) const;
67 ImageOrientation orientation() const; 69 ImageOrientation orientation() const;
68 bool hotSpot(IntPoint&) const; 70 bool hotSpot(IntPoint&) const;
69 71
70 private: 72 private:
71 explicit DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder); 73 explicit DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder);
72 SkBitmap createLazyDecodingBitmap(); 74 void prepareLazyDecodedFrames();
75 SkBitmap createLazyDecodingBitmap(size_t index);
76 void activateLazyDecoding();
73 void setData(PassRefPtr<SharedBuffer>, bool allDataReceived); 77 void setData(PassRefPtr<SharedBuffer>, bool allDataReceived);
74 78
75 RefPtr<SharedBuffer> m_data; 79 RefPtr<SharedBuffer> m_data;
76 bool m_allDataReceived; 80 bool m_allDataReceived;
77 OwnPtr<ImageDecoder> m_actualDecoder; 81 OwnPtr<ImageDecoder> m_actualDecoder;
78 82
79 IntSize m_size; 83 IntSize m_size;
80 ImageOrientation m_orientation; 84 ImageOrientation m_orientation;
85 int m_repetitionCount;
81 86
82 ImageFrame m_lazyDecodedFrame; 87 Vector<OwnPtr<ImageFrame> > m_lazyDecodedFrames;
83 RefPtr<ImageFrameGenerator> m_frameGenerator; 88 RefPtr<ImageFrameGenerator> m_frameGenerator;
84 89
85 static bool s_enabled; 90 static bool s_enabled;
86 }; 91 };
87 92
88 } // namespace WebCore 93 } // namespace WebCore
89 94
90 #endif 95 #endif
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698