diff options
Diffstat (limited to 'tests/auto/render/textures/tst_textures.cpp')
-rw-r--r-- | tests/auto/render/textures/tst_textures.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/auto/render/textures/tst_textures.cpp b/tests/auto/render/textures/tst_textures.cpp index 555bd09a3..fc0bd2543 100644 --- a/tests/auto/render/textures/tst_textures.cpp +++ b/tests/auto/render/textures/tst_textures.cpp @@ -34,11 +34,11 @@ #include <Qt3DRender/qtexturedata.h> #include <Qt3DRender/private/renderer_p.h> +#include <Qt3DRender/private/glresourcemanagers_p.h> #include <Qt3DRender/private/texture_p.h> #include <Qt3DRender/private/textureimage_p.h> #include <Qt3DRender/private/nodemanagers_p.h> #include <Qt3DRender/private/managers_p.h> -#include <Qt3DRender/private/gltexturemanager_p.h> #include <Qt3DRender/private/gltexture_p.h> #include <Qt3DRender/private/qtexture_p.h> @@ -238,8 +238,8 @@ private Q_SLOTS: renderer.updateTexture(bt1b); // THEN - QCOMPARE(mgrs->glTextureManager()->lookupResource(bt1a->peerId()), mgrs->glTextureManager()->lookupResource(bt1b->peerId())); - + QCOMPARE(renderer.glResourceManagers()->glTextureManager()->lookupResource(bt1a->peerId()), + renderer.glResourceManagers()->glTextureManager()->lookupResource(bt1b->peerId())); renderer.shutdown(); } @@ -274,11 +274,12 @@ private Q_SLOTS: // no 2 textures must be the same for (int i = 0; i < backend.size(); i++) for (int k = i+1; k < backend.size(); k++) - QVERIFY(mgrs->glTextureManager()->lookupResource(backend[i]->peerId()) != mgrs->glTextureManager()->lookupResource(backend[k]->peerId())); + QVERIFY(renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[i]->peerId()) != + renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[k]->peerId())); QVector<Qt3DRender::Render::GLTexture *> glTextures; for (Qt3DRender::Render::Texture *t : backend) - glTextures.push_back(mgrs->glTextureManager()->lookupResource(t->peerId())); + glTextures.push_back(renderer.glResourceManagers()->glTextureManager()->lookupResource(t->peerId())); // some texture generators must be the same QVERIFY(glTextures[0]->textureGenerator().data() == nullptr); @@ -304,6 +305,8 @@ private Q_SLOTS: Qt3DRender::Render::Renderer renderer(Qt3DRender::QRenderAspect::Synchronous); renderer.setNodeManagers(mgrs.data()); + Qt3DRender::Render::GLResourceManagers *glMgrs = renderer.glResourceManagers(); + // both texture having the same sharedTextureId { // GIVEN @@ -328,8 +331,8 @@ private Q_SLOTS: renderer.updateTexture(bt2); // THEN - Qt3DRender::Render::GLTexture *glt1 = mgrs->glTextureManager()->lookupResource(bt1->peerId()); - Qt3DRender::Render::GLTexture *glt2 = mgrs->glTextureManager()->lookupResource(bt2->peerId()); + Qt3DRender::Render::GLTexture *glt1 = glMgrs->glTextureManager()->lookupResource(bt1->peerId()); + Qt3DRender::Render::GLTexture *glt2 = glMgrs->glTextureManager()->lookupResource(bt2->peerId()); QVERIFY(glt1 != glt2); QCOMPARE(glt1->sharedTextureId(), bt1->sharedTextureId()); QCOMPARE(glt2->sharedTextureId(), bt2->sharedTextureId()); @@ -359,8 +362,8 @@ private Q_SLOTS: renderer.updateTexture(bt2); // THEN - Qt3DRender::Render::GLTexture *glt1 = mgrs->glTextureManager()->lookupResource(bt1->peerId()); - Qt3DRender::Render::GLTexture *glt2 = mgrs->glTextureManager()->lookupResource(bt2->peerId()); + Qt3DRender::Render::GLTexture *glt1 = glMgrs->glTextureManager()->lookupResource(bt1->peerId()); + Qt3DRender::Render::GLTexture *glt2 = glMgrs->glTextureManager()->lookupResource(bt2->peerId()); QVERIFY(glt1 != glt2); QCOMPARE(glt1->sharedTextureId(), bt1->sharedTextureId()); QCOMPARE(glt2->sharedTextureId(), bt2->sharedTextureId()); @@ -392,12 +395,12 @@ private Q_SLOTS: renderer.updateTexture(backendTexture); } - Qt3DRender::QTextureImageDataGeneratorPtr idg1a = mgrs->glTextureManager()->lookupResource(backend[0]->peerId())->images()[0].generator; - Qt3DRender::QTextureImageDataGeneratorPtr idg1b = mgrs->glTextureManager()->lookupResource(backend[1]->peerId())->images()[0].generator; - Qt3DRender::QTextureImageDataGeneratorPtr idg2 = mgrs->glTextureManager()->lookupResource(backend[1]->peerId())->images()[1].generator; - Qt3DRender::QTextureGeneratorPtr tg1a = mgrs->glTextureManager()->lookupResource(backend[0]->peerId())->textureGenerator(); - Qt3DRender::QTextureGeneratorPtr tg1b = mgrs->glTextureManager()->lookupResource(backend[2]->peerId())->textureGenerator(); - Qt3DRender::QTextureGeneratorPtr tg2 = mgrs->glTextureManager()->lookupResource(backend[1]->peerId())->textureGenerator(); + Qt3DRender::QTextureImageDataGeneratorPtr idg1a = renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[0]->peerId())->images()[0].generator; + Qt3DRender::QTextureImageDataGeneratorPtr idg1b = renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[1]->peerId())->images()[0].generator; + Qt3DRender::QTextureImageDataGeneratorPtr idg2 = renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[1]->peerId())->images()[1].generator; + Qt3DRender::QTextureGeneratorPtr tg1a = renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[0]->peerId())->textureGenerator(); + Qt3DRender::QTextureGeneratorPtr tg1b = renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[2]->peerId())->textureGenerator(); + Qt3DRender::QTextureGeneratorPtr tg2 = renderer.glResourceManagers()->glTextureManager()->lookupResource(backend[1]->peerId())->textureGenerator(); // THEN QVERIFY(idg1a); |