| 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 "third_party/khronos/GLES2/gl2.h" | 10 #include "third_party/khronos/GLES2/gl2.h" |
| 11 #include "third_party/khronos/GLES2/gl2ext.h" | 11 #include "third_party/khronos/GLES2/gl2ext.h" |
| 12 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
| 13 | 13 |
| 14 namespace WebCore { | 14 namespace blink { |
| 15 class Image; | 15 class Image; |
| 16 class IntSize; | 16 class IntSize; |
| 17 | 17 |
| 18 // Helper functions for texture uploading and pixel readback. | 18 // Helper functions for texture uploading and pixel readback. |
| 19 class PLATFORM_EXPORT WebGLImageConversion { | 19 class PLATFORM_EXPORT WebGLImageConversion { |
| 20 public: | 20 public: |
| 21 // Attempt to enumerate all possible native image formats to | 21 // Attempt to enumerate all possible native image formats to |
| 22 // reduce the amount of temporary allocations during texture | 22 // reduce the amount of temporary allocations during texture |
| 23 // uploading. This enum must be public because it is accessed | 23 // uploading. This enum must be public because it is accessed |
| 24 // by non-member functions. | 24 // by non-member functions. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 private: | 156 private: |
| 157 // Helper for packImageData/extractImageData/extractTextureData which implem
ent packing of pixel | 157 // Helper for packImageData/extractImageData/extractTextureData which implem
ent packing of pixel |
| 158 // data into the specified OpenGL destination format and type. | 158 // data into the specified OpenGL destination format and type. |
| 159 // A sourceUnpackAlignment of zero indicates that the source | 159 // A sourceUnpackAlignment of zero indicates that the source |
| 160 // data is tightly packed. Non-zero values may take a slow path. | 160 // data is tightly packed. Non-zero values may take a slow path. |
| 161 // Destination data will have no gaps between rows. | 161 // Destination data will have no gaps between rows. |
| 162 // Implemented in GraphicsContext3DImagePacking.cpp | 162 // Implemented in GraphicsContext3DImagePacking.cpp |
| 163 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); | 163 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); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace WebCore | 166 } // namespace blink |
| 167 | 167 |
| 168 #endif // WebGLImageConversion_h | 168 #endif // WebGLImageConversion_h |
| OLD | NEW |