diff options
Diffstat (limited to 'recipes-qt/qt5/qtbase-5.0.2/0018-QOpenGLPaintDevice-sub-area-support.patch')
-rw-r--r-- | recipes-qt/qt5/qtbase-5.0.2/0018-QOpenGLPaintDevice-sub-area-support.patch | 152 |
1 files changed, 0 insertions, 152 deletions
diff --git a/recipes-qt/qt5/qtbase-5.0.2/0018-QOpenGLPaintDevice-sub-area-support.patch b/recipes-qt/qt5/qtbase-5.0.2/0018-QOpenGLPaintDevice-sub-area-support.patch deleted file mode 100644 index cbf4aed1..00000000 --- a/recipes-qt/qt5/qtbase-5.0.2/0018-QOpenGLPaintDevice-sub-area-support.patch +++ /dev/null | |||
@@ -1,152 +0,0 @@ | |||
1 | From c2c17a3198c85366f34b24abc80b20f27307d751 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 18/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 | src/gui/opengl/qopenglpaintdevice.cpp | 12 ++++++++++++ | ||
14 | src/gui/opengl/qopenglpaintdevice.h | 2 ++ | ||
15 | src/gui/opengl/qopenglpaintengine.cpp | 10 +++++++--- | ||
16 | src/gui/opengl/qopenglpaintengine_p.h | 1 + | ||
17 | src/gui/opengl/qopengltextureglyphcache.cpp | 2 +- | ||
18 | 5 files changed, 23 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp | ||
21 | index 0b3d9dc..5f4f1c9 100644 | ||
22 | --- a/src/gui/opengl/qopenglpaintdevice.cpp | ||
23 | +++ b/src/gui/opengl/qopenglpaintdevice.cpp | ||
24 | @@ -111,6 +111,7 @@ class QOpenGLPaintDevicePrivate | ||
25 | public: | ||
26 | QOpenGLPaintDevicePrivate(const QSize &size); | ||
27 | |||
28 | + QPoint offset; | ||
29 | QSize size; | ||
30 | QOpenGLContext *ctx; | ||
31 | |||
32 | @@ -158,6 +159,12 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height) | ||
33 | { | ||
34 | } | ||
35 | |||
36 | +QOpenGLPaintDevice::QOpenGLPaintDevice(int x, int y, int width, int height) | ||
37 | + : d_ptr(new QOpenGLPaintDevicePrivate(QSize(width, height))) | ||
38 | +{ | ||
39 | + d_ptr->offset = QPoint(x,y); | ||
40 | +} | ||
41 | + | ||
42 | /*! | ||
43 | Destroys the QOpenGLPaintDevice. | ||
44 | */ | ||
45 | @@ -226,6 +233,11 @@ QOpenGLContext *QOpenGLPaintDevice::context() const | ||
46 | return d_ptr->ctx; | ||
47 | } | ||
48 | |||
49 | +QPoint QOpenGLPaintDevice::offset() const | ||
50 | +{ | ||
51 | + return d_ptr->offset; | ||
52 | +} | ||
53 | + | ||
54 | /*! | ||
55 | Returns the pixel size of the paint device. | ||
56 | |||
57 | diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h | ||
58 | index 66850c7..6f8a849 100644 | ||
59 | --- a/src/gui/opengl/qopenglpaintdevice.h | ||
60 | +++ b/src/gui/opengl/qopenglpaintdevice.h | ||
61 | @@ -62,12 +62,14 @@ public: | ||
62 | QOpenGLPaintDevice(); | ||
63 | explicit QOpenGLPaintDevice(const QSize &size); | ||
64 | QOpenGLPaintDevice(int width, int height); | ||
65 | + QOpenGLPaintDevice(int x, int y, int width, int height); | ||
66 | virtual ~QOpenGLPaintDevice(); | ||
67 | |||
68 | int devType() const { return QInternal::OpenGL; } | ||
69 | QPaintEngine *paintEngine() const; | ||
70 | |||
71 | QOpenGLContext *context() const; | ||
72 | + QPoint offset() const; | ||
73 | QSize size() const; | ||
74 | void setSize(const QSize &size); | ||
75 | |||
76 | diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp | ||
77 | index 9fd8a7a..df29159 100644 | ||
78 | --- a/src/gui/opengl/qopenglpaintengine.cpp | ||
79 | +++ b/src/gui/opengl/qopenglpaintengine.cpp | ||
80 | @@ -1935,7 +1935,10 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev) | ||
81 | for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i) | ||
82 | d->vertexAttributeArraysEnabledState[i] = false; | ||
83 | |||
84 | + const QPoint offset = d->device->offset(); | ||
85 | const QSize sz = d->device->size(); | ||
86 | + d->x = offset.x(); | ||
87 | + d->y = offset.y(); | ||
88 | d->width = sz.width(); | ||
89 | d->height = sz.height(); | ||
90 | d->mode = BrushDrawingMode; | ||
91 | @@ -2023,7 +2026,7 @@ void QOpenGL2PaintEngineEx::ensureActive() | ||
92 | d->device->ensureActiveTarget(); | ||
93 | |||
94 | d->transferMode(BrushDrawingMode); | ||
95 | - glViewport(0, 0, d->width, d->height); | ||
96 | + glViewport(d->x, d->y, d->width, d->height); | ||
97 | d->needsSync = false; | ||
98 | d->lastMaskTextureUsed = 0; | ||
99 | d->shaderManager->setDirty(); | ||
100 | @@ -2066,6 +2069,7 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest() | ||
101 | if (bounds == QRect(0, 0, width, height)) { | ||
102 | glDisable(GL_SCISSOR_TEST); | ||
103 | } else { | ||
104 | + bounds = QRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()); | ||
105 | glEnable(GL_SCISSOR_TEST); | ||
106 | setScissor(bounds); | ||
107 | } | ||
108 | @@ -2074,14 +2078,14 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest() | ||
109 | |||
110 | void QOpenGL2PaintEngineExPrivate::setScissor(const QRect &rect) | ||
111 | { | ||
112 | - const int left = rect.left(); | ||
113 | + const int left = rect.left() + x; | ||
114 | const int width = rect.width(); | ||
115 | int bottom = height - (rect.top() + rect.height()); | ||
116 | if (device->paintFlipped()) { | ||
117 | bottom = rect.top(); | ||
118 | } | ||
119 | + bottom += y; | ||
120 | const int height = rect.height(); | ||
121 | - | ||
122 | glScissor(left, bottom, width, height); | ||
123 | } | ||
124 | |||
125 | diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h | ||
126 | index 93e1b42..d84e8c7 100644 | ||
127 | --- a/src/gui/opengl/qopenglpaintengine_p.h | ||
128 | +++ b/src/gui/opengl/qopenglpaintengine_p.h | ||
129 | @@ -261,6 +261,7 @@ public: | ||
130 | QOpenGL2PaintEngineEx* q; | ||
131 | QOpenGLEngineShaderManager* shaderManager; | ||
132 | QOpenGLPaintDevice* device; | ||
133 | + int x, y; | ||
134 | int width, height; | ||
135 | QOpenGLContext *ctx; | ||
136 | EngineMode mode; | ||
137 | diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp | ||
138 | index b751629..8822faf 100644 | ||
139 | --- a/src/gui/opengl/qopengltextureglyphcache.cpp | ||
140 | +++ b/src/gui/opengl/qopengltextureglyphcache.cpp | ||
141 | @@ -268,7 +268,7 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) | ||
142 | funcs.glBindFramebuffer(GL_FRAMEBUFFER, ctx->d_func()->current_fbo); | ||
143 | |||
144 | if (pex != 0) { | ||
145 | - glViewport(0, 0, pex->width, pex->height); | ||
146 | + glViewport(pex->x, pex->y, pex->width, pex->height); | ||
147 | pex->updateClipScissorTest(); | ||
148 | } else { | ||
149 | m_blitProgram->disableAttributeArray(int(QT_VERTEX_COORDS_ATTR)); | ||
150 | -- | ||
151 | 1.8.3.2 | ||
152 | |||