From: Eunki, Hong Date: Tue, 14 Jan 2025 04:44:51 +0000 (+0900) Subject: (Scene3D) Fix coverity : Do not call std::move for l-value X-Git-Tag: accepted/tizen/unified/20250115.005102~2^2~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f8785e75fe757c89b71fcd5f4ff9252714be7e4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git (Scene3D) Fix coverity : Do not call std::move for l-value Change-Id: I935b6fc13556567d02aa5e9d4d626b8604f8a6c4 Signed-off-by: Eunki, Hong --- diff --git a/dali-scene3d/internal/loader/glb-loader-impl.cpp b/dali-scene3d/internal/loader/glb-loader-impl.cpp index deaa91e9fa..0c5d11acec 100644 --- a/dali-scene3d/internal/loader/glb-loader-impl.cpp +++ b/dali-scene3d/internal/loader/glb-loader-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -128,7 +128,7 @@ bool GlbLoaderImpl::LoadModel(const std::string& url, Dali::Scene3D::Loader::Loa outBuffers.reserve(document.mBuffers.size()); if(!binaryChunkData.empty()) { - BufferDefinition dataBuffer(binaryChunkData); + BufferDefinition dataBuffer(std::move(binaryChunkData)); outBuffers.emplace_back(std::move(dataBuffer)); } diff --git a/dali-scene3d/internal/model-components/model-node-impl.cpp b/dali-scene3d/internal/model-components/model-node-impl.cpp index 2505c35861..5bc1a1e114 100644 --- a/dali-scene3d/internal/model-components/model-node-impl.cpp +++ b/dali-scene3d/internal/model-components/model-node-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ void ModelNode::UpdateShader(Scene3D::Loader::ShaderManagerPtr shaderManager) } } -void ModelNode::SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData& data, Scene3D::ModelPrimitive primitive) +void ModelNode::SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData&& data, Scene3D::ModelPrimitive primitive) { // Update mBlendShapeIndexMap mBlendShapeIndexMap.clear(); @@ -389,7 +389,7 @@ void ModelNode::SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData& } } - GetImplementation(primitive).SetBlendShapeData(data); + GetImplementation(primitive).SetBlendShapeData(std::move(data)); } void ModelNode::SetBoneMatrix(const Matrix& inverseMatrix, Scene3D::ModelPrimitive primitive, Scene3D::Loader::Index& boneIndex) diff --git a/dali-scene3d/internal/model-components/model-node-impl.h b/dali-scene3d/internal/model-components/model-node-impl.h index a357180ecc..ecf5ee3bb4 100644 --- a/dali-scene3d/internal/model-components/model-node-impl.h +++ b/dali-scene3d/internal/model-components/model-node-impl.h @@ -2,7 +2,7 @@ #define DALI_SCENE3D_MODEL_COMPONENTS_MODEL_NODE_IMPL_H /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -280,7 +280,7 @@ public: // Public Method * @param[in] data The blend shape data. * @param[in] primitive The ModelPrimitive to set the blend shape data for. */ - void SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData& data, Scene3D::ModelPrimitive primitive); + void SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData&& data, Scene3D::ModelPrimitive primitive); /** * @brief Sets the bone matrix for a ModelPrimitive and bone index. diff --git a/dali-scene3d/internal/model-components/model-primitive-impl.cpp b/dali-scene3d/internal/model-components/model-primitive-impl.cpp index 68d6024a81..aed6e9425b 100644 --- a/dali-scene3d/internal/model-components/model-primitive-impl.cpp +++ b/dali-scene3d/internal/model-components/model-primitive-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -232,7 +232,7 @@ void ModelPrimitive::UpdateShader(Scene3D::Loader::ShaderManagerPtr shaderManage } } -void ModelPrimitive::SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData& data) +void ModelPrimitive::SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData&& data) { mBlendShapeData = std::move(data); Scene3D::Loader::BlendShapes::ConfigureProperties(mBlendShapeData, mRenderer); diff --git a/dali-scene3d/internal/model-components/model-primitive-impl.h b/dali-scene3d/internal/model-components/model-primitive-impl.h index 6725e1ab5a..c55e12967d 100644 --- a/dali-scene3d/internal/model-components/model-primitive-impl.h +++ b/dali-scene3d/internal/model-components/model-primitive-impl.h @@ -2,7 +2,7 @@ #define DALI_SCENE3D_MODEL_COMPONENTS_MODEL_PRIMITIVE_IMPL_H /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -160,7 +160,7 @@ public: * * @param[in] data The blend shape data to set. */ - void SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData& data); + void SetBlendShapeData(Scene3D::Loader::BlendShapes::BlendShapeData&& data); /** * @brief Sets the blend shape geometry for this model primitive. @@ -270,7 +270,7 @@ private: bool mHasTangents = false; Scene3D::Loader::BlendShapes::Version mBlendShapeVersion = Scene3D::Loader::BlendShapes::Version::INVALID; - bool mIsMaterialChanged = false; + bool mIsMaterialChanged = false; }; } // namespace Internal diff --git a/dali-scene3d/public-api/loader/buffer-definition.cpp b/dali-scene3d/public-api/loader/buffer-definition.cpp index 0b8dc9352a..57317df18b 100644 --- a/dali-scene3d/public-api/loader/buffer-definition.cpp +++ b/dali-scene3d/public-api/loader/buffer-definition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ struct BufferDefinition::Impl std::shared_ptr stream; }; -BufferDefinition::BufferDefinition(std::vector& buffer) +BufferDefinition::BufferDefinition(std::vector&& buffer) : mImpl{new BufferDefinition::Impl} { mImpl.get()->buffer = std::move(buffer); diff --git a/dali-scene3d/public-api/loader/buffer-definition.h b/dali-scene3d/public-api/loader/buffer-definition.h index a59d33012b..6911b6b828 100644 --- a/dali-scene3d/public-api/loader/buffer-definition.h +++ b/dali-scene3d/public-api/loader/buffer-definition.h @@ -1,7 +1,7 @@ #ifndef DALI_SCENE3D_LOADER_BUFFER_DEFINITION_H #define DALI_SCENE3D_LOADER_BUFFER_DEFINITION_H /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ struct DALI_SCENE3D_API BufferDefinition using Vector = std::vector; BufferDefinition(); - BufferDefinition(std::vector& buffer); + BufferDefinition(std::vector&& buffer); ~BufferDefinition(); diff --git a/dali-scene3d/public-api/loader/scene-definition.cpp b/dali-scene3d/public-api/loader/scene-definition.cpp index 7d2805371b..c7a47a03e7 100644 --- a/dali-scene3d/public-api/loader/scene-definition.cpp +++ b/dali-scene3d/public-api/loader/scene-definition.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Copyright (c) 2025 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -874,7 +874,7 @@ bool SceneDefinition::ConfigureBlendshapeShaders(const ResourceBundle& data.version = mesh.first.mBlendShapeVersion; data.bufferOffset = mesh.second.blendShapeBufferOffset; data.mActor = actor; - Internal::GetImplementation(node).SetBlendShapeData(data, request.mPrimitive); + Internal::GetImplementation(node).SetBlendShapeData(std::move(data), request.mPrimitive); } } }