| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 unsigned sourceUnpackAlignment, | 222 unsigned sourceUnpackAlignment, |
| 223 Vector<uint8_t>& data); | 223 Vector<uint8_t>& data); |
| 224 | 224 |
| 225 // Extracts the contents of the given ImageData into the passed Vector, | 225 // Extracts the contents of the given ImageData into the passed Vector, |
| 226 // packing the pixel data according to the given format and type, | 226 // packing the pixel data according to the given format and type, |
| 227 // and obeying the flipY and premultiplyAlpha flags. Returns true | 227 // and obeying the flipY and premultiplyAlpha flags. Returns true |
| 228 // upon success. | 228 // upon success. |
| 229 static bool extractImageData(const uint8_t*, | 229 static bool extractImageData(const uint8_t*, |
| 230 DataFormat sourceDataFormat, | 230 DataFormat sourceDataFormat, |
| 231 const IntSize&, | 231 const IntSize&, |
| 232 const IntRect&, |
| 232 GLenum format, | 233 GLenum format, |
| 233 GLenum type, | 234 GLenum type, |
| 234 bool flipY, | 235 bool flipY, |
| 235 bool premultiplyAlpha, | 236 bool premultiplyAlpha, |
| 236 Vector<uint8_t>& data); | 237 Vector<uint8_t>& data); |
| 237 | 238 |
| 238 // Helper function which extracts the user-supplied texture | 239 // Helper function which extracts the user-supplied texture |
| 239 // data, applying the flipY and premultiplyAlpha parameters. | 240 // data, applying the flipY and premultiplyAlpha parameters. |
| 240 // If the data is not tightly packed according to the passed | 241 // If the data is not tightly packed according to the passed |
| 241 // unpackAlignment, the output data will be tightly packed. | 242 // unpackAlignment, the output data will be tightly packed. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 uint8_t* destinationData); | 278 uint8_t* destinationData); |
| 278 static void packPixels(const uint8_t* sourceData, | 279 static void packPixels(const uint8_t* sourceData, |
| 279 DataFormat sourceDataFormat, | 280 DataFormat sourceDataFormat, |
| 280 unsigned pixelsPerRow, | 281 unsigned pixelsPerRow, |
| 281 uint8_t* destinationData); | 282 uint8_t* destinationData); |
| 282 }; | 283 }; |
| 283 | 284 |
| 284 } // namespace blink | 285 } // namespace blink |
| 285 | 286 |
| 286 #endif // WebGLImageConversion_h | 287 #endif // WebGLImageConversion_h |
| OLD | NEW |