Bug 115342 - CSS Gradients are drawn into an Image instead of directly access Gradient
Summary: CSS Gradients are drawn into an Image instead of directly access Gradient
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-28 21:42 PDT by Dirk Schulze
Modified: 2013-04-29 08:49 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schulze 2013-04-28 21:42:34 PDT
If I understand the code correctly, a CSS Gradient gets drawn into an Image and this image is draw onto the surface. I would like to change the code to use the Gradient class directly to draw to the surface, because:

1) For most platforms it should be more efficient to draw the gradient on command
2) On many platforms the quality could be improve by that (zooming)
3) This will allow to support animations
4) CSS Gradients can be used on SVG elements

I looked at the code briefly. It looks like it should not be to hard to implement that. The biggest problem might just be in RenderBoxModelObject::paintFillLayerExtended. I should be able to report later.

CCing people who might have some input.
Comment 1 Dirk Schulze 2013-04-28 21:48:54 PDT
One case that I forgot is repeating backgrounds. This would need spacial treatment on drawing. My experience so far is that gradient patterns are not that usual. I would use the Pattern function for that. However, it will still make things a bit more complicated.
Comment 2 Simon Fraser (smfr) 2013-04-29 08:49:13 PDT
Are you talking about the ImageBuffer in the GeneratorGeneratedImage code? That was added for perf reasons (but does have poor perf characteristics in some cases).