DALi Version 2.1.5
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / texture-upload-observer.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include "texture-upload-observer.h"
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/visuals/texture-manager-impl.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied)
29 : returnType(returnType),
30   textureId(textureId),
31   textureSet(textureSet),
32   useAtlasing(useAtlasing),
33   atlasRect(atlasRect),
34   preMultiplied(preMultiplied),
35   pixelBuffer(),
36   url()
37 {
38 }
39
40 TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, bool preMultiplied)
41 : returnType(returnType),
42   textureId(Internal::TextureManager::INVALID_TEXTURE_ID),
43   textureSet(),
44   useAtlasing(false),
45   atlasRect(Vector4::ZERO),
46   preMultiplied(preMultiplied),
47   pixelBuffer(pixelBuffer),
48   url(url)
49 {
50 }
51
52 TextureUploadObserver::TextureUploadObserver()
53 {
54 }
55
56 TextureUploadObserver::~TextureUploadObserver()
57 {
58   if(!mDestructionSignal.Empty())
59   {
60     mDestructionSignal.Emit(this);
61   }
62 }
63
64 TextureUploadObserver::DestructionSignalType& TextureUploadObserver::DestructionSignal()
65 {
66   return mDestructionSignal;
67 }
68
69 } // namespace Toolkit
70
71 } // namespace Dali