[dali_2.3.19] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / texture-manager / texture-upload-observer.cpp
1 /*
2  * Copyright (c) 2023 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 <dali-toolkit/internal/texture-manager/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(const ReturnType returnType, const int32_t textureId, TextureSet textureSet, const bool preMultiplied)
29 : returnType(returnType),
30   textureId(textureId),
31   textureSet(textureSet),
32   preMultiplied(preMultiplied),
33   pixelBuffer(),
34   url()
35 {
36 }
37
38 TextureUploadObserver::TextureInformation::TextureInformation(const ReturnType returnType, const int32_t textureId, TextureSet textureSet, const std::string& url, const bool preMultiplied)
39 : returnType(returnType),
40   textureId(textureId),
41   textureSet(textureSet),
42   preMultiplied(preMultiplied),
43   pixelBuffer(),
44   url(url)
45 {
46 }
47
48 TextureUploadObserver::TextureInformation::TextureInformation(const ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, const bool preMultiplied)
49 : returnType(returnType),
50   textureId(Internal::TextureManagerType::INVALID_TEXTURE_ID),
51   textureSet(),
52   preMultiplied(preMultiplied),
53   pixelBuffer(pixelBuffer),
54   url(url)
55 {
56 }
57
58 TextureUploadObserver::TextureInformation::TextureInformation(const ReturnType returnType, const int32_t textureId, TextureSet textureSet, const uint32_t frameCount, const uint32_t interval, const bool preMultiplied)
59 : returnType(returnType),
60   textureId(textureId),
61   textureSet(textureSet),
62   preMultiplied(preMultiplied),
63   pixelBuffer(),
64   url(),
65   frameCount(frameCount),
66   interval(interval)
67 {
68 }
69
70 TextureUploadObserver::TextureUploadObserver()
71 {
72 }
73
74 TextureUploadObserver::~TextureUploadObserver()
75 {
76   if(!mDestructionSignal.Empty())
77   {
78     mDestructionSignal.Emit(this);
79   }
80 }
81
82 TextureUploadObserver::DestructionSignalType& TextureUploadObserver::DestructionSignal()
83 {
84   return mDestructionSignal;
85 }
86
87 } // namespace Toolkit
88
89 } // namespace Dali