Bug 71962

Summary: Simplify the way that images are passed into a filter chain
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: SVGAssignee: Dean Jackson <dino>
Status: RESOLVED INVALID    
Severity: Normal CC: dino, krit, simon.fraser, thorton, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Simon Fraser (smfr) 2011-11-09 16:01:57 PST
Looking at the patch in bug 68472, I think the way that data gets into and out of filter chains could be improved. The code currently has to do:

m_filter->setSourceImageRect(size);
m_filter->setSourceImage(ImageBuffer::create(layoutSize));
GraphicsContext* sourceGraphicsContext = m_filter->sourceImage()->context();
// paint stuff

m_filter->effect()->apply();
p->drawImageBuffer(m_filter->effect()->asImageBuffer(), ...)


It seems like it would be much clearer as:

1. Make an ImageBuffer
2. Paint into the ImageBuffer
3. Hand the ImageBuffer to the filter.
4. Get the filtered result as an image buffer
5. Paint that image buffer.
Comment 1 Radar WebKit Bug Importer 2011-11-11 14:42:32 PST
<rdar://problem/10435248>
Comment 2 Dirk Schulze 2013-09-05 23:35:19 PDT
(In reply to comment #0)
> Looking at the patch in bug 68472, I think the way that data gets into and out of filter chains could be improved. The code currently has to do:
> 
> m_filter->setSourceImageRect(size);
> m_filter->setSourceImage(ImageBuffer::create(layoutSize));
> GraphicsContext* sourceGraphicsContext = m_filter->sourceImage()->context();
> // paint stuff
> 
> m_filter->effect()->apply();
> p->drawImageBuffer(m_filter->effect()->asImageBuffer(), ...)
> 
> 
> It seems like it would be much clearer as:
> 
> 1. Make an ImageBuffer
> 2. Paint into the ImageBuffer
> 3. Hand the ImageBuffer to the filter.
> 4. Get the filtered result as an image buffer
> 5. Paint that image buffer.

Well, that seems what we are doing right now. What is your suggestion?
Comment 3 Simon Fraser (smfr) 2018-09-03 10:51:30 PDT
True dat.