OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebGLImageConversion_h | 5 #ifndef WebGLImageConversion_h |
6 #define WebGLImageConversion_h | 6 #define WebGLImageConversion_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/graphics/Image.h" | 9 #include "platform/graphics/Image.h" |
10 #include "platform/graphics/skia/ImagePixelLocker.h" | 10 #include "platform/graphics/skia/ImagePixelLocker.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 }; | 128 }; |
129 | 129 |
130 class PLATFORM_EXPORT ImageExtractor final { | 130 class PLATFORM_EXPORT ImageExtractor final { |
131 STACK_ALLOCATED(); | 131 STACK_ALLOCATED(); |
132 WTF_MAKE_NONCOPYABLE(ImageExtractor); | 132 WTF_MAKE_NONCOPYABLE(ImageExtractor); |
133 | 133 |
134 public: | 134 public: |
135 ImageExtractor(Image*, | 135 ImageExtractor(Image*, |
136 ImageHtmlDomSource, | 136 ImageHtmlDomSource, |
137 bool premultiplyAlpha, | 137 bool premultiplyAlpha, |
138 bool ignoreGammaAndColorProfile); | 138 bool ignoreColorSpace); |
139 | 139 |
140 const void* imagePixelData() { | 140 const void* imagePixelData() { |
141 return m_imagePixelLocker ? m_imagePixelLocker->pixels() : nullptr; | 141 return m_imagePixelLocker ? m_imagePixelLocker->pixels() : nullptr; |
142 } | 142 } |
143 unsigned imageWidth() { return m_imageWidth; } | 143 unsigned imageWidth() { return m_imageWidth; } |
144 unsigned imageHeight() { return m_imageHeight; } | 144 unsigned imageHeight() { return m_imageHeight; } |
145 DataFormat imageSourceFormat() { return m_imageSourceFormat; } | 145 DataFormat imageSourceFormat() { return m_imageSourceFormat; } |
146 AlphaOp imageAlphaOp() { return m_alphaOp; } | 146 AlphaOp imageAlphaOp() { return m_alphaOp; } |
147 unsigned imageSourceUnpackAlignment() { | 147 unsigned imageSourceUnpackAlignment() { |
148 return m_imageSourceUnpackAlignment; | 148 return m_imageSourceUnpackAlignment; |
149 } | 149 } |
150 | 150 |
151 private: | 151 private: |
152 // Extracts the image and keeps track of its status, such as width, height, | 152 // Extracts the image and keeps track of its status, such as width, height, |
153 // Source Alignment, format, AlphaOp, etc. This needs to lock the resources | 153 // Source Alignment, format, AlphaOp, etc. This needs to lock the resources |
154 // or relevant data if needed. | 154 // or relevant data if needed. |
155 void extractImage(bool premultiplyAlpha, bool ignoreGammaAndColorProfile); | 155 void extractImage(bool premultiplyAlpha, bool ignoreColorSpace); |
156 | 156 |
157 Image* m_image; | 157 Image* m_image; |
158 Optional<ImagePixelLocker> m_imagePixelLocker; | 158 Optional<ImagePixelLocker> m_imagePixelLocker; |
159 ImageHtmlDomSource m_imageHtmlDomSource; | 159 ImageHtmlDomSource m_imageHtmlDomSource; |
160 unsigned m_imageWidth; | 160 unsigned m_imageWidth; |
161 unsigned m_imageHeight; | 161 unsigned m_imageHeight; |
162 DataFormat m_imageSourceFormat; | 162 DataFormat m_imageSourceFormat; |
163 AlphaOp m_alphaOp; | 163 AlphaOp m_alphaOp; |
164 unsigned m_imageSourceUnpackAlignment; | 164 unsigned m_imageSourceUnpackAlignment; |
165 }; | 165 }; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 uint8_t* destinationData); | 275 uint8_t* destinationData); |
276 static void packPixels(const uint8_t* sourceData, | 276 static void packPixels(const uint8_t* sourceData, |
277 DataFormat sourceDataFormat, | 277 DataFormat sourceDataFormat, |
278 unsigned pixelsPerRow, | 278 unsigned pixelsPerRow, |
279 uint8_t* destinationData); | 279 uint8_t* destinationData); |
280 }; | 280 }; |
281 | 281 |
282 } // namespace blink | 282 } // namespace blink |
283 | 283 |
284 #endif // WebGLImageConversion_h | 284 #endif // WebGLImageConversion_h |
OLD | NEW |