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 20 matching lines...) Expand all Loading... |
31 #include "platform/geometry/IntSize.h" | 31 #include "platform/geometry/IntSize.h" |
32 #include "platform/graphics/ImageFrameGenerator.h" | 32 #include "platform/graphics/ImageFrameGenerator.h" |
33 #include "platform/graphics/ImageSource.h" | 33 #include "platform/graphics/ImageSource.h" |
34 #include "platform/image-decoders/ImageDecoder.h" | 34 #include "platform/image-decoders/ImageDecoder.h" |
35 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
36 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
| 41 class ColorSpaceProfile; |
41 class ImageFrameGenerator; | 42 class ImageFrameGenerator; |
42 class SharedBuffer; | 43 class SharedBuffer; |
43 | 44 |
44 class PLATFORM_EXPORT DeferredImageDecoder { | 45 class PLATFORM_EXPORT DeferredImageDecoder { |
45 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder); | 46 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder); |
46 public: | 47 public: |
47 ~DeferredImageDecoder(); | 48 ~DeferredImageDecoder(); |
48 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima
geSource::AlphaOption, ImageSource::GammaAndColorProfileOption); | 49 static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, Ima
geSource::AlphaOption, ImageSource::GammaAndColorProfileOption); |
49 | 50 |
50 static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDec
oder>); | 51 static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDec
oder>); |
51 | 52 |
52 static bool isLazyDecoded(const SkBitmap&); | 53 static bool isLazyDecoded(const SkBitmap&); |
53 | 54 |
54 static void setEnabled(bool); | 55 static void setEnabled(bool); |
55 static bool enabled(); | 56 static bool enabled(); |
56 | 57 |
57 String filenameExtension() const; | 58 String filenameExtension() const; |
58 | 59 |
59 ImageFrame* frameBufferAtIndex(size_t index); | 60 ImageFrame* frameBufferAtIndex(size_t index); |
60 | 61 |
61 void setData(SharedBuffer& data, bool allDataReceived); | 62 void setData(SharedBuffer& data, bool allDataReceived); |
62 | 63 |
63 bool isSizeAvailable(); | 64 bool isSizeAvailable(); |
64 bool hasColorProfile() const; | 65 bool hasColorProfile() const; |
| 66 PassRefPtr<ColorSpaceProfile> colorProfile() const; |
65 IntSize size() const; | 67 IntSize size() const; |
66 IntSize frameSizeAtIndex(size_t index) const; | 68 IntSize frameSizeAtIndex(size_t index) const; |
67 size_t frameCount(); | 69 size_t frameCount(); |
68 int repetitionCount() const; | 70 int repetitionCount() const; |
69 size_t clearCacheExceptFrame(size_t); | 71 size_t clearCacheExceptFrame(size_t); |
70 bool frameHasAlphaAtIndex(size_t index) const; | 72 bool frameHasAlphaAtIndex(size_t index) const; |
71 bool frameIsCompleteAtIndex(size_t) const; | 73 bool frameIsCompleteAtIndex(size_t) const; |
72 float frameDurationAtIndex(size_t) const; | 74 float frameDurationAtIndex(size_t) const; |
73 unsigned frameBytesAtIndex(size_t index) const; | 75 unsigned frameBytesAtIndex(size_t index) const; |
74 ImageOrientation orientation() const; | 76 ImageOrientation orientation() const; |
(...skipping 12 matching lines...) Expand all Loading... |
87 bool m_allDataReceived; | 89 bool m_allDataReceived; |
88 unsigned m_lastDataSize; | 90 unsigned m_lastDataSize; |
89 bool m_dataChanged; | 91 bool m_dataChanged; |
90 OwnPtr<ImageDecoder> m_actualDecoder; | 92 OwnPtr<ImageDecoder> m_actualDecoder; |
91 | 93 |
92 String m_filenameExtension; | 94 String m_filenameExtension; |
93 IntSize m_size; | 95 IntSize m_size; |
94 ImageOrientation m_orientation; | 96 ImageOrientation m_orientation; |
95 int m_repetitionCount; | 97 int m_repetitionCount; |
96 bool m_hasColorProfile; | 98 bool m_hasColorProfile; |
| 99 RefPtr<ColorSpaceProfile> m_colorProfile; |
97 | 100 |
98 Vector<OwnPtr<ImageFrame> > m_lazyDecodedFrames; | 101 Vector<OwnPtr<ImageFrame> > m_lazyDecodedFrames; |
99 RefPtr<ImageFrameGenerator> m_frameGenerator; | 102 RefPtr<ImageFrameGenerator> m_frameGenerator; |
100 | 103 |
101 static bool s_enabled; | 104 static bool s_enabled; |
102 }; | 105 }; |
103 | 106 |
104 } // namespace WebCore | 107 } // namespace WebCore |
105 | 108 |
106 #endif | 109 #endif |
OLD | NEW |