Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp |
| index ab49f0b6ac3a229d549afb50c4d69d647bec3ea1..b7945a28de5d6ab65d7cfcb9c62674862a5bf43a 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp |
| @@ -65,7 +65,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRGBA8_S; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_UNSIGNED_BYTE: |
| @@ -96,7 +96,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRA8; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_SHORT: |
| @@ -112,7 +112,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| case GL_RGBA_INTEGER: |
| dstFormat = WebGLImageConversion::DataFormatRGBA16_S; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_UNSIGNED_SHORT: |
| @@ -133,7 +133,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRGBA16; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_INT: |
| @@ -151,7 +151,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRGBA32_S; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_UNSIGNED_INT: |
| @@ -172,7 +172,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRGBA32; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_HALF_FLOAT_OES: // OES_texture_half_float |
| @@ -198,7 +198,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRA16F; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_FLOAT: // OES_texture_float |
| @@ -226,7 +226,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRA32F; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| break; |
| case GL_UNSIGNED_SHORT_4_4_4_4: |
| @@ -251,7 +251,7 @@ WebGLImageConversion::DataFormat getDataFormat(GLenum destinationFormat, |
| dstFormat = WebGLImageConversion::DataFormatRGBA2_10_10_10; |
| break; |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| return dstFormat; |
| } |
| @@ -400,7 +400,7 @@ unsigned short convertFloatToHalfFloat(float f) { |
| // Pixel unpacking routines. |
| template <int format, typename SourceType, typename DstType> |
| void unpack(const SourceType*, DstType*, unsigned) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| template <> |
| @@ -655,7 +655,7 @@ void unpack<WebGLImageConversion::DataFormatRGBA2_10_10_10, uint32_t, float>( |
| template <int format, int alphaOp, typename SourceType, typename DstType> |
| void pack(const SourceType*, DstType*, unsigned) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| template <> |
| @@ -2254,7 +2254,7 @@ class FormatConverter { |
| m_unpackedIntermediateSrcData = wrapArrayUnique( |
| new uint8_t[m_srcSubRectangle.width() * MaxNumberOfComponents * |
| MaxBytesPerComponent]); |
| - ASSERT(m_unpackedIntermediateSrcData.get()); |
| + DCHECK(m_unpackedIntermediateSrcData.get()); |
| } |
| void convert(WebGLImageConversion::DataFormat srcFormat, |
| @@ -2307,7 +2307,7 @@ void FormatConverter::convert(WebGLImageConversion::DataFormat srcFormat, |
| FORMATCONVERTER_CASE_SRCFORMAT( |
| WebGLImageConversion::DataFormatRGBA2_10_10_10) |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| #undef FORMATCONVERTER_CASE_SRCFORMAT |
| } |
| @@ -2349,7 +2349,7 @@ void FormatConverter::convert(WebGLImageConversion::DataFormat dstFormat, |
| FORMATCONVERTER_CASE_DSTFORMAT(WebGLImageConversion::DataFormatRG16F) |
| FORMATCONVERTER_CASE_DSTFORMAT(WebGLImageConversion::DataFormatRG32F) |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| #undef FORMATCONVERTER_CASE_DSTFORMAT |
| @@ -2367,7 +2367,7 @@ void FormatConverter::convert(WebGLImageConversion::AlphaOp alphaOp) { |
| FORMATCONVERTER_CASE_ALPHAOP(WebGLImageConversion::AlphaDoPremultiply) |
| FORMATCONVERTER_CASE_ALPHAOP(WebGLImageConversion::AlphaDoUnmultiply) |
| default: |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| } |
| #undef FORMATCONVERTER_CASE_ALPHAOP |
| } |
| @@ -2404,11 +2404,11 @@ void FormatConverter::convert() { |
| // try to return immediately in these cases to avoid generating useless code. |
| if (SrcFormat == DstFormat && |
| alphaOp == WebGLImageConversion::AlphaDoNothing) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| return; |
| } |
| if (!IsFloatFormat<DstFormat>::value && IsFloatFormat<SrcFormat>::value) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| return; |
| } |
| @@ -2417,25 +2417,25 @@ void FormatConverter::convert() { |
| const bool srcFormatComesFromDOMElementOrImageData = |
| WebGLImageConversion::srcFormatComeFromDOMElementOrImageData(SrcFormat); |
| if (!srcFormatComesFromDOMElementOrImageData && SrcFormat != DstFormat) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| return; |
| } |
| // Likewise, only textures uploaded from DOM elements or ImageData can |
| // possibly need to be unpremultiplied. |
| if (!srcFormatComesFromDOMElementOrImageData && |
| alphaOp == WebGLImageConversion::AlphaDoUnmultiply) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| return; |
| } |
| if (srcFormatComesFromDOMElementOrImageData && |
| alphaOp == WebGLImageConversion::AlphaDoUnmultiply && |
| !SupportsConversionFromDomElements<DstFormat>::value) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| return; |
| } |
| if ((!HasAlpha(SrcFormat) || !HasColor(SrcFormat) || !HasColor(DstFormat)) && |
| alphaOp != WebGLImageConversion::AlphaDoNothing) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| return; |
| } |
| // If converting DOM element data to UNSIGNED_INT_5_9_9_9_REV or |
| @@ -2444,7 +2444,7 @@ void FormatConverter::convert() { |
| if (srcFormatComesFromDOMElementOrImageData && SrcFormat != DstFormat && |
| (DstFormat == WebGLImageConversion::DataFormatRGB5999 || |
| DstFormat == WebGLImageConversion::DataFormatRGB10F11F11F)) { |
| - ASSERT_NOT_REACHED(); |
| + NOTREACHED(); |
| return; |
| } |
| @@ -2457,7 +2457,7 @@ void FormatConverter::convert() { |
| const bool trivialUnpack = SrcFormat == IntermFormat; |
| const bool trivialPack = DstFormat == IntermFormat && |
| alphaOp == WebGLImageConversion::AlphaDoNothing; |
| - ASSERT(!trivialUnpack || !trivialPack); |
| + DCHECK(!trivialUnpack || !trivialPack); |
| const SrcType* srcRowStart = |
| static_cast<const SrcType*>(static_cast<const void*>( |
| @@ -2618,11 +2618,11 @@ GLenum WebGLImageConversion::computeImageSizeInBytes( |
| unsigned* imageSizeInBytes, |
| unsigned* paddingInBytes, |
| unsigned* skipSizeInBytes) { |
| - ASSERT(imageSizeInBytes); |
| - ASSERT(params.alignment == 1 || params.alignment == 2 || |
| + DCHECK(imageSizeInBytes); |
| + DCHECK(params.alignment == 1 || params.alignment == 2 || |
| params.alignment == 4 || params.alignment == 8); |
| - ASSERT(params.rowLength >= 0 && params.imageHeight >= 0); |
| - ASSERT(params.skipPixels >= 0 && params.skipRows >= 0 && |
| + DCHECK(params.rowLength >= 0 && params.imageHeight >= 0); |
|
tkent
2017/04/09 23:17:27
Split this into two DCHECKs.
Hwanseung Lee
2017/04/11 22:24:10
Done.
|
| + DCHECK(params.skipPixels >= 0 && params.skipRows >= 0 && |
|
tkent
2017/04/09 23:17:27
Split this into three DCHECKs.
Hwanseung Lee
2017/04/11 22:24:10
Done.
|
| params.skipImages >= 0); |
| if (width < 0 || height < 0 || depth < 0) |
| return GL_INVALID_VALUE; |
| @@ -2734,7 +2734,7 @@ WebGLImageConversion::ImageExtractor::ImageExtractor( |
| void WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha, |
| bool ignoreColorSpace) { |
| - ASSERT(!m_imagePixelLocker); |
| + DCHECK(!m_imagePixelLocker); |
| if (!m_image) |
| return; |
| @@ -2790,7 +2790,7 @@ void WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha, |
| m_imageSourceUnpackAlignment = |
| 0; // FIXME: this seems to always be zero - why use at all? |
| - ASSERT(skiaImage->width() && skiaImage->height()); |
| + DCHECK(skiaImage->width() && skiaImage->height()); |
|
tkent
2017/04/09 23:17:27
Split this into two DCHECKs.
Hwanseung Lee
2017/04/11 22:24:10
Done.
|
| m_imageWidth = skiaImage->width(); |
| m_imageHeight = skiaImage->height(); |