Bug 71962 - Simplify the way that images are passed into a filter chain
Summary: Simplify the way that images are passed into a filter chain
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-11-09 16:01 PST by Simon Fraser (smfr)
Modified: 2018-09-03 10:51 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 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.