[-]
[+]
|
Changed |
_service:tar_git:qtscenegraph-adaptation.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:qtscenegraph-adaptation-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:qtscenegraph-adaptation-0.6.6.tar.bz2/customcontext/context.cpp
^
|
@@ -51,6 +51,7 @@
#include <QtQuick/QSGVertexColorMaterial>
#include <QtQuick/QSGOpaqueTextureMaterial>
#include <QtQuick/QSGTextureMaterial>
+#include <QtQuick/QQuickWindow>
#include <private/qsgdefaultimagenode_p.h>
#include <private/qsgdefaultrectanglenode_p.h>
#include <private/qsgdistancefieldglyphnode_p_p.h>
@@ -437,8 +438,57 @@
}
#endif
+#if QT_VERSION >= 0x050600
+QSGTexture *CONTEXT_CLASS::createTexture(const QImage &image, uint flags) const
+{
+ if (flags & QQuickWindow::TextureCanUseAtlas) {
+#ifdef CUSTOMCONTEXT_ATLASTEXTURE
+ if (m_atlasTexture && atlas) {
+ QSGTexture *t = const_cast<Context *>(this)->m_atlasManager.create(image);
+ if (t)
+ return t;
+ }
+#endif
+ } else {
+#ifdef CUSTOMCONTEXT_EGLGRALLOCTEXTURE
+ if (static_cast<Context *>(sceneGraphContext())->hasEglGrallocTextures()) {
+
+ // Only use gralloc textures for textures created outside the render thread.
+ // They can still block for as long as normal texture, so better to not waste
+ // the precious resource.
+ if (openglContext() != 0 && openglContext()->thread() != QThread::currentThread()) {
+ EglGrallocTexture *t = EglGrallocTexture::create(image);
+ if (t)
+ return t;
+ }
+ }
+#endif
+#ifdef CUSTOMCONTEXT_HYBRISTEXTURE
+ if (static_cast<Context *>(sceneGraphContext())->hasHybrisTextures()) {
+
+ // Only use hybris textures for textures created outside the render thread.
+ // They can still block for as long as normal texture, so better to not waste
+ // the precious resource.
+ if (openglContext() != 0 && openglContext()->thread() != QThread::currentThread()) {
+ HybrisTexture *t = HybrisTexture::create(image);
+ if (t)
+ return t;
+ }
+ }
+#endif
+ }
+
+#ifdef CUSTOMCONTEXT_MACTEXTURE
+ if (m_macTexture)
+ return new MacTexture(image);
+#endif
+ return CONTEXT_CLASS_BASE::createTexture(image, flags);
+}
+
+#else
+
QSGTexture *CONTEXT_CLASS::createTexture(const QImage &image) const
{
#ifdef CUSTOMCONTEXT_ATLASTEXTURE
@@ -489,8 +539,12 @@
return CONTEXT_CLASS_BASE::createTextureNoAtlas(image);
}
+
+// Qt 5.2 branch
#endif
+// Qt 5.6 branch
+#endif
QSGRenderer *CONTEXT_CLASS::createRenderer()
|
[-]
[+]
|
Changed |
_service:tar_git:qtscenegraph-adaptation-0.6.6.tar.bz2/customcontext/context.h
^
|
@@ -75,8 +75,14 @@
void initialize(QOpenGLContext *context);
void invalidate();
void renderNextFrame(QSGRenderer *renderer, GLuint fbo);
+
+#if QT_VERSION < 0x050600
QSGTexture *createTexture(const QImage &image) const;
QSGTexture *createTextureNoAtlas(const QImage &image) const;
+#else
+ QSGTexture *createTexture(const QImage &image, uint flags) const;
+#endif
+
QSGRenderer *createRenderer();
#ifdef PROGRAM_BINARY
|
[-]
[+]
|
Changed |
_service:tar_git:qtscenegraph-adaptation-0.6.6.tar.bz2/customcontext/customcontext.pro
^
|
@@ -84,7 +84,7 @@
HEADERS += texture/eglgralloctexture.h
INCLUDEPATH += texture $(ANDROID_SDK_INCLUDE) $(ANDROID_SDK_INCLUDE)/android
- LIBS += -lhardware
+ LIBS += -lhardware -lEGL
} else {
message("eglgralloctexure .........: no")
@@ -96,6 +96,7 @@
SOURCES += texture/hybristexture.cpp
HEADERS += texture/hybristexture.h
INCLUDEPATH += texture
+ LIBS += -lEGL
} else {
message("hybristexture ............: no")
@@ -204,6 +205,7 @@
message("programbinary ............: yes")
DEFINES += PROGRAM_BINARY
SOURCES += programbinary.cpp
+ LIBS += -lEGL
} else {
message("programbinary ............: no")
}
|
[-]
[+]
|
Changed |
_service:tar_git:qtscenegraph-adaptation-0.6.6.tar.bz2/customcontext/renderer/qsgbasicclipmanager_p.h
^
|
@@ -78,6 +78,15 @@
template<typename ClipRenderer, typename ShaderStateTracker>
void activate(const QSGClipNode *clip, ClipRenderer *clipRenderer, ShaderStateTracker *tracker, QOpenGLFunctions *gl);
+ void reset(QOpenGLFunctions *gl) {
+ if (m_clipType & StencilClip)
+ gl->glDisable(GL_STENCIL_TEST);
+ if (m_clipType & ScissorClip)
+ gl->glDisable(GL_SCISSOR_TEST);
+ m_clipType = NoClip;
+ m_currentClip = 0;
+ }
+
ClipType clipType() const { return m_clipType; }
const QSGClipNode *currentClip() const { return m_currentClip; }
@@ -175,8 +184,14 @@
m_program = new QOpenGLShaderProgram();
QSGShaderSourceBuilder::initializeProgramFromFiles(
m_program,
+#if QT_VERSION >= 0x050600
+ QStringLiteral(":/qt-project.org/scenegraph/shaders/stencilclip.vert"),
+ QStringLiteral(":/qt-project.org/scenegraph/shaders/stencilclip.frag")
+#else
QStringLiteral(":/scenegraph/shaders/stencilclip.vert"),
- QStringLiteral(":/scenegraph/shaders/stencilclip.frag"));
+ QStringLiteral(":/scenegraph/shaders/stencilclip.frag")
+#endif
+ );
m_program->bindAttributeLocation("vCoord", 0);
m_program->link();
m_clipMatrixId = m_program->uniformLocation("matrix");
|
[-]
[+]
|
Changed |
_service:tar_git:qtscenegraph-adaptation-0.6.6.tar.bz2/customcontext/renderer/simplerenderer.cpp
^
|
@@ -434,6 +434,7 @@
}
}
+ m_clipManager->reset(this);
m_shaderManager->endFrame(this);
}
|