[Webkit-unassigned] [Bug 62422] TiledBackingStore endlessly creates and destroys tiles due to an off-by-one error.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 10 10:35:20 PDT 2011


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





--- Comment #7 from Jocelyn Turcotte <jocelyn.turcotte at nokia.com>  2011-06-10 10:35:20 PST ---
(In reply to comment #6)
> (From update of attachment 96723 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=96723&action=review
> 
> > Source/WebCore/platform/graphics/TiledBackingStore.cpp:80
> >      Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
> > -    Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY()));
> > +    Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX() - 1, dirtyRect.maxY() - 1));
> >      
> >      for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
> >          for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
> 
> I think a bette fix would be to change the <= into a < rather than changing the value in bottomRight.

I don't like having to add the -1 everywhere either but the thing is that tileCoordinateForPoint translates the rect's coordinate by doing a int division by the tile size.

So I might be missing something, but I think this would skip the last row/column of tiles in cases where dirtyRect is not on the edge of a tile and tileCoordinateForPoint(IntPoint(dirtyRect.maxX() - 1, dirtyRect.maxY() - 1)) == tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY())).

-- 
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