summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/texture
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2016-07-05 19:20:57 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-11-14 13:55:39 +0000
commitf1ce8594d41042665970ffefee4a9c053e817e73 (patch)
treea95c62c3529167afd3cea1d491713d4db3c1226a /tests/auto/render/texture
parenta5c4c4fc8f12f9d58ba0abfb616cbf27e8b1593a (diff)
Texture backend refactoring
Texture node only tracks frontend properties and a non-owning pointer to the GLTexture The backend Texture node basically just keeps track of it's properties, parameters, and data. It relies on the GLTextureManager to provide a GLTexture that matches these properties/parameters/data. If a backend Texture node is created or modified, it is marked dirty and added to the TextureManager's list of dirty textures. At the start of each frame, all gathered dirty textures will ask the GLTextureManager for a GLTexture instance that matches the texture properties. Change-Id: Ie436e52ce644a489552cad1633f2233b8c15803f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/auto/render/texture')
-rw-r--r--tests/auto/render/texture/tst_texture.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/render/texture/tst_texture.cpp b/tests/auto/render/texture/tst_texture.cpp
index 5c6bc2b37..361cd3117 100644
--- a/tests/auto/render/texture/tst_texture.cpp
+++ b/tests/auto/render/texture/tst_texture.cpp
@@ -185,12 +185,12 @@ void tst_RenderTexture::checkPropertyMirroring()
// THEN
QCOMPARE(backend.peerId(), frontend.id());
- QCOMPARE(backend.target(), Target);
- QCOMPARE(backend.width(), frontend.width());
- QCOMPARE(backend.height(), frontend.height());
- QCOMPARE(backend.depth(), frontend.depth());
- QCOMPARE(backend.layers(), frontend.layers());
- QCOMPARE(backend.samples(), frontend.samples());
+ QCOMPARE(backend.properties().target, Target);
+ QCOMPARE(backend.properties().width, frontend.width());
+ QCOMPARE(backend.properties().height, frontend.height());
+ QCOMPARE(backend.properties().depth, frontend.depth());
+ QCOMPARE(backend.properties().layers, frontend.layers());
+ QCOMPARE(backend.properties().samples, frontend.samples());
}
void tst_RenderTexture::checkPropertyMirroring()
@@ -222,7 +222,7 @@ void tst_RenderTexture::checkPropertyChanges()
backend.sceneChangeEvent(updateChange);
// THEN
- QCOMPARE(backend.width(), 256);
+ QCOMPARE(backend.properties().width, 256);
// WHEN
updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
@@ -231,7 +231,7 @@ void tst_RenderTexture::checkPropertyChanges()
backend.sceneChangeEvent(updateChange);
// THEN
- QCOMPARE(backend.height(), 128);
+ QCOMPARE(backend.properties().height, 128);
// WHEN
updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
@@ -240,7 +240,7 @@ void tst_RenderTexture::checkPropertyChanges()
backend.sceneChangeEvent(updateChange);
// THEN
- QCOMPARE(backend.depth(), 16);
+ QCOMPARE(backend.properties().depth, 16);
// WHEN
updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
@@ -249,7 +249,7 @@ void tst_RenderTexture::checkPropertyChanges()
backend.sceneChangeEvent(updateChange);
// THEN
- QCOMPARE(backend.layers(), 32);
+ QCOMPARE(backend.properties().layers, 32);
// WHEN
updateChange.reset(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
@@ -258,7 +258,7 @@ void tst_RenderTexture::checkPropertyChanges()
backend.sceneChangeEvent(updateChange);
// THEN
- QCOMPARE(backend.samples(), 64);
+ QCOMPARE(backend.properties().samples, 64);
}
QTEST_APPLESS_MAIN(tst_RenderTexture)