[webkit-reviews] review requested: [Bug 25956] Canvas' composition is incorrect when alpha=0 : [Attachment 30577] Remove optimization path alpha=0 case from GraphicContext(CG|Skia)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 22 00:53:30 PDT 2009


Shinichiro Hamaji <hamaji at chromium.org> has asked  for review:
Bug 25956: Canvas' composition is incorrect when alpha=0
https://bugs.webkit.org/show_bug.cgi?id=25956

Attachment 30577: Remove optimization path alpha=0 case from
GraphicContext(CG|Skia)
https://bugs.webkit.org/attachment.cgi?id=30577&action=review

------- Additional Comments from Shinichiro Hamaji <hamaji at chromium.org>
This is the reason why I introduced failing test cases in the previous patch:

https://bugs.webkit.org/show_bug.cgi?id=25417

This optimization was introduced 3 years ago. At this time, fillRect() always
calls fillRectSourceOver() so that this optimization was OK. So, I guess the
current behavior (when alpha is zero, all fillrect operations are skipped even
if the composite mode is 'copy') is not intentional.

http://trac.webkit.org/changeset/13992/trunk/WebCore/platform/mac/GraphicsConte
xtMac.mm

Fortunately, Skia has the similar optimization path inside Skia and Skia checks
the composition mode if it is safe to do this optimization. I don't know if CG
has similar logic, but anyway I think this patch won't reduce performance
significantly as alpha=0 cases may be rare.

I also made error messages of the layout test case better, and added test case
for path and fill.


More information about the webkit-reviews mailing list