summaryrefslogtreecommitdiffstats
path: root/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2020-10-02 10:20:14 +0300
committerAntti Määttä <antti.maatta@qt.io>2020-10-06 06:47:19 +0300
commitd0e28c072e402fa1e7dcac639cbc96a8caf2f0d5 (patch)
tree5217c7f0c2711b2e5d3d9ad077c8c499d2910dcc /src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h
parent58c0ba0f94df44c4ef24af864cb63d163fedfa1c (diff)
Fix crash when slide change occurs
The buffer manager needs to use resolved paths for each image loading function. Also convert to use QString to avoid unnecessary string conversions. Also fix image loading task to use resolved paths. Task-number: QT3DS-4177 Change-Id: I79fae56a8f49ccbdcaed1fa9eb9a9d875583d0dd Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h')
-rw-r--r--src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h b/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h
index 922e502..7445b90 100644
--- a/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h
+++ b/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.h
@@ -54,20 +54,17 @@ namespace render {
virtual ~IBufferManager() {}
public:
- // Path manipulation used to get the final path form a base path plus relative extension
- virtual CRegisteredString CombineBaseAndRelative(const char8_t *inBase,
- const char8_t *inRelative) = 0;
- virtual void SetImageHasTransparency(CRegisteredString inSourcePath,
+ virtual void SetImageHasTransparency(const QString &resolvedPath,
bool inHasTransparency, bool alsoOpaque) = 0;
- virtual bool GetImageHasTransparency(CRegisteredString inSourcePath) const = 0;
- virtual bool GetImageHasOpaquePixels(CRegisteredString inSourcePath) const = 0;
- virtual void SetImageTransparencyToFalseIfNotSet(CRegisteredString inSourcePath) = 0;
- virtual void SetInvertImageUVCoords(CRegisteredString inSourcePath,
+ virtual bool GetImageHasTransparency(const QString &resolvedPath) const = 0;
+ virtual bool GetImageHasOpaquePixels(const QString &resolvedPath) const = 0;
+ virtual void SetImageTransparencyToFalseIfNotSet(const QString &resolvedPathh) = 0;
+ virtual void SetInvertImageUVCoords(const QString &resolvedPath,
bool inShouldInvertCoords) = 0;
// Returns true if this image has been loaded into memory
// This call is threadsafe. Nothing else on this object is guaranteed to be.
- virtual bool IsImageLoaded(CRegisteredString inSourcePath) = 0;
+ virtual bool IsImageLoaded(const QString &sourcePath) = 0;
// Alias one image path with another image path. Optionally this object will ignore the
// call if
@@ -75,9 +72,9 @@ namespace render {
// to be shown
// in place of an image that is loading offline.
// Returns true if the image was aliased, false otherwise.
- virtual bool AliasImagePath(CRegisteredString inSourcePath, CRegisteredString inAliasPath,
+ virtual bool AliasImagePath(const QString &resolvedPath, const QString &inAliasPath,
bool inIgnoreIfLoaded) = 0;
- virtual void UnaliasImagePath(CRegisteredString inSourcePath) = 0;
+ virtual void UnaliasImagePath(const QString &resolvedPath) = 0;
// Return resolved imagepaths from unresolved sourcepaths
static QString resolveImagePath(const QString &sourcePath, bool preferKtx);
@@ -87,15 +84,15 @@ namespace render {
// Returns the given source path unless the source path is aliased; in which case returns
// the aliased path.
- virtual CRegisteredString GetImagePath(CRegisteredString inSourcePath) = 0;
+ virtual QString GetImagePath(const QString &sourcePath) = 0;
// Returns a texture and a boolean indicating if this texture has transparency in it or not.
// Can't name this LoadImage because that gets mangled by windows to LoadImageA (uggh)
// In some cases we need to only scan particular images for transparency.
- virtual SImageTextureData LoadRenderImage(CRegisteredString inImagePath,
+ virtual SImageTextureData LoadRenderImage(const QString &sourcePath,
SLoadedTexture &inTexture,
bool inForceScanForTransparency = false,
bool inBsdfMipmaps = false) = 0;
- virtual SImageTextureData LoadRenderImage(CRegisteredString inSourcePath,
+ virtual SImageTextureData LoadRenderImage(const QString &sourcePath,
bool inForceScanForTransparency = false,
bool inBsdfMipmaps = false) = 0;
@@ -106,8 +103,8 @@ namespace render {
virtual void enableReloadableResources(bool enable) = 0;
virtual bool isReloadableResourcesEnabled() const = 0;
- virtual void loadSet(const QSet<QString> &unifiedImageSet, bool flipCompressed) = 0;
- virtual void unloadSet(const QSet<QString> &unifiedImageSet) = 0;
+ virtual void loadSet(const QSet<QString> &resolvedImageSet, bool flipCompressed) = 0;
+ virtual void unloadSet(const QSet<QString> &resolvedImageSet) = 0;
virtual void reloadAll(bool flipCompressed) = 0;
virtual void loadCustomMesh(const QString &name, qt3dsimp::Mesh *mesh) = 0;