summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-18 13:13:54 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-18 13:13:59 +0200
commit6c5121eab75e61f807c2df0f14988317f220b945 (patch)
treeba7af7a7643f8dc986e5caa4151972f508a8e238
parent179fdc13c95198053c355182dae34fc554de320d (diff)
parent8e34d6f5399a29d45f9402219f13b631e29fd4b0 (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8v5.8.0-beta1
-rw-r--r--dist/changes-5.6.224
-rw-r--r--src/imports/qtcanvas3d/context3d.cpp30
-rw-r--r--src/imports/qtcanvas3d/context3d_p.h1
-rw-r--r--src/imports/qtcanvas3d/doc/src/qtcanvas3d.qdoc2
4 files changed, 53 insertions, 4 deletions
diff --git a/dist/changes-5.6.2 b/dist/changes-5.6.2
new file mode 100644
index 0000000..cae0522
--- /dev/null
+++ b/dist/changes-5.6.2
@@ -0,0 +1,24 @@
+Qt 5.6.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.6.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+ http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.6 series is binary compatible with the 5.5.x series.
+Applications compiled for 5.5 will continue to run with 5.6.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+Fixes
+-----
+
+- [QTBUG-54466] Check for null context in CanvasRenderJob.
+- [QTBUG-54876] Align pixel-row of the image passed to glTexImage2D to UNPACK_ALIGN.
diff --git a/src/imports/qtcanvas3d/context3d.cpp b/src/imports/qtcanvas3d/context3d.cpp
index 7e24c32..9040ccd 100644
--- a/src/imports/qtcanvas3d/context3d.cpp
+++ b/src/imports/qtcanvas3d/context3d.cpp
@@ -94,6 +94,7 @@ CanvasContext::CanvasContext(QQmlEngine *engine, bool isES2, int maxVertexAttrib
m_v4engine(QQmlEnginePrivate::getV4Engine(engine)),
m_unpackFlipYEnabled(false),
m_unpackPremultiplyAlphaEnabled(false),
+ m_unpackAlignmentValue(4),
m_devicePixelRatio(1.0),
m_currentProgram(0),
m_currentArrayBuffer(0),
@@ -1360,6 +1361,11 @@ QByteArray *CanvasContext::unpackPixels(uchar *srcData, bool useSrcDataAsDst,
<< ")";
int bytesPerRow = width * bytesPerPixel;
+
+ // Align bytesPerRow to UNPACK_ALIGNMENT setting
+ if ( m_unpackAlignmentValue > 1)
+ bytesPerRow = bytesPerRow + (m_unpackAlignmentValue - 1) - (bytesPerRow - 1) % m_unpackAlignmentValue;
+
int totalBytes = bytesPerRow * height;
QByteArray *unpackedData = 0;
@@ -2498,10 +2504,28 @@ void CanvasContext::pixelStorei(glEnums pname, int param)
case UNPACK_COLORSPACE_CONVERSION_WEBGL:
// Intentionally ignored
break;
- case PACK_ALIGNMENT: // Intentional fall-through
+ case PACK_ALIGNMENT:
+ if ( param == 1 || param == 2 || param == 4 || param == 8 ) {
+ m_commandQueue->queueCommand(CanvasGlCommandQueue::glPixelStorei,
+ GLint(pname), GLint(param));
+ } else {
+ m_error |= CANVAS_INVALID_VALUE;
+ qCWarning(canvas3drendering).nospace() << "Context3D::" << __FUNCTION__
+ << ":INVALID_VALUE:"
+ << "Invalid pack alignment: " << param;
+ }
+ break;
case UNPACK_ALIGNMENT:
- m_commandQueue->queueCommand(CanvasGlCommandQueue::glPixelStorei,
- GLint(pname), GLint(param));
+ if ( param == 1 || param == 2 || param == 4 || param == 8 ) {
+ m_unpackAlignmentValue = param;
+ m_commandQueue->queueCommand(CanvasGlCommandQueue::glPixelStorei,
+ GLint(pname), GLint(param));
+ } else {
+ m_error |= CANVAS_INVALID_VALUE;
+ qCWarning(canvas3drendering).nospace() << "Context3D::" << __FUNCTION__
+ << ":INVALID_VALUE:"
+ << "Invalid unpack alignment: " << param;
+ }
break;
default:
qCWarning(canvas3drendering).nospace() << "Context3D::" << __FUNCTION__
diff --git a/src/imports/qtcanvas3d/context3d_p.h b/src/imports/qtcanvas3d/context3d_p.h
index a5a2e9e..1a5b682 100644
--- a/src/imports/qtcanvas3d/context3d_p.h
+++ b/src/imports/qtcanvas3d/context3d_p.h
@@ -1283,6 +1283,7 @@ private:
QV4::ExecutionEngine *m_v4engine;
bool m_unpackFlipYEnabled;
bool m_unpackPremultiplyAlphaEnabled;
+ int m_unpackAlignmentValue;
qreal m_devicePixelRatio;
CanvasProgram *m_currentProgram;
CanvasBuffer *m_currentArrayBuffer;
diff --git a/src/imports/qtcanvas3d/doc/src/qtcanvas3d.qdoc b/src/imports/qtcanvas3d/doc/src/qtcanvas3d.qdoc
index 275defb..9bee436 100644
--- a/src/imports/qtcanvas3d/doc/src/qtcanvas3d.qdoc
+++ b/src/imports/qtcanvas3d/doc/src/qtcanvas3d.qdoc
@@ -210,7 +210,7 @@
*
* \list
* \li No emulation for vertex attrib 0 arrays. Always have vertex attrib 0 array enabled.
- * In desktop OpenGL on some platforms (for example OS X), nothing gets drawn if vertex attrib
+ * In desktop OpenGL on some platforms (for example \macos), nothing gets drawn if vertex attrib
* 0 is not array-enabled. You can use bindAttribLocation() to force a vertex attribute to use
* location 0, and use enableVertexAttribArray() to make it array-enabled.
*