Chromium Code Reviews| 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 #include "platform/graphics/gpu/WebGLImageConversion.h" | 5 #include "platform/graphics/gpu/WebGLImageConversion.h" |
| 6 | 6 |
| 7 #include "platform/graphics/ImageObserver.h" | 7 #include "platform/graphics/ImageObserver.h" |
| 8 #include "platform/graphics/cpu/arm/WebGLImageConversionNEON.h" | 8 #include "platform/graphics/cpu/arm/WebGLImageConversionNEON.h" |
| 9 #include "platform/graphics/cpu/mips/WebGLImageConversionMSA.h" | 9 #include "platform/graphics/cpu/mips/WebGLImageConversionMSA.h" |
| 10 #include "platform/graphics/cpu/x86/WebGLImageConversionSSE.h" | 10 #include "platform/graphics/cpu/x86/WebGLImageConversionSSE.h" |
| (...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2873 | 2873 |
| 2874 unsigned packedSize; | 2874 unsigned packedSize; |
| 2875 // Output data is tightly packed (alignment == 1). | 2875 // Output data is tightly packed (alignment == 1). |
| 2876 PixelStoreParams params; | 2876 PixelStoreParams params; |
| 2877 params.alignment = 1; | 2877 params.alignment = 1; |
| 2878 if (computeImageSizeInBytes(format, type, width, height, 1, params, | 2878 if (computeImageSizeInBytes(format, type, width, height, 1, params, |
| 2879 &packedSize, 0, 0) != GL_NO_ERROR) | 2879 &packedSize, 0, 0) != GL_NO_ERROR) |
| 2880 return false; | 2880 return false; |
| 2881 data.resize(packedSize); | 2881 data.resize(packedSize); |
| 2882 | 2882 |
| 2883 if (!packPixels(reinterpret_cast<const uint8_t*>(pixels), sourceFormat, width, | 2883 if (!packPixels(reinterpret_cast<const uint8_t*>(pixels), sourceFormat, width, |
|
f(malita)
2016/10/24 12:20:42
Nit: return packPixels(...);
hiroshige
2016/11/22 12:24:15
Done.
| |
| 2884 height, sourceUnpackAlignment, format, type, alphaOp, | 2884 height, sourceUnpackAlignment, format, type, alphaOp, |
| 2885 data.data(), flipY)) | 2885 data.data(), flipY)) |
| 2886 return false; | 2886 return false; |
| 2887 if (ImageObserver* observer = image->getImageObserver()) | |
| 2888 observer->didDraw(image); | |
| 2889 return true; | 2887 return true; |
| 2890 } | 2888 } |
| 2891 | 2889 |
| 2892 bool WebGLImageConversion::extractImageData(const uint8_t* imageData, | 2890 bool WebGLImageConversion::extractImageData(const uint8_t* imageData, |
| 2893 DataFormat sourceDataFormat, | 2891 DataFormat sourceDataFormat, |
| 2894 const IntSize& imageDataSize, | 2892 const IntSize& imageDataSize, |
| 2895 GLenum format, | 2893 GLenum format, |
| 2896 GLenum type, | 2894 GLenum type, |
| 2897 bool flipY, | 2895 bool flipY, |
| 2898 bool premultiplyAlpha, | 2896 bool premultiplyAlpha, |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3092 pack<WebGLImageConversion::DataFormatRGB565, | 3090 pack<WebGLImageConversion::DataFormatRGB565, |
| 3093 WebGLImageConversion::AlphaDoNothing>(srcRowStart, dstRowStart, | 3091 WebGLImageConversion::AlphaDoNothing>(srcRowStart, dstRowStart, |
| 3094 pixelsPerRow); | 3092 pixelsPerRow); |
| 3095 } break; | 3093 } break; |
| 3096 default: | 3094 default: |
| 3097 break; | 3095 break; |
| 3098 } | 3096 } |
| 3099 } | 3097 } |
| 3100 | 3098 |
| 3101 } // namespace blink | 3099 } // namespace blink |
| OLD | NEW |