Setting the globalImage property of a canvas context is not honoured when doing a drawImage. Test case available at: http://philip.html5.org/tests/canvas/suite/tests/2d.composite.globalAlpha.image.html Chromium bug http://code.google.com/p/chromium/issues/detail?id=5281 Tested on: Firefox 3.0 Linux - PASS Firefox 3.5b4 OSX - PASS WebKit nightly OSX (44174) - PASS Chromium SVN (16864) - FAIL
We fixexd it on Cairo by reading and applying the globalAlpha in WebCore/platform/graphics/cairo/ImageCairo.cpp directly. We added getAlpha() for Cairo to GraphicsContext.h maybe Skia needs to use it too.
Created attachment 30889 [details] Use the alpha channel when painting images in skia.
The patch is by me. Please ignore the gmail address.
Comment on attachment 30889 [details] Use the alpha channel when painting images in skia. > + int alpha = roundf(platformContext->getAlpha() * 256); > + if (alpha > 255) > + alpha = 255; > + else if (alpha < 0) > + alpha = 0; > + paint.setAlpha(alpha); 4 spaces indent. Looks great otherwise.
Created attachment 30929 [details] Use the alpha channel when painting images in skia. Updated. Changes: Changed to 4 space indent.
Comment on attachment 30929 [details] Use the alpha channel when painting images in skia. Updated. Don't forget to mark for review next time :)
Landed as http://trac.webkit.org/changeset/44537.