revert-Set-sharedPainter-correctly-for-QGraphicsEffect.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From f4bc1f620727366b6a977b106cc68fade95ef426 Mon Sep 17 00:00:00 2001
  2. From: Evangelos Foutras <evangelos@foutrelis.com>
  3. Date: Wed, 21 Feb 2018 04:20:20 +0200
  4. Subject: [PATCH] Revert "Set sharedPainter correctly for QGraphicsEffect"
  5. This reverts commit 7257862fb2edfab0219d6cd45c83677049404f7d.
  6. ---
  7. src/widgets/kernel/qwidget.cpp | 4 ++--
  8. .../effects/qgraphicseffect/tst_qgraphicseffect.cpp | 21 ---------------------
  9. 2 files changed, 2 insertions(+), 23 deletions(-)
  10. diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
  11. index a973bee2cd..256c77e5a0 100644
  12. --- a/src/widgets/kernel/qwidget.cpp
  13. +++ b/src/widgets/kernel/qwidget.cpp
  14. @@ -5482,11 +5482,11 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
  15. setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), rgn.translated(offset));
  16. QPainter p(pdev);
  17. p.translate(offset);
  18. - context.painter = context.sharedPainter = &p;
  19. + context.painter = &p;
  20. graphicsEffect->draw(&p);
  21. setSystemClip(pdev->paintEngine(), 1, QRegion());
  22. } else {
  23. - context.painter = context.sharedPainter = sharedPainter;
  24. + context.painter = sharedPainter;
  25. if (sharedPainter->worldTransform() != sourced->lastEffectTransform) {
  26. sourced->invalidateCache();
  27. sourced->lastEffectTransform = sharedPainter->worldTransform();
  28. diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
  29. index dfe5baba71..a1cb729849 100644
  30. --- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
  31. +++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
  32. @@ -52,7 +52,6 @@ private slots:
  33. void boundingRect2();
  34. void draw();
  35. void opacity();
  36. - void nestedOpaqueOpacity();
  37. void grayscale();
  38. void colorize();
  39. void drawPixmapItem();
  40. @@ -408,26 +407,6 @@ void tst_QGraphicsEffect::opacity()
  41. QCOMPARE(effect->m_opacity, qreal(0.5));
  42. }
  43. -void tst_QGraphicsEffect::nestedOpaqueOpacity()
  44. -{
  45. - // QTBUG-60231: Nesting widgets with a QGraphicsEffect on a toplevel with
  46. - // QGraphicsOpacityEffect caused crashes due to constructing several
  47. - // QPainter instances on a device in the fast path for
  48. - // QGraphicsOpacityEffect::opacity=1
  49. - QWidget topLevel;
  50. - topLevel.setWindowTitle(QTest::currentTestFunction());
  51. - topLevel.resize(320, 200);
  52. - QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect;
  53. - opacityEffect->setOpacity(1);
  54. - topLevel.setGraphicsEffect(opacityEffect);
  55. - QWidget *child = new QWidget(&topLevel);
  56. - child->resize(topLevel.size() / 2);
  57. - QGraphicsDropShadowEffect *childEffect = new QGraphicsDropShadowEffect;
  58. - child->setGraphicsEffect(childEffect);
  59. - topLevel.show();
  60. - QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
  61. -}
  62. -
  63. void tst_QGraphicsEffect::grayscale()
  64. {
  65. if (qApp->desktop()->depth() < 24)
  66. --
  67. 2.16.2