From: Martin Jansa Date: Tue, 22 Jul 2014 20:24:26 +0000 (+0200) Subject: qtbase: restore QOpenGLPaintDevice-sub-area-support.patch from 5.3.0 X-Git-Tag: rev_ivi_2015_02_04~866 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85477a501379f00058b21469d998251258e6a150;p=scm%2Fbb%2Ftizen-distro.git qtbase: restore QOpenGLPaintDevice-sub-area-support.patch from 5.3.0 (From meta-qt5 rev: 5111e23ae280756ff7fe7838d3b26aa66912c9ef) Signed-off-by: Martin Jansa Signed-off-by: Patrick Ohly --- diff --git a/meta-qt5/recipes-qt/qt5/nativesdk-qtbase.inc b/meta-qt5/recipes-qt/qt5/nativesdk-qtbase.inc index be85b65..e3b2863 100644 --- a/meta-qt5/recipes-qt/qt5/nativesdk-qtbase.inc +++ b/meta-qt5/recipes-qt/qt5/nativesdk-qtbase.inc @@ -22,6 +22,7 @@ SRC_URI += "\ file://0008-configure-bump-path-length-from-256-to-512-character.patch \ file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \ file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \ + file://0011-QOpenGLPaintDevice-sub-area-support.patch \ " # common for qtbase-native and nativesdk-qtbase diff --git a/meta-qt5/recipes-qt/qt5/nativesdk-qtbase_git.bb b/meta-qt5/recipes-qt/qt5/nativesdk-qtbase_git.bb index fda58c9..4b91539 100644 --- a/meta-qt5/recipes-qt/qt5/nativesdk-qtbase_git.bb +++ b/meta-qt5/recipes-qt/qt5/nativesdk-qtbase_git.bb @@ -20,6 +20,7 @@ SRC_URI += "\ file://0008-configure-bump-path-length-from-256-to-512-character.patch \ file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \ file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \ + file://0011-QOpenGLPaintDevice-sub-area-support.patch \ " # common for qtbase-native and nativesdk-qtbase diff --git a/meta-qt5/recipes-qt/qt5/qtbase-git/0011-QOpenGLPaintDevice-sub-area-support.patch b/meta-qt5/recipes-qt/qt5/qtbase-git/0011-QOpenGLPaintDevice-sub-area-support.patch new file mode 100644 index 0000000..27496db --- /dev/null +++ b/meta-qt5/recipes-qt/qt5/qtbase-git/0011-QOpenGLPaintDevice-sub-area-support.patch @@ -0,0 +1,152 @@ +From 606dc31c85d97dff52b07ec9c896718c6533f670 Mon Sep 17 00:00:00 2001 +From: Jani Hautakangas +Date: Thu, 16 May 2013 09:52:07 +0300 +Subject: [PATCH 11/11] QOpenGLPaintDevice sub-area support + +Allows creating QOpenGLPaintDevice targetting sub-area +of binded framebuffer. + +Upstream-Status: Pending + +Change-Id: Ida2f079aa1ac0b87d36b54129e226399dbcdda80 + +Signed-off-by: Martin Jansa +--- + src/gui/opengl/qopenglpaintdevice.cpp | 12 ++++++++++++ + src/gui/opengl/qopenglpaintdevice.h | 2 ++ + src/gui/opengl/qopenglpaintengine.cpp | 9 +++++++-- + src/gui/opengl/qopenglpaintengine_p.h | 1 + + src/gui/opengl/qopengltextureglyphcache.cpp | 2 +- + 5 files changed, 23 insertions(+), 3 deletions(-) + +diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp +index 6750458..034630a 100644 +--- a/src/gui/opengl/qopenglpaintdevice.cpp ++++ b/src/gui/opengl/qopenglpaintdevice.cpp +@@ -111,6 +111,7 @@ class QOpenGLPaintDevicePrivate + public: + QOpenGLPaintDevicePrivate(const QSize &size); + ++ QPoint offset; + QSize size; + QOpenGLContext *ctx; + +@@ -159,6 +160,12 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height) + { + } + ++QOpenGLPaintDevice::QOpenGLPaintDevice(int x, int y, int width, int height) ++ : d_ptr(new QOpenGLPaintDevicePrivate(QSize(width, height))) ++{ ++ d_ptr->offset = QPoint(x,y); ++} ++ + /*! + Destroys the QOpenGLPaintDevice. + */ +@@ -228,6 +235,11 @@ QOpenGLContext *QOpenGLPaintDevice::context() const + return d_ptr->ctx; + } + ++QPoint QOpenGLPaintDevice::offset() const ++{ ++ return d_ptr->offset; ++} ++ + /*! + Returns the pixel size of the paint device. + +diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h +index c05571c..01eb1bc 100644 +--- a/src/gui/opengl/qopenglpaintdevice.h ++++ b/src/gui/opengl/qopenglpaintdevice.h +@@ -62,12 +62,14 @@ public: + QOpenGLPaintDevice(); + explicit QOpenGLPaintDevice(const QSize &size); + QOpenGLPaintDevice(int width, int height); ++ QOpenGLPaintDevice(int x, int y, int width, int height); + virtual ~QOpenGLPaintDevice(); + + int devType() const { return QInternal::OpenGL; } + QPaintEngine *paintEngine() const; + + QOpenGLContext *context() const; ++ QPoint offset() const; + QSize size() const; + void setSize(const QSize &size); + void setDevicePixelRatio(qreal devicePixelRatio); +diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp +index 81a0d82..ce57261 100644 +--- a/src/gui/opengl/qopenglpaintengine.cpp ++++ b/src/gui/opengl/qopenglpaintengine.cpp +@@ -1985,7 +1985,10 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev) + for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i) + d->vertexAttributeArraysEnabledState[i] = false; + ++ const QPoint offset = d->device->offset(); + const QSize sz = d->device->size(); ++ d->x = offset.x(); ++ d->y = offset.y(); + d->width = sz.width(); + d->height = sz.height(); + d->mode = BrushDrawingMode; +@@ -2070,7 +2073,7 @@ void QOpenGL2PaintEngineEx::ensureActive() + d->device->ensureActiveTarget(); + + d->transferMode(BrushDrawingMode); +- d->funcs.glViewport(0, 0, d->width, d->height); ++ d->funcs.glViewport(d->x, d->y, d->width, d->height); + d->needsSync = false; + d->lastMaskTextureUsed = 0; + d->shaderManager->setDirty(); +@@ -2113,6 +2116,7 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest() + if (bounds == QRect(0, 0, width, height)) { + funcs.glDisable(GL_SCISSOR_TEST); + } else { ++ bounds = QRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()); + funcs.glEnable(GL_SCISSOR_TEST); + setScissor(bounds); + } +@@ -2121,12 +2125,13 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest() + + void QOpenGL2PaintEngineExPrivate::setScissor(const QRect &rect) + { +- const int left = rect.left(); ++ const int left = rect.left() + x; + const int width = rect.width(); + int bottom = height - (rect.top() + rect.height()); + if (device->paintFlipped()) { + bottom = rect.top(); + } ++ bottom += y; + const int height = rect.height(); + + funcs.glScissor(left, bottom, width, height); +diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h +index 4f0e2e5..f211de1 100644 +--- a/src/gui/opengl/qopenglpaintengine_p.h ++++ b/src/gui/opengl/qopenglpaintengine_p.h +@@ -264,6 +264,7 @@ public: + QOpenGL2PaintEngineEx* q; + QOpenGLEngineShaderManager* shaderManager; + QOpenGLPaintDevice* device; ++ int x, y; + int width, height; + QOpenGLContext *ctx; + EngineMode mode; +diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp +index 0610ab6..ea1e3b2 100644 +--- a/src/gui/opengl/qopengltextureglyphcache.cpp ++++ b/src/gui/opengl/qopengltextureglyphcache.cpp +@@ -316,7 +316,7 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) + funcs->glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)oldFbo); + + if (pex != 0) { +- funcs->glViewport(0, 0, pex->width, pex->height); ++ funcs->glViewport(pex->x, pex->y, pex->width, pex->height); + pex->updateClipScissorTest(); + } else { + if (m_vao.isCreated()) { +-- +2.0.2 + diff --git a/meta-qt5/recipes-qt/qt5/qtbase-native.inc b/meta-qt5/recipes-qt/qt5/qtbase-native.inc index 415cda2..e935d70 100644 --- a/meta-qt5/recipes-qt/qt5/qtbase-native.inc +++ b/meta-qt5/recipes-qt/qt5/qtbase-native.inc @@ -19,6 +19,7 @@ SRC_URI += "\ file://0008-configure-bump-path-length-from-256-to-512-character.patch \ file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \ file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \ + file://0011-QOpenGLPaintDevice-sub-area-support.patch \ " # common for qtbase-native and nativesdk-qtbase diff --git a/meta-qt5/recipes-qt/qt5/qtbase-native_git.bb b/meta-qt5/recipes-qt/qt5/qtbase-native_git.bb index df2f662..9a9d3ca 100644 --- a/meta-qt5/recipes-qt/qt5/qtbase-native_git.bb +++ b/meta-qt5/recipes-qt/qt5/qtbase-native_git.bb @@ -17,6 +17,7 @@ SRC_URI += "\ file://0008-configure-bump-path-length-from-256-to-512-character.patch \ file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \ file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \ + file://0011-QOpenGLPaintDevice-sub-area-support.patch \ " # common for qtbase-native and nativesdk-qtbase diff --git a/meta-qt5/recipes-qt/qt5/qtbase.inc b/meta-qt5/recipes-qt/qt5/qtbase.inc index ce35410..9941cda 100644 --- a/meta-qt5/recipes-qt/qt5/qtbase.inc +++ b/meta-qt5/recipes-qt/qt5/qtbase.inc @@ -12,6 +12,7 @@ SRC_URI += "\ file://0008-configure-bump-path-length-from-256-to-512-character.patch \ file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \ file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \ + file://0011-QOpenGLPaintDevice-sub-area-support.patch \ " # specific for qtbase diff --git a/meta-qt5/recipes-qt/qt5/qtbase/0011-QOpenGLPaintDevice-sub-area-support.patch b/meta-qt5/recipes-qt/qt5/qtbase/0011-QOpenGLPaintDevice-sub-area-support.patch new file mode 100644 index 0000000..27496db --- /dev/null +++ b/meta-qt5/recipes-qt/qt5/qtbase/0011-QOpenGLPaintDevice-sub-area-support.patch @@ -0,0 +1,152 @@ +From 606dc31c85d97dff52b07ec9c896718c6533f670 Mon Sep 17 00:00:00 2001 +From: Jani Hautakangas +Date: Thu, 16 May 2013 09:52:07 +0300 +Subject: [PATCH 11/11] QOpenGLPaintDevice sub-area support + +Allows creating QOpenGLPaintDevice targetting sub-area +of binded framebuffer. + +Upstream-Status: Pending + +Change-Id: Ida2f079aa1ac0b87d36b54129e226399dbcdda80 + +Signed-off-by: Martin Jansa +--- + src/gui/opengl/qopenglpaintdevice.cpp | 12 ++++++++++++ + src/gui/opengl/qopenglpaintdevice.h | 2 ++ + src/gui/opengl/qopenglpaintengine.cpp | 9 +++++++-- + src/gui/opengl/qopenglpaintengine_p.h | 1 + + src/gui/opengl/qopengltextureglyphcache.cpp | 2 +- + 5 files changed, 23 insertions(+), 3 deletions(-) + +diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp +index 6750458..034630a 100644 +--- a/src/gui/opengl/qopenglpaintdevice.cpp ++++ b/src/gui/opengl/qopenglpaintdevice.cpp +@@ -111,6 +111,7 @@ class QOpenGLPaintDevicePrivate + public: + QOpenGLPaintDevicePrivate(const QSize &size); + ++ QPoint offset; + QSize size; + QOpenGLContext *ctx; + +@@ -159,6 +160,12 @@ QOpenGLPaintDevice::QOpenGLPaintDevice(int width, int height) + { + } + ++QOpenGLPaintDevice::QOpenGLPaintDevice(int x, int y, int width, int height) ++ : d_ptr(new QOpenGLPaintDevicePrivate(QSize(width, height))) ++{ ++ d_ptr->offset = QPoint(x,y); ++} ++ + /*! + Destroys the QOpenGLPaintDevice. + */ +@@ -228,6 +235,11 @@ QOpenGLContext *QOpenGLPaintDevice::context() const + return d_ptr->ctx; + } + ++QPoint QOpenGLPaintDevice::offset() const ++{ ++ return d_ptr->offset; ++} ++ + /*! + Returns the pixel size of the paint device. + +diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h +index c05571c..01eb1bc 100644 +--- a/src/gui/opengl/qopenglpaintdevice.h ++++ b/src/gui/opengl/qopenglpaintdevice.h +@@ -62,12 +62,14 @@ public: + QOpenGLPaintDevice(); + explicit QOpenGLPaintDevice(const QSize &size); + QOpenGLPaintDevice(int width, int height); ++ QOpenGLPaintDevice(int x, int y, int width, int height); + virtual ~QOpenGLPaintDevice(); + + int devType() const { return QInternal::OpenGL; } + QPaintEngine *paintEngine() const; + + QOpenGLContext *context() const; ++ QPoint offset() const; + QSize size() const; + void setSize(const QSize &size); + void setDevicePixelRatio(qreal devicePixelRatio); +diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp +index 81a0d82..ce57261 100644 +--- a/src/gui/opengl/qopenglpaintengine.cpp ++++ b/src/gui/opengl/qopenglpaintengine.cpp +@@ -1985,7 +1985,10 @@ bool QOpenGL2PaintEngineEx::begin(QPaintDevice *pdev) + for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i) + d->vertexAttributeArraysEnabledState[i] = false; + ++ const QPoint offset = d->device->offset(); + const QSize sz = d->device->size(); ++ d->x = offset.x(); ++ d->y = offset.y(); + d->width = sz.width(); + d->height = sz.height(); + d->mode = BrushDrawingMode; +@@ -2070,7 +2073,7 @@ void QOpenGL2PaintEngineEx::ensureActive() + d->device->ensureActiveTarget(); + + d->transferMode(BrushDrawingMode); +- d->funcs.glViewport(0, 0, d->width, d->height); ++ d->funcs.glViewport(d->x, d->y, d->width, d->height); + d->needsSync = false; + d->lastMaskTextureUsed = 0; + d->shaderManager->setDirty(); +@@ -2113,6 +2116,7 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest() + if (bounds == QRect(0, 0, width, height)) { + funcs.glDisable(GL_SCISSOR_TEST); + } else { ++ bounds = QRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()); + funcs.glEnable(GL_SCISSOR_TEST); + setScissor(bounds); + } +@@ -2121,12 +2125,13 @@ void QOpenGL2PaintEngineExPrivate::updateClipScissorTest() + + void QOpenGL2PaintEngineExPrivate::setScissor(const QRect &rect) + { +- const int left = rect.left(); ++ const int left = rect.left() + x; + const int width = rect.width(); + int bottom = height - (rect.top() + rect.height()); + if (device->paintFlipped()) { + bottom = rect.top(); + } ++ bottom += y; + const int height = rect.height(); + + funcs.glScissor(left, bottom, width, height); +diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h +index 4f0e2e5..f211de1 100644 +--- a/src/gui/opengl/qopenglpaintengine_p.h ++++ b/src/gui/opengl/qopenglpaintengine_p.h +@@ -264,6 +264,7 @@ public: + QOpenGL2PaintEngineEx* q; + QOpenGLEngineShaderManager* shaderManager; + QOpenGLPaintDevice* device; ++ int x, y; + int width, height; + QOpenGLContext *ctx; + EngineMode mode; +diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp +index 0610ab6..ea1e3b2 100644 +--- a/src/gui/opengl/qopengltextureglyphcache.cpp ++++ b/src/gui/opengl/qopengltextureglyphcache.cpp +@@ -316,7 +316,7 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) + funcs->glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)oldFbo); + + if (pex != 0) { +- funcs->glViewport(0, 0, pex->width, pex->height); ++ funcs->glViewport(pex->x, pex->y, pex->width, pex->height); + pex->updateClipScissorTest(); + } else { + if (m_vao.isCreated()) { +-- +2.0.2 + diff --git a/meta-qt5/recipes-qt/qt5/qtbase_git.bb b/meta-qt5/recipes-qt/qt5/qtbase_git.bb index b6de95f..65e92a0 100644 --- a/meta-qt5/recipes-qt/qt5/qtbase_git.bb +++ b/meta-qt5/recipes-qt/qt5/qtbase_git.bb @@ -17,6 +17,7 @@ SRC_URI += "\ file://0008-configure-bump-path-length-from-256-to-512-character.patch \ file://0009-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch \ file://0010-Revert-Use-the-gcc-feature-in-simd.prf.patch \ + file://0011-QOpenGLPaintDevice-sub-area-support.patch \ " # specific for qtbase