gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash ChangeLog backend/render_handler.h backen...


From: Udo Giacomozzi
Subject: Re: [Gnash-commit] gnash ChangeLog backend/render_handler.h backen...
Date: Sun, 3 Dec 2006 15:21:55 +0100

Hello Sandro,

Saturday, December 2, 2006, 10:03:50 PM, you wrote:
SS> -  void clear(unsigned int left, unsigned int top, unsigned int width,
SS> -    unsigned int height) {

SS> +  void clear(geometry::Range2d<int> region)

Uhm. clear() is something like an extension to AGG because it does not
provide a clipped clear() method. I'd prefer to keep four ints as
arguments because it is a more low-level function...


SS> -         const unsigned int max_y = top+height; // to be exact, it's one 
off the max.

The comment means that top+height is *not* max_y but it's (max_y+1).
Just avoiding an addition...


SS> +         const unsigned int max_y = region.getMaxY();
SS> +          for (unsigned int y=region.getMinY(); y<max_y; y++) 

In that case it should be  y<=max_y


-----

SS> -    rasc.clip_box((double)m_clip_xmin, (double)m_clip_ymin,
SS> -      (double)m_clip_xmax, (double)m_clip_ymax);
SS> +        // TODO: what do do if _clipbox.isNull() or _clipbox.isWorld() ?
SS> +       //       currently an assertion will fail when get{Min,Max}{X,Y}
SS> +       //       are called below

isNull() should never happen as then there is no need to render
anything (and the GUI will avoid to call the renderer).

isWorld() would be an error because this is *not* the clipping
rectangle coming from the GUI. set_invalidated_bounds() function of
the renderer makes sure the coordinates are within the visible window.
So, if isWorld() was true, the _clipbox will contain the extents of
the player window.

At least that was true for my implementation.


-----

SS> +  inline void world_to_pixel(int& x, int& y,
SS> +         float world_x, float world_y)
SS>    {
SS> +        // negative pixels seems ok here... we don't
SS> +       // clip to valid range, use world_to_pixel(rect&)
SS> +       // and Intersect() against valid range instead.
SS> +       x = (world_x * xscale);
SS> +       y = (world_y * yscale);
SS>    }

Yes, it's just a scale conversion, no need to do clipping.

SS> +      // TODO: add 2 pixels (GUI does that too)
SS> +      //m_clip_xmin -= 2;
SS> +      //m_clip_ymin -= 2;
SS> +      //m_clip_xmax += 2;
SS> +      //m_clip_ymax += 2;

This border is very important. The renderer absolutely has to add two
pixels in each direction for correct rendering or artifacts will be
visible.



(did check only render_handler_agg.cpp)

Udo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]