Fix npatch visual auxiliary bug
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / texture-manager / texture-upload-observer.cpp
1 /*
2  * Copyright (c) 2022 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/texture-manager/texture-manager-type.h> // for INVALUD_TEXTURE_ID
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, int32_t textureId, TextureSet textureSet, const std::string& url, bool preMultiplied)
41 : returnType(returnType),
42   textureId(textureId),
43   textureSet(textureSet),
44   useAtlasing(false),
45   atlasRect(Vector4::ZERO),
46   preMultiplied(preMultiplied),
47   pixelBuffer(),
48   url(url)
49 {
50 }
51
52 TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, bool preMultiplied)
53 : returnType(returnType),
54   textureId(Internal::TextureManagerType::INVALID_TEXTURE_ID),
55   textureSet(),
56   useAtlasing(false),
57   atlasRect(Vector4::ZERO),
58   preMultiplied(preMultiplied),
59   pixelBuffer(pixelBuffer),
60   url(url)
61 {
62 }
63
64 TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, int32_t textureId, uint32_t frameCount, uint32_t interval)
65 : returnType(returnType),
66   textureId(textureId),
67   textureSet(),
68   useAtlasing(false),
69   atlasRect(Vector4::ZERO),
70   preMultiplied(false),
71   pixelBuffer(),
72   url(),
73   frameCount(frameCount),
74   interval(interval)
75 {
76 }
77
78 TextureUploadObserver::TextureUploadObserver()
79 {
80 }
81
82 TextureUploadObserver::~TextureUploadObserver()
83 {
84   if(!mDestructionSignal.Empty())
85   {
86     mDestructionSignal.Emit(this);
87   }
88 }
89
90 TextureUploadObserver::DestructionSignalType& TextureUploadObserver::DestructionSignal()
91 {
92   return mDestructionSignal;
93 }
94
95 } // namespace Toolkit
96
97 } // namespace Dali