Changeset 134816 in webkit
- Timestamp:
- Nov 15, 2012 12:35:40 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r134815 r134816 1 2012-11-15 Alpha Lam <hclam@chromium.org> 2 3 [chromium] WebGL texImage2D fails with deferred image decoding 4 https://bugs.webkit.org/show_bug.cgi?id=102310 5 6 Reviewed by Kenneth Russell. 7 8 Added a test to exercise texImage2D with an Image object. 9 10 * fast/images/webgl-teximage2d-expected.txt: Added. 11 * fast/images/webgl-teximage2d.html: Added. 12 1 13 2012-11-15 Stephen Chenney <schenney@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r134814 r134816 1 2012-11-15 Alpha Lam <hclam@chromium.org> 2 3 [chromium] WebGL texImage2D fails with deferred image decoding 4 https://bugs.webkit.org/show_bug.cgi?id=102310 5 6 Reviewed by Kenneth Russell. 7 8 Skia's implementation of GraphicsContext3D::getImageData() uses ImageSource 9 to decode an image. When deferred image decoding is enabled this class 10 generates an ImageFrame marked as incomplete, which WebGL rejects. This results 11 in failing of texImage2D. 12 13 This change uses ImageDecoder directly instead of ImageSource. This skips 14 the code path of deferred image decoding. This behavior is correct because 15 GraphicsContext3D wants to decode the image differently with alpha not 16 premultiplied and color profile applied optionally. 17 18 Added a test to prove this change fixed the bug. 19 20 Test: fast/images/webgl-teximage2d.html 21 22 * platform/graphics/skia/GraphicsContext3DSkia.cpp: 23 (WebCore::GraphicsContext3D::getImageData): 24 1 25 2012-11-15 Jer Noble <jer.noble@apple.com> 2 26 -
trunk/Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
r122175 r134816 33 33 #include "BitmapImage.h" 34 34 #include "Image.h" 35 #include "Image Source.h"35 #include "ImageDecoder.h" 36 36 #include "NativeImageSkia.h" 37 37 #include "SkColorPriv.h" … … 57 57 bool hasAlpha = skiaImage ? !skiaImage->bitmap().isOpaque() : true; 58 58 if ((!skiaImage || ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && image->data()) { 59 ImageSource decoder(ImageSource::AlphaNotPremultiplied,60 ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied);61 // Attempt to get raw unpremultiplied image data62 decoder.setData(image->data(), true);63 if (!decoder .frameCount() || !decoder.frameIsCompleteAtIndex(0))59 // Attempt to get raw unpremultiplied image data. 60 OwnPtr<ImageDecoder> decoder(adoptPtr(ImageDecoder::create( 61 *(image->data()), ImageSource::AlphaNotPremultiplied, 62 ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied))); 63 if (!decoder) 64 64 return false; 65 hasAlpha = decoder.frameHasAlphaAtIndex(0); 66 pixels = adoptPtr(decoder.createFrameAtIndex(0)); 65 decoder->setData(image->data(), true); 66 if (!decoder->frameCount()) 67 return false; 68 ImageFrame* frame = decoder->frameBufferAtIndex(0); 69 if (!frame || frame->status() != ImageFrame::FrameComplete) 70 return false; 71 hasAlpha = frame->hasAlpha(); 72 pixels = adoptPtr(frame->asNewNativeImage()); 67 73 if (!pixels.get() || !pixels->isDataComplete() || !pixels->bitmap().width() || !pixels->bitmap().height()) 68 74 return false;
Note: See TracChangeset
for help on using the changeset viewer.