Skip to content

shm: Fix arguments to PutImage on the XY conversion path

Adam Jackson requested to merge ajax/xserver:fix-shm-putimage-xy into master

The w/h here should be the w/h of the destination rectangle, not of the source shm image. The existing code happens to work because clipping saves us later, but this turns out to have enough performance impact that shmputxy is only barely faster than protocol putxy without the fix, even for Xvfb:

      before     after
   --------- ------------------   -----------------------------
    128000.0  128000.0 ( 1.000)   PutImage XY 10x10 square
      2120.0    2110.0 ( 0.995)   PutImage XY 100x100 square
        88.2      88.1 ( 0.999)   PutImage XY 500x500 square
    142000.0 1270000.0 ( 8.944)   ShmPutImage XY 10x10 square
      2250.0   90600.0 (40.267)   ShmPutImage XY 100x100 square
        89.6     109.0 ( 1.217)   ShmPutImage XY 500x500 square

Merge request reports

Loading