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::ColorSpaceOption); | 56 ImageDecoder::ColorSpaceOption, |
| 57 sk_sp<SkColorSpace> targetColorSpace); |
57 | 58 |
58 static std::unique_ptr<DeferredImageDecoder> createForTesting( | 59 static std::unique_ptr<DeferredImageDecoder> createForTesting( |
59 std::unique_ptr<ImageDecoder>); | 60 std::unique_ptr<ImageDecoder>); |
60 | 61 |
61 ~DeferredImageDecoder(); | 62 ~DeferredImageDecoder(); |
62 | 63 |
63 String filenameExtension() const; | 64 String filenameExtension() const; |
64 | 65 |
65 sk_sp<SkImage> createFrameAtIndex(size_t); | 66 sk_sp<SkImage> createFrameAtIndex(size_t); |
66 | 67 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // Copy of the data that is passed in, used by deferred decoding. | 100 // Copy of the data that is passed in, used by deferred decoding. |
100 // Allows creating readonly snapshots that may be read in another thread. | 101 // Allows creating readonly snapshots that may be read in another thread. |
101 std::unique_ptr<SkRWBuffer> m_rwBuffer; | 102 std::unique_ptr<SkRWBuffer> m_rwBuffer; |
102 bool m_allDataReceived; | 103 bool m_allDataReceived; |
103 std::unique_ptr<ImageDecoder> m_actualDecoder; | 104 std::unique_ptr<ImageDecoder> m_actualDecoder; |
104 | 105 |
105 String m_filenameExtension; | 106 String m_filenameExtension; |
106 IntSize m_size; | 107 IntSize m_size; |
107 int m_repetitionCount; | 108 int m_repetitionCount; |
108 bool m_hasEmbeddedColorSpace = false; | 109 bool m_hasEmbeddedColorSpace = false; |
| 110 sk_sp<SkColorSpace> m_colorSpaceForSkImages; |
109 bool m_canYUVDecode; | 111 bool m_canYUVDecode; |
110 bool m_hasHotSpot; | 112 bool m_hasHotSpot; |
111 IntPoint m_hotSpot; | 113 IntPoint m_hotSpot; |
112 | 114 |
113 // Caches frame state information. | 115 // Caches frame state information. |
114 Vector<DeferredFrameData> m_frameData; | 116 Vector<DeferredFrameData> m_frameData; |
115 RefPtr<ImageFrameGenerator> m_frameGenerator; | 117 RefPtr<ImageFrameGenerator> m_frameGenerator; |
116 }; | 118 }; |
117 | 119 |
118 } // namespace blink | 120 } // namespace blink |
119 | 121 |
120 #endif | 122 #endif |
OLD | NEW |