[effects/screenshot] Upload data to xpixmap in chunks
ClosedPublic

Authored by zzag on May 23 2019, 8:27 PM.

Details

Summary

xcb_put_image doesn't handle big images well. Contrary to XPutImage, the
caller must manually split the data in such a way that each xcb_put_image
request doesn't exceed the maximum request length. Not doing so will result
in libxcb shutting down the connection.

CCBUG: 338489
CCBUG: 388182

Test Plan

Take a screenshot of an active fullscreen client on a 4K monitor.

Diff Detail

Repository
R108 KWin
Branch
effects-screenshot-split-data
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 12106
Build 12124: arc lint + arc unit
zzag created this revision.May 23 2019, 8:27 PM
Restricted Application added a project: KWin. · View Herald TranscriptMay 23 2019, 8:27 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.May 23 2019, 8:27 PM
zzag added a comment.May 23 2019, 8:27 PM

I'm targeting 5.16.X.

zzag edited the test plan for this revision. (Show Details)May 23 2019, 8:33 PM
zzag added a comment.May 23 2019, 8:39 PM
This comment was removed by zzag.
zzag updated this revision to Diff 58558.May 23 2019, 9:02 PM
  • Fix coding style: align references to right
zzag updated this revision to Diff 58559.May 23 2019, 9:18 PM

Reword a comment.

davidedmundson accepted this revision.May 27 2019, 12:39 PM
davidedmundson added a subscriber: davidedmundson.

Makes sense and the low level part matches Qt's implementation.

++

This revision is now accepted and ready to land.May 27 2019, 12:39 PM
This revision was automatically updated to reflect the committed changes.

This causes Kwin to fail to build with Qt 5.9.

Plasma 5.12 should build with 5.9.

/effects/screenshot/screenshot.cpp:110:15: error: ‘const class QImage’ has no member named ‘sizeInBytes’

but

qsizetype QImage::sizeInBytes() const
Returns the image data size in bytes.
This function was introduced in Qt 5.10.