Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: Source/platform/graphics/gpu/WebGLImageConversion.cpp

Issue 221083002: Fix assert failure caused by ImageExtractor and optimize test (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/canvas/webgl/webgl-large-texture.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/gpu/WebGLImageConversion.cpp
diff --git a/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/Source/platform/graphics/gpu/WebGLImageConversion.cpp
index ef688a06969cc3b36f706debe6147daa9f17e7c0..d90b4dddfac70046d21b4ddf3632b4303c7f26de 100644
--- a/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -1584,11 +1584,15 @@ bool WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha, b
m_imageSourceFormat = SK_B32_SHIFT ? DataFormatRGBA8 : DataFormatBGRA8;
m_imageWidth = m_skiaImage->bitmap().width();
m_imageHeight = m_skiaImage->bitmap().height();
- if (!m_imageWidth || !m_imageHeight)
+ if (!m_imageWidth || !m_imageHeight) {
+ m_skiaImage.clear();
return false;
+ }
// Fail if the image was downsampled because of memory limits.
- if (m_imageWidth != (unsigned)m_image->size().width() || m_imageHeight != (unsigned)m_image->size().height())
+ if (m_imageWidth != (unsigned)m_image->size().width() || m_imageHeight != (unsigned)m_image->size().height()) {
+ m_skiaImage.clear();
return false;
+ }
m_imageSourceUnpackAlignment = 0;
m_skiaImage->bitmap().lockPixels();
m_imagePixelData = m_skiaImage->bitmap().getPixels();
« no previous file with comments | « LayoutTests/fast/canvas/webgl/webgl-large-texture.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698