romangg added inline comments.

INLINE COMMENTS

> davidedmundson wrote in surface_interface.cpp:485
> We're not testing this error in the case of:
> 
> buffer is set
> viewporter.sourceRect is set
> 
> then later
> buffer changes
> viewporter.sourceRect remains the same
> 
> this should be an error too.

Good point. Same should be done for when the transform or scale changes.

> davidedmundson wrote in surface_interface.cpp:882
> Should this be
> 
> d->current.sourceRectangle.size()/ scale()
> 
> It would be a somewhat weird case to use both viewporter and wl_buffer.scale, 
> but it's what the spec implies and you seem to be assuming that in the kwin 
> render path.
> 
> destinationSize would be as-is.

How I read the spec: the source rectangle is always specified in coordinates 
after scale and transform. [1]

`SurfaceInterface::size()` returns the scaled and transformed (not yet) buffer 
size so since viewporter coordinates are to this base we can just directly 
return them.

[1] 
https://gitlab.freedesktop.org/wayland/wayland-protocols/blob/master/stable/viewporter/viewporter.xml#L103

> davidedmundson wrote in surface_interface.h:130
> Why not just
> 
> BufferInterface *buffer() const
> 
> There's no reason why a caller would need to explicitly pick a const vs 
> non-const version.

Yea, I added the new function for API/ABI-compatibility. But if you say making 
the function `buffer()` const is not a problem in this regard I will gladly do 
that.

REPOSITORY
  R127 KWayland

REVISION DETAIL
  https://phabricator.kde.org/D26171

To: romangg, #kwin
Cc: davidedmundson, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, 
bruns

Reply via email to