summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/ogl-runtime/0002-Adapt-distance-field-cache-to-5.14.patch
blob: 619a49e0f04b116680b27e1a2ddf010e652aaac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From e177fb4a0fcf4068cef6a0e018cd98e00f248a13 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@qt.io>
Date: Tue, 13 Aug 2019 10:13:47 +0200
Subject: [PATCH] Adapt distance field cache to 5.14

There is a new pure virtual in the base class in 5.14. It is not very
relevant here since this glyph cache is not used in combination with
the df text materials of Qt Quick. We can nonetheless implement the
virtual and return the correct value.

Task-number: QT3DS-3856
Change-Id: I97b807ec73a664488b63c8888bc8cd90a9c53589
---
 src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp | 7 +++++++
 src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp b/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp
index e945335..52f01ea 100644
--- a/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp
+++ b/src/runtimerender/Qt3DSDistanceFieldGlyphCache.cpp
@@ -513,6 +513,13 @@ bool Q3DSDistanceFieldGlyphCache::loadPregeneratedCache(const QRawFont &font)
     return true;
 }
 
+#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
+bool Q3DSDistanceFieldGlyphCache::eightBitFormatIsAlphaSwizzled() const
+{
+    return m_context.GetRenderContext().GetRenderContextType() == qt3ds::render::NVRenderContextValues::GLES2;
+}
+#endif // QT_VERSION >= QT_VERSION_CHECK(5,14,0)
+
 QT_END_NAMESPACE
 
 #endif // QT_VERSION >= QT_VERSION_CHECK(5,12,2)
diff --git a/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h b/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h
index 679d3ad..fb4826e 100644
--- a/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h
+++ b/src/runtimerender/Qt3DSDistanceFieldGlyphCache_p.h
@@ -76,6 +76,10 @@ public:
 
     qreal fontSize() const;
 
+#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
+    bool eightBitFormatIsAlphaSwizzled() const override;
+#endif
+
 private:
     bool loadPregeneratedCache(const QRawFont &font);
     TextureInfo *textureInfo(int index) const;