[webkit-reviews] review granted: [Bug 237355] [WinCairo] Improve WCTiledBacking and TextureMapperSparseBackingStore : [Attachment 453576] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 2 13:15:34 PST 2022


Don Olmstead <don.olmstead at sony.com> has granted Fujii Hironori
<Hironori.Fujii at sony.com>'s request for review:
Bug 237355: [WinCairo] Improve WCTiledBacking and
TextureMapperSparseBackingStore
https://bugs.webkit.org/show_bug.cgi?id=237355

Attachment 453576: Patch

https://bugs.webkit.org/attachment.cgi?id=453576&action=review




--- Comment #4 from Don Olmstead <don.olmstead at sony.com> ---
Comment on attachment 453576
  --> https://bugs.webkit.org/attachment.cgi?id=453576
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453576&action=review

> Source/WebCore/platform/graphics/texmap/TextureMapperSparseBackingStore.h:60
> +    class TileIndex : public WebCore::IntPoint {
> +    public:
> +	   TileIndex() { }
> +	   TileIndex(int x, int y)
> +	       : WebCore::IntPoint(x, y)
> +	   {
> +	   }
> +
> +	   bool operator<(const TileIndex& other) const
> +	   {
> +	       if (y() == other.y())
> +		   return x() < other.x();
> +	       return y() < other.y();
> +	   }
> +
> +	   bool operator>(const TileIndex& other) const
> +	   {
> +	       return other < *this;
> +	   }
> +

If you're just doing a subclass to tack on operators for `<` and `>` seems like
maybe doing a type alias `using TileIndex = WebCore::IntPoint` and adding some
functions to do your `<` `>` comparisons might be a better approach.

>>>
Source/WebCore/platform/graphics/texmap/TextureMapperSparseBackingStore.h:108
>>> +	 class Tile : public BasicRawSentinelNode<Tile> {
>> 
>> Is there a better name for this or the other Tile class? Seems pretty likely
to be mixed up.
> 
> I have no idea. What's your preference? Because they are inter classes, they
are distinguishable by using parent class names, WCTileGrid::Tile and
TextureMapperSparseBackingStore::Tile.

I didn't really have anything better.


More information about the webkit-reviews mailing list