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