diff options
author | Alexander Irhin <alexander.irhin@lge.com> | 2013-05-24 11:37:02 -0700 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-06-07 11:43:33 +0200 |
commit | ac8a20d754f122b8238c145ccc346cdbae1158d0 (patch) | |
tree | b2e93d85efad6aa6d7d630ca8bf8632514490d4d /recipes-qt/qt5/qtbase-git/0018-QOpenGLPaintDevice-sub-area-support.patch | |
parent | 6f4e86b62121c94b36e89b8bd7de50099733547f (diff) | |
download | meta-qt5-ac8a20d754f122b8238c145ccc346cdbae1158d0.tar.gz |
qtbase: patches for WebKit hardware accelerated rendering support
0018 - Offset support for QOpenGLPaintDevice is required for
speedup WebKit hardware rendering.
0019 - Fix FBO restoring in QOpenGLTextureGlyphCache
Jira task
0020 - Uses right texture format to exclude extra convertion.
Signed-off-by: Alexander Irhin <alexander.irhin@lge.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5/qtbase-git/0018-QOpenGLPaintDevice-sub-area-support.patch')
-rw-r--r-- | recipes-qt/qt5/qtbase-git/0018-QOpenGLPaintDevice-sub-area-support.patch | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase-git/0018-QOpenGLPaintDevice-sub-area-support.patch b/recipes-qt/qt5/qtbase-git/0018-QOpenGLPaintDevice-sub-area-support.patch new file mode 100644 index 00000000..9d581f82 --- /dev/null +++ b/recipes-qt/qt5/qtbase-git/0018-QOpenGLPaintDevice-sub-area-support.patch | |||
@@ -0,0 +1,152 @@ | |||
1 | From 2efd051d3093ee4e4091a8947f28d9bd528f2e9e 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] 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 f0e7e49..fe9a30c 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 | @@ -159,6 +160,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 | @@ -228,6 +235,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 c05571c..01eb1bc 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 | void setDevicePixelRatio(qreal devicePixelRatio); | ||
76 | diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp | ||
77 | index 0782e42..52afc60 100644 | ||
78 | --- a/src/gui/opengl/qopenglpaintengine.cpp | ||
79 | +++ b/src/gui/opengl/qopenglpaintengine.cpp | ||
80 | @@ -1978,7 +1978,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 | @@ -2066,7 +2069,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 | @@ -2109,6 +2112,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 | @@ -2117,14 +2121,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 d51f0e5..0d4b38d 100644 | ||
127 | --- a/src/gui/opengl/qopenglpaintengine_p.h | ||
128 | +++ b/src/gui/opengl/qopenglpaintengine_p.h | ||
129 | @@ -264,6 +264,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 83f4075..ec29900 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.7.9.5 | ||
152 | |||