egl: encapsulate and share duplicated code
ClosedPublic

Authored by apol on Apr 9 2020, 5:56 PM.

Details

Summary

Removes a few TODO items mentioning that some code was exactly the same
in a couple of different places.

drm: Remove unnecessary cast

Test Plan

Using it right now
Will push in 2 different commits

Diff Detail

Repository
R108 KWin
Branch
refactors
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24990
Build 25008: arc lint + arc unit
apol created this revision.Apr 9 2020, 5:56 PM
Restricted Application added a project: KWin. · View Herald TranscriptApr 9 2020, 5:56 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
apol requested review of this revision.Apr 9 2020, 5:56 PM
apol updated this revision to Diff 79727.Apr 9 2020, 5:57 PM

Remove unrelated changes

zzag added a subscriber: zzag.Apr 16 2020, 9:37 AM

The removed TODO comments are about extending GLTexture's API. Ideally, one should be able to create/update a GLTexture object from the given raw pixel data. GLTexture tries to be smart and allocate immutable storage for the texture. The problem is that nothing prohibits a client to flip flop between client buffer types, e.g. in one frame wl-shm, and in another frame wl-drm. So, if immutable storage has been allocated for the texture, we need to re-create the GLTexture if the client has attached a buffer of different type than the current one. In general, this should not be a big problem, but given the current window pixmap abstractions, it's not easy to do. We need to re-work SceneOpenGLTexture or even better get rid of it before extending GLTexture.

Anyway, I think we could merge the proposed code refactoring. However, please keep the TODO comments.

platformsupport/scenes/opengl/abstract_egl_backend.cpp
482–486

I don't follow this change. setYInverted() must be called before updateMatrix(). Is there a reason why you swapped them?

plugins/platforms/drm/remoteaccess_manager.cpp
65

Coding style: whitespace before *.

plugins/platforms/drm/remoteaccess_manager.h
48

Coding style: whitespace before *.

apol marked 3 inline comments as done.Apr 20 2020, 5:04 PM
apol updated this revision to Diff 80666.Apr 20 2020, 5:05 PM

cleanups

zzag added a comment.Apr 21 2020, 5:27 AM

The changes in the drm backend seem unrelated. Could you please remove them?

apol updated this revision to Diff 80821.Apr 22 2020, 12:10 AM

Only include 1 patch at a time or arc goes crazy

zzag accepted this revision.Apr 22 2020, 6:18 AM

Looks fine to me, please address my inline comments before landing this patch.

platformsupport/scenes/opengl/abstract_egl_backend.cpp
477–480

Unnecessary shuffling of lines.

510–514

Unnecessary shuffling of lines. Please undo it.

This revision is now accepted and ready to land.Apr 22 2020, 6:18 AM
apol marked 2 inline comments as done.Apr 22 2020, 2:29 PM
This revision was automatically updated to reflect the committed changes.