Bug 383715 - Presentation tool compilation fails when OpenGL ES is used [patch]
Summary: Presentation tool compilation fails when OpenGL ES is used [patch]
Status: REOPENED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-Presentation (show other bugs)
Version: 6.2.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-19 18:29 UTC by Stefan Brüns
Modified: 2023-10-12 05:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
qopenglwidget.patch (10.93 KB, patch)
2017-10-05 05:57 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2017-08-19 18:29:43 UTC
The OpenGL slideshow code uses OpenGL (desktop) specific idiom, and will not compile with Qt5OpenGL using GLES.

utilities/presentation/opengl/presentationgl.cpp

Short term solution would be to to disable OpenGL in case GLES is used.

Better long term solution would be to rewrite the presentation code to use the common subset of GLES2 and Desktop GL, e.g using http://doc.qt.io/qt-5/qopenglfunctions.html
Comment 1 Stefan Brüns 2017-10-04 00:46:00 UTC
Ok, I have looked into the presentation code, and I am not quite sure which is the best way forward:

1. Just port the code to QOpenGLFunctions [1], fixing any differences between GL and GLES and be done with it.
2. Do a complete overhaul of the code and port it to QML

1. would fix the imminent problem with GLES, but would not fix the various problems visible in the current code:

- There are 3 different widgets (non-GL, GL, Ken Burns( with large amounts of duplicate^Wtrippled code
  a) event handling
  b) widget constructor
  c) ...
- feature set is different, e.g. Ken Burns lacks any overlays (filename, comments)
- Overlay rendering between non-GL and GL is different
- Overlay aspect ratio is wrong for GL when using reduced resolution
- Overlay text antialiasing is broken
- Ken Burns uses blurred images (image is loaded at screen resolution, but the upscaled and translated)

My proposal would be to port the presentation widgets to QML, while keeping the PresentationLoader and PresentationContainer classes:
1. Code a presenter capable to show a series of images
2. Add text overlays
3. Add back all effects, one by one

If this approach seems acceptable, I would start a branch therefor. Timeline would be 1 month for the first step (1.), one week for (2.) and about 2 effects per week thereafter.

[1] http://doc.qt.io/qt-5/qopenglfunctions.html
Comment 2 caulier.gilles 2017-10-04 12:39:43 UTC
Hi Stephan,

Thanks for your proposal.

About QML port, we must to know if Maik have finalized a patch to fix the original problem from this file. I know that he write a fix, but it's not yet finalized.

So, wait and see the MAik response.

Gilles Caulier
Comment 3 Maik Qualmann 2017-10-05 05:57:16 UTC
Created attachment 108175 [details]
qopenglwidget.patch

Hi Stephan,

this patch is not finished yet. It is only the attempt to replace QGLWidget with QOpenGLWiget. Can you test whether compiles digiKam under OpenGL ES?

Maik
Comment 4 Stefan Brüns 2017-10-08 01:01:47 UTC
(In reply to Maik Qualmann from comment #3)
> Created attachment 108175 [details]
> qopenglwidget.patch
> 
> Hi Stephan,
> 
> this patch is not finished yet. It is only the attempt to replace QGLWidget
> with QOpenGLWiget. Can you test whether compiles digiKam under OpenGL ES?
> 
> Maik

Still broken:
https://build.opensuse.org/build/home:StefanBruens:branches:KDE:Extra/openSUSE_Factory_ARM/aarch64/digikam/_log

search for glClearDepth for the first error message.
Comment 5 caulier.gilles 2018-04-05 05:00:09 UTC
Stefan,

As i can see in your Suse build branch, all compile fine now. Right ?
Comment 6 Stefan Brüns 2018-04-05 21:54:08 UTC
(In reply to caulier.gilles from comment #5)
> Stefan,
> 
> As i can see in your Suse build branch, all compile fine now. Right ?

No, that one currently builds without opengl for Arm/Aarch64
Comment 7 caulier.gilles 2019-02-24 11:00:02 UTC
Maik, What's about this patch ?

Gilles
Comment 8 Maik Qualmann 2019-02-28 20:59:56 UTC
I will gradually port all deprecated QGLWidgets to QOpenGLWidgets. For openGL ES no commands from the openGL 1.0 and also 2.0 specification may be used. This requires more work and knowledge about openGL. Our code is not deprecated for the desktop and openGL 1.0 may still be used. OpenGL ES is for embedded systems (smartphones, gaming consoles) and is probably the future.

Maik
Comment 9 Maik Qualmann 2019-03-01 20:37:34 UTC
Git commit e4062ed416fe2556393cd801f899657796500ef4 by Maik Qualmann.
Committed on 01/03/2019 at 20:36.
Pushed by mqualmann into branch 'development/dplugins'.

port PresentationGL to QOpenGLWidget

M  +76   -82   core/dplugins/generic/view/presentation/opengl/presentationgl.cpp
M  +2    -2    core/dplugins/generic/view/presentation/opengl/presentationgl.h

https://commits.kde.org/digikam/e4062ed416fe2556393cd801f899657796500ef4
Comment 10 Maik Qualmann 2019-03-03 16:54:35 UTC
Git commit 57f92ada0fe939e29749518e1ab0ce67d4cf910a by Maik Qualmann.
Committed on 03/03/2019 at 16:52.
Pushed by mqualmann into branch 'development/dplugins'.

port PresentationKB to QOpenGLWidget

M  +3    -8    core/dplugins/generic/view/presentation/opengl/kbimageloader.cpp
M  +29   -44   core/dplugins/generic/view/presentation/opengl/presentationkb.cpp
M  +9    -8    core/dplugins/generic/view/presentation/opengl/presentationkb.h
M  +2    -0    core/dplugins/generic/view/presentation/opengl/presentationkb_p.h
M  +25   -11   core/dplugins/generic/view/presentation/presentationmngr.cpp

https://commits.kde.org/digikam/57f92ada0fe939e29749518e1ab0ce67d4cf910a
Comment 11 caulier.gilles 2019-06-02 10:49:23 UTC
Maik,

Just for info, under MacOS, OpenGL API is now annotated as deprecated API in favor of Apple Metal API. This want mean that all low level GL* calls must be replaced by portable QtOpenGL API instead.

I hide these OpenGL deprecated warnings for the moment to not pollute the compilation trace.

I GLViewer plugin will be also affected by this deprecation.

Gilles
Comment 12 Maik Qualmann 2019-06-03 05:55:49 UTC
In the near future I will deal more with OpenGL and start with the GLViewer. I think porting OpenGL in presentation is a nice task for GSoC20.

Maik
Comment 13 caulier.gilles 2020-08-04 08:08:51 UTC
digiKam 7.0.0 stable release is now published:

https://www.digikam.org/news/2020-07-19-7.0.0_release_announcement/

We need a fresh feedback on this file using this version.

Best Regards

Gilles Caulier
Comment 14 caulier.gilles 2023-10-12 05:48:41 UTC
Stefan,


What's about this file using current 8.2.0 AppImage Linux bundle ? It's
reproducible ?

https://files.kde.org/digikam/

Note: bundle is now based on Qt 5.15.11 and KDE framework 5.110.

Thanks in advance

Gilles Caulier