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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 class PLATFORM_EXPORT DeferredImageDecoder final { | 47 class PLATFORM_EXPORT DeferredImageDecoder final { |
48 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder); | 48 WTF_MAKE_NONCOPYABLE(DeferredImageDecoder); |
49 USING_FAST_MALLOC(DeferredImageDecoder); | 49 USING_FAST_MALLOC(DeferredImageDecoder); |
50 | 50 |
51 public: | 51 public: |
52 static std::unique_ptr<DeferredImageDecoder> create( | 52 static std::unique_ptr<DeferredImageDecoder> create( |
53 PassRefPtr<SharedBuffer> data, | 53 PassRefPtr<SharedBuffer> data, |
54 bool dataComplete, | 54 bool dataComplete, |
55 ImageDecoder::AlphaOption, | 55 ImageDecoder::AlphaOption, |
56 ImageDecoder::GammaAndColorProfileOption); | 56 ImageDecoder::ColorSpaceOption); |
57 | 57 |
58 static std::unique_ptr<DeferredImageDecoder> createForTesting( | 58 static std::unique_ptr<DeferredImageDecoder> createForTesting( |
59 std::unique_ptr<ImageDecoder>); | 59 std::unique_ptr<ImageDecoder>); |
60 | 60 |
61 ~DeferredImageDecoder(); | 61 ~DeferredImageDecoder(); |
62 | 62 |
63 String filenameExtension() const; | 63 String filenameExtension() const; |
64 | 64 |
65 sk_sp<SkImage> createFrameAtIndex(size_t); | 65 sk_sp<SkImage> createFrameAtIndex(size_t); |
66 | 66 |
67 PassRefPtr<SharedBuffer> data(); | 67 PassRefPtr<SharedBuffer> data(); |
68 void setData(PassRefPtr<SharedBuffer> data, bool allDataReceived); | 68 void setData(PassRefPtr<SharedBuffer> data, bool allDataReceived); |
69 | 69 |
70 bool isSizeAvailable(); | 70 bool isSizeAvailable(); |
71 bool hasColorProfile() const; | 71 bool hasColorSpace() const; |
72 IntSize size() const; | 72 IntSize size() const; |
73 IntSize frameSizeAtIndex(size_t index) const; | 73 IntSize frameSizeAtIndex(size_t index) const; |
74 size_t frameCount(); | 74 size_t frameCount(); |
75 int repetitionCount() const; | 75 int repetitionCount() const; |
76 size_t clearCacheExceptFrame(size_t index); | 76 size_t clearCacheExceptFrame(size_t index); |
77 bool frameHasAlphaAtIndex(size_t index) const; | 77 bool frameHasAlphaAtIndex(size_t index) const; |
78 bool frameIsCompleteAtIndex(size_t index) const; | 78 bool frameIsCompleteAtIndex(size_t index) const; |
79 float frameDurationAtIndex(size_t index) const; | 79 float frameDurationAtIndex(size_t index) const; |
80 size_t frameBytesAtIndex(size_t index) const; | 80 size_t frameBytesAtIndex(size_t index) const; |
81 ImageOrientation orientationAtIndex(size_t index) const; | 81 ImageOrientation orientationAtIndex(size_t index) const; |
(...skipping 16 matching lines...) Expand all Loading... |
98 | 98 |
99 // Copy of the data that is passed in, used by deferred decoding. | 99 // Copy of the data that is passed in, used by deferred decoding. |
100 // Allows creating readonly snapshots that may be read in another thread. | 100 // Allows creating readonly snapshots that may be read in another thread. |
101 std::unique_ptr<SkRWBuffer> m_rwBuffer; | 101 std::unique_ptr<SkRWBuffer> m_rwBuffer; |
102 bool m_allDataReceived; | 102 bool m_allDataReceived; |
103 std::unique_ptr<ImageDecoder> m_actualDecoder; | 103 std::unique_ptr<ImageDecoder> m_actualDecoder; |
104 | 104 |
105 String m_filenameExtension; | 105 String m_filenameExtension; |
106 IntSize m_size; | 106 IntSize m_size; |
107 int m_repetitionCount; | 107 int m_repetitionCount; |
108 bool m_hasColorProfile; | 108 bool m_hasColorSpace; |
109 bool m_canYUVDecode; | 109 bool m_canYUVDecode; |
110 bool m_hasHotSpot; | 110 bool m_hasHotSpot; |
111 IntPoint m_hotSpot; | 111 IntPoint m_hotSpot; |
112 | 112 |
113 // Caches frame state information. | 113 // Caches frame state information. |
114 Vector<DeferredFrameData> m_frameData; | 114 Vector<DeferredFrameData> m_frameData; |
115 RefPtr<ImageFrameGenerator> m_frameGenerator; | 115 RefPtr<ImageFrameGenerator> m_frameGenerator; |
116 }; | 116 }; |
117 | 117 |
118 } // namespace blink | 118 } // namespace blink |
119 | 119 |
120 #endif | 120 #endif |
OLD | NEW |