summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase/0006-QOpenGLPaintDevice-sub-area-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-qt/qt5/qtbase/0006-QOpenGLPaintDevice-sub-area-support.patch')
-rw-r--r--recipes-qt/qt5/qtbase/0006-QOpenGLPaintDevice-sub-area-support.patch154
1 files changed, 0 insertions, 154 deletions
diff --git a/recipes-qt/qt5/qtbase/0006-QOpenGLPaintDevice-sub-area-support.patch b/recipes-qt/qt5/qtbase/0006-QOpenGLPaintDevice-sub-area-support.patch
deleted file mode 100644
index c58b1d9a..00000000
--- a/recipes-qt/qt5/qtbase/0006-QOpenGLPaintDevice-sub-area-support.patch
+++ /dev/null
@@ -1,154 +0,0 @@
1From f207997b59f1381cf3523521209cb435b1a73f25 Mon Sep 17 00:00:00 2001
2From: Jani Hautakangas <jani.hautakangas@ixonos.com>
3Date: Thu, 16 May 2013 09:52:07 +0300
4Subject: [PATCH] QOpenGLPaintDevice sub-area support
5
6Allows creating QOpenGLPaintDevice targetting sub-area
7of binded framebuffer.
8
9Upstream-Status: Pending
10
11Change-Id: Ida2f079aa1ac0b87d36b54129e226399dbcdda80
12
13Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14---
15 src/gui/opengl/qopenglpaintdevice.cpp | 11 +++++++++++
16 src/gui/opengl/qopenglpaintdevice.h | 2 ++
17 src/gui/opengl/qopenglpaintdevice_p.h | 1 +
18 src/gui/opengl/qopenglpaintengine.cpp | 9 +++++++--
19 src/gui/opengl/qopenglpaintengine_p.h | 1 +
20 src/gui/opengl/qopengltextureglyphcache.cpp | 2 +-
21 6 files changed, 23 insertions(+), 3 deletions(-)
22
23diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
24index 75f09d6..17d7155 100644
25--- a/src/gui/opengl/qopenglpaintdevice.cpp
26+++ b/src/gui/opengl/qopenglpaintdevice.cpp
27@@ -141,6 +141,12 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height)
28 {
29 }
30
31+QOpenGLPaintDevice::QOpenGLPaintDevice(int x, int y, int width, int height)
32+ : d_ptr(new QOpenGLPaintDevicePrivate(QSize(width, height)))
33+{
34+ d_ptr->offset = QPoint(x,y);
35+}
36+
37 /*!
38 \internal
39 */
40@@ -222,6 +228,11 @@ QOpenGLContext *QOpenGLPaintDevice::context() const
41 return d_ptr->ctx;
42 }
43
44+QPoint QOpenGLPaintDevice::offset() const
45+{
46+ return d_ptr->offset;
47+}
48+
49 /*!
50 Returns the pixel size of the paint device.
51
52diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h
53index dffa68c..66a1e3d 100644
54--- a/src/gui/opengl/qopenglpaintdevice.h
55+++ b/src/gui/opengl/qopenglpaintdevice.h
56@@ -59,12 +59,14 @@ public:
57 QOpenGLPaintDevice();
58 explicit QOpenGLPaintDevice(const QSize &size);
59 QOpenGLPaintDevice(int width, int height);
60+ QOpenGLPaintDevice(int x, int y, int width, int height);
61 virtual ~QOpenGLPaintDevice();
62
63 int devType() const { return QInternal::OpenGL; }
64 QPaintEngine *paintEngine() const;
65
66 QOpenGLContext *context() const;
67+ QPoint offset() const;
68 QSize size() const;
69 void setSize(const QSize &size);
70 void setDevicePixelRatio(qreal devicePixelRatio);
71diff --git a/src/gui/opengl/qopenglpaintdevice_p.h b/src/gui/opengl/qopenglpaintdevice_p.h
72index 78e6b7a..6630461 100644
73--- a/src/gui/opengl/qopenglpaintdevice_p.h
74+++ b/src/gui/opengl/qopenglpaintdevice_p.h
75@@ -71,6 +71,7 @@ public:
76
77 public:
78 QSize size;
79+ QPoint offset;
80 QOpenGLContext *ctx;
81
82 qreal dpmx;
83diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
84index d93871c..be2bee9 100644
85--- a/src/gui/opengl/qopenglpaintengine.cpp
86+++ b/src/gui/opengl/qopenglpaintengine.cpp
87@@ -2084,7 +2084,10 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev)
88 for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i)
89 d->vertexAttributeArraysEnabledState[i] = false;
90
91+ const QPoint offset = d->device->offset();
92 const QSize sz = d->device->size();
93+ d->x = offset.x();
94+ d->y = offset.y();
95 d->width = sz.width();
96 d->height = sz.height();
97 d->mode = BrushDrawingMode;
98@@ -2171,7 +2174,7 @@ void QOpenGL2PaintEngineEx::ensureActive()
99 d->device->ensureActiveTarget();
100
101 d->transferMode(BrushDrawingMode);
102- d->funcs.glViewport(0, 0, d->width, d->height);
103+ d->funcs.glViewport(d->x, d->y, d->width, d->height);
104 d->needsSync = false;
105 d->shaderManager->setDirty();
106 d->syncGlState();
107@@ -2213,6 +2216,7 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest()
108 if (bounds == QRect(0, 0, width, height)) {
109 funcs.glDisable(GL_SCISSOR_TEST);
110 } else {
111+ bounds = QRect(bounds.x(), bounds.y(), bounds.width(), bounds.height());
112 funcs.glEnable(GL_SCISSOR_TEST);
113 setScissor(bounds);
114 }
115@@ -2221,12 +2225,13 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest()
116
117 void QOpenGL2PaintEngineExPrivate::setScissor(const QRect &rect)
118 {
119- const int left = rect.left();
120+ const int left = rect.left() + x;
121 const int width = rect.width();
122 int bottom = height - (rect.top() + rect.height());
123 if (device->paintFlipped()) {
124 bottom = rect.top();
125 }
126+ bottom += y;
127 const int height = rect.height();
128
129 funcs.glScissor(left, bottom, width, height);
130diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h
131index c9f3282..7c0616b 100644
132--- a/src/gui/opengl/qopenglpaintengine_p.h
133+++ b/src/gui/opengl/qopenglpaintengine_p.h
134@@ -270,6 +270,7 @@ public:
135 QOpenGL2PaintEngineEx* q;
136 QOpenGLEngineShaderManager* shaderManager;
137 QOpenGLPaintDevice* device;
138+ int x, y;
139 int width, height;
140 QOpenGLContext *ctx;
141 EngineMode mode;
142diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
143index 9a7b1eb..6f301f8 100644
144--- a/src/gui/opengl/qopengltextureglyphcache.cpp
145+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
146@@ -403,7 +403,7 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height)
147 funcs->glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)oldFbo);
148
149 if (pex != 0) {
150- funcs->glViewport(0, 0, pex->width, pex->height);
151+ funcs->glViewport(pex->x, pex->y, pex->width, pex->height);
152 pex->updateClipScissorTest();
153 } else {
154 if (m_vao.isCreated()) {