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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 GLint alignment; | 121 GLint alignment; |
122 GLint rowLength; | 122 GLint rowLength; |
123 GLint imageHeight; | 123 GLint imageHeight; |
124 GLint skipPixels; | 124 GLint skipPixels; |
125 GLint skipRows; | 125 GLint skipRows; |
126 GLint skipImages; | 126 GLint skipImages; |
127 }; | 127 }; |
128 | 128 |
129 class PLATFORM_EXPORT ImageExtractor final { | 129 class PLATFORM_EXPORT ImageExtractor final { |
130 STACK_ALLOCATED(); | 130 STACK_ALLOCATED(); |
| 131 WTF_MAKE_NONCOPYABLE(ImageExtractor); |
| 132 |
131 public: | 133 public: |
132 ImageExtractor(Image*, ImageHtmlDomSource, bool premultiplyAlpha, bool i
gnoreGammaAndColorProfile); | 134 ImageExtractor(Image*, ImageHtmlDomSource, bool premultiplyAlpha, bool i
gnoreGammaAndColorProfile); |
133 | 135 |
134 const void* imagePixelData() { return m_imagePixelLocker ? m_imagePixelL
ocker->pixels() : nullptr; } | 136 const void* imagePixelData() { return m_imagePixelLocker ? m_imagePixelL
ocker->pixels() : nullptr; } |
135 unsigned imageWidth() { return m_imageWidth; } | 137 unsigned imageWidth() { return m_imageWidth; } |
136 unsigned imageHeight() { return m_imageHeight; } | 138 unsigned imageHeight() { return m_imageHeight; } |
137 DataFormat imageSourceFormat() { return m_imageSourceFormat; } | 139 DataFormat imageSourceFormat() { return m_imageSourceFormat; } |
138 AlphaOp imageAlphaOp() { return m_alphaOp; } | 140 AlphaOp imageAlphaOp() { return m_alphaOp; } |
139 unsigned imageSourceUnpackAlignment() { return m_imageSourceUnpackAlignm
ent; } | 141 unsigned imageSourceUnpackAlignment() { return m_imageSourceUnpackAlignm
ent; } |
140 private: | 142 private: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // A sourceUnpackAlignment of zero indicates that the source | 210 // A sourceUnpackAlignment of zero indicates that the source |
209 // data is tightly packed. Non-zero values may take a slow path. | 211 // data is tightly packed. Non-zero values may take a slow path. |
210 // Destination data will have no gaps between rows. | 212 // Destination data will have no gaps between rows. |
211 // Implemented in GraphicsContext3DImagePacking.cpp | 213 // Implemented in GraphicsContext3DImagePacking.cpp |
212 static bool packPixels(const uint8_t* sourceData, DataFormat sourceDataForma
t, unsigned width, unsigned height, unsigned sourceUnpackAlignment, unsigned des
tinationFormat, unsigned destinationType, AlphaOp, void* destinationData, bool f
lipY); | 214 static bool packPixels(const uint8_t* sourceData, DataFormat sourceDataForma
t, unsigned width, unsigned height, unsigned sourceUnpackAlignment, unsigned des
tinationFormat, unsigned destinationType, AlphaOp, void* destinationData, bool f
lipY); |
213 }; | 215 }; |
214 | 216 |
215 } // namespace blink | 217 } // namespace blink |
216 | 218 |
217 #endif // WebGLImageConversion_h | 219 #endif // WebGLImageConversion_h |
OLD | NEW |