Bug 373161 - Flickers when animation is handled by OpenGL
Summary: Flickers when animation is handled by OpenGL
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: Other (add details in bug description)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-01 20:29 UTC by sunwebrw
Modified: 2018-04-09 00:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 18.08.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sunwebrw 2016-12-01 20:29:20 UTC
Gwenview 16.08.3
KDE Frameworks 5.28.0, Qt 5.7.0 (built against 5.7.0), The xcb windowing system
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Juniper XT [Radeon HD 5770]
           Display Server: X.Org 1.18.4 driver: radeon Resolution: 1920x1200@59.95hz
           GLX Renderer: Gallium 0.4 on AMD JUNIPER (DRM 2.43.0 / 4.4.33-1-MANJARO, LLVM 3.9.0)
           GLX Version: 3.0 Mesa 13.0.1

At first animation is handled by Software(everything is good) and then OpenGL(it flickers, better seen on black):
https://youtu.be/PYKB6E2qMAc
Comment 1 Huon 2018-04-09 00:24:43 UTC
Git commit 25fb575e7008a6cedb52aeee5327a488e3c2a1ac by Huon Imberger.
Committed on 09/04/2018 at 00:24.
Pushed by huoni into branch 'master'.

Improve Image View fade transitions

Summary:
This patch fixes three problems:

  # After D11630, fading to a raster image with alpha channel and 'None'
  background resulted in the old image showing through the transparent
  parts of the new image, then disappearing.
  # Switching to an SVG from a raster image resulted in the raster image
  not fading, then disappearing suddenly at the end of the animation.
  This was an issue before D11630.
  # When OpenGL is used for animations, the full screen background texture
  appears during animations then disappears.

Problem 1 was due to `DocumentView::setEraseBorders`, which effectively
filled the background of the document view, leaving the parts within
the image transparent. This was okay before D11630 because the
background behind the image was never visible, it was always filled with
the image itself, or a solid color / checkerboard pattern.
This patch fixes the problem by always filling the background with the
default brush, not just the borders.

Problem 2 is fixed at the same time because the code that erased the
borders had no effect on SVGs because the calculated image rect was the
same size as the document view.

Problem 3 is fixed by using `QGraphicsOpacityEffect` instead of directoy
setting the opacity using `setOpacity`.

Depends on D11630
FIXED-IN: 18.08.0

## Problem 1 Before
{F5776639}

## Problem 2 Before
{F5776643}

## After
(White background to show it doesn't shine through)
{F5783594}

Test Plan:
Test the transition between images in Image {nav View}, with the 'None'
transparent background option enabled. Should test between the folowing
types of images:

  - Large raster with no alpha channel, e.g. a wallpaper
  - Raster image with alpha channel
  - SVG

Animation should be smooth with no artifacts. The main view background
shouldn't be visible behind the image during the fade.

{nav View} with animations turned off should work as expected.

Full screen should show a textured background with OpenGL animations, i.e.,
no different than with Software animations.

Reviewers: #gwenview, rkflx, ngraham

Reviewed By: #gwenview, rkflx, ngraham

Tags: #gwenview

Differential Revision: https://phabricator.kde.org/D11795

M  +1    -1    app/viewmainpage.cpp
M  +22   -18   lib/documentview/documentview.cpp
M  +5    -5    lib/documentview/documentview.h
M  +10   -3    lib/documentview/documentviewcontainer.cpp
M  +5    -0    lib/documentview/documentviewcontainer.h

https://commits.kde.org/gwenview/25fb575e7008a6cedb52aeee5327a488e3c2a1ac