[webkit-reviews] review denied: [Bug 54133] [chromium] Replace tiler data structure with something smarter : [Attachment 83403] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Feb 23 11:44:47 PST 2011
Kenneth Russell <kbr at google.com> has denied Adrienne Walker <enne at google.com>'s
request for review:
Bug 54133: [chromium] Replace tiler data structure with something smarter
https://bugs.webkit.org/show_bug.cgi?id=54133
Attachment 83403: Patch
https://bugs.webkit.org/attachment.cgi?id=83403&action=review
------- Additional Comments from Kenneth Russell <kbr at google.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=83403&action=review
Looks good overall. A couple of minor comments/questions and one small must-fix
bug.
> Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp:206
> for (size_t i = 0; i < m_tiles.size(); ++i) {
> - if (m_tiles[i])
> - m_unusedTiles.append(m_tiles[i].release());
> + m_unusedTiles.append(m_tiles[i].release());
> }
No braces for one-line bodies.
> Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp:223
> + // To avoid an O(n^2) check for tile existence via tileAt, keep a flag
> + // vector indexed by tile location marking all the tiles we've seen
already.
Wouldn't it be better to just bite the bullet and use a HashMap whose keys are
the (i,j) pairs of ints and whose values are Tile*'s?
> Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp:497
> + m_tiler->m_tiles[m_idx].release();
This leaks memory! You probably meant to call clear(), but you shouldn't need
to do this at all -- the resize() call after the swap() should take care of
destroying the last OwnPtr<Tile> and therefore its referent.
More information about the webkit-reviews
mailing list