Bug 122441 - -webkit-cross-fade paints SVGs at full opacity during cross-fade
Summary: -webkit-cross-fade paints SVGs at full opacity during cross-fade
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-10-07 01:44 PDT by Tim Horton
Modified: 2013-10-07 09:47 PDT (History)
3 users (show)

See Also:


Attachments
patch (6.90 KB, patch)
2013-10-07 01:50 PDT, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-10-07 01:44:33 PDT
Cross-fade is broken with SVGImages, because SVGImage resets the context's opacity before the image is drawn, so the opacity that we set does not take effect.

We can use a transparency layer to get around this, but due to the performance cost, we should only do this when painting an SVG image.

I have a patch.

<rdar://problem/13973162>
Comment 1 Tim Horton 2013-10-07 01:50:35 PDT
Created attachment 213572 [details]
patch
Comment 2 WebKit Commit Bot 2013-10-07 01:52:25 PDT
Attachment 213572 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/css3/images/cross-fade-svg-with-opacity-expected.html', u'LayoutTests/css3/images/cross-fade-svg-with-opacity.html', u'Source/WebCore/ChangeLog', u'Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp']" exit_code: 1
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp:64:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2013-10-07 01:56:23 PDT
Comment on attachment 213572 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=213572&action=review

>> Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp:64
>> +                                 static_cast<float>(targetSize.height()) / imageSize.height()));
> 
> Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]

Hmm, I just moved this, but it does look wrong.
Comment 4 Tim Horton 2013-10-07 09:47:21 PDT
http://trac.webkit.org/changeset/157045