[Webkit-unassigned] [Bug 35783] [GStreamer] Use ImageBuffer API to do painting

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 22 04:53:06 PDT 2010


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





--- Comment #13 from Philippe Normand <pnormand at igalia.com>  2010-03-22 04:53:06 PST ---
Thanks Eric for your careful review ;) Due to the amount of changes asked I
preferred to rework the patch so it can get a last pass from you and/or
Gustavo.

I adressed all your comments excepted:

> 
> > +class ImageGStreamer : public RefCounted<ImageGStreamer> {
> > +    public:
> > +        static PassRefPtr<ImageGStreamer> createImage(GstBuffer*);
> > +
> > +        ImageGStreamer(GstBuffer*&, IntSize&, cairo_format_t&);
> > +        ~ImageGStreamer();
> > +
> > +        PassRefPtr<BitmapImage> image();
> > +
> > +    private:
> > +
> The constructor and destructor should be private.
> 

It seems I can't make the destructor private because in the case where the
public createImage() returns NULL, ~PassRefPtr() is called which somehow
triggers the ~ImageGStreamer(). So in this context the destructor can't be
private.

But agreed, I made the constructor private :)
> 
> > -
> > -    cairo_save(cr);
> > -
> > -    // translate and scale the context to correct size
> > -    cairo_translate(cr, rect.x(), rect.y());
> > -    cairo_scale(cr, static_cast<double>(rect.width()) / width, static_cast<double>(rect.height()) / height);
> > -
> > -    // And paint it.
> > -    cairo_set_source_surface(cr, src, 0, 0);
> > -    cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_PAD);
> > -    cairo_rectangle(cr, 0, 0, width, height);
> > -    cairo_fill(cr);
> > -    cairo_restore(cr);
> >
> Why are you able to remove the positioning and sizing code, was it unnecessary
> before? 
> 

Those are done in ImageCairo.cpp in the draw method.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list