X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene-loader%2Fpublic-api%2Falpha-function-helper.cpp;h=b5168e00392d91d0e1bb7c74c75b465ec500bf46;hb=9a96ba99c22d8b726369fc0da8dbf62c9d51258b;hp=33ad3db0f14ce0b9218f183bf02dd3f58400d1bd;hpb=ec1db95268e1cf8e8bd893027d45a19c64b32848;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene-loader/public-api/alpha-function-helper.cpp b/dali-scene-loader/public-api/alpha-function-helper.cpp index 33ad3db..b5168e0 100644 --- a/dali-scene-loader/public-api/alpha-function-helper.cpp +++ b/dali-scene-loader/public-api/alpha-function-helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -23,10 +23,11 @@ namespace SceneLoader { namespace { - +// clang-format off #define DALI_ALPHA_FUNCTION_ENTRY(x) { #x, AlphaFunction::x } +// clang-format on -std::unordered_map sFunctions { +std::unordered_map sFunctions{ DALI_ALPHA_FUNCTION_ENTRY(DEFAULT), DALI_ALPHA_FUNCTION_ENTRY(LINEAR), DALI_ALPHA_FUNCTION_ENTRY(REVERSE), @@ -45,24 +46,24 @@ std::unordered_map sFunctions { #undef DALI_ALPHA_FUNCTION_ENTRY -} // nonamespace +} // namespace AlphaFunction GetAlphaFunction(const std::string& name, bool* found) { - auto iFind = sFunctions.find(name); + auto iFind = sFunctions.find(name); bool success = iFind != sFunctions.end(); - if (found) + if(found) { *found = success; } return success ? iFind->second : AlphaFunction(AlphaFunction::DEFAULT); } -void RegisterAlphaFunction(const std::string & name, AlphaFunction alphaFn) +void RegisterAlphaFunction(const std::string& name, AlphaFunction alphaFn) { - DALI_ASSERT_ALWAYS(sFunctions.insert({ name, alphaFn }).second && - "Function with given key already exists."); + DALI_ASSERT_ALWAYS(sFunctions.insert({name, alphaFn}).second && + "Function with given key already exists."); } -} -} +} // namespace SceneLoader +} // namespace Dali