1 #ifndef DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_ANDROID_H
2 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_ANDROID_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/devel-api/images/native-image-interface-extension.h>
25 #include <dali/internal/imaging/common/native-image-source-queue-impl.h>
37 class EglImageExtensions;
40 * Dali internal NativeImageSourceQueue.
42 class NativeImageSourceQueueAndroid: public Internal::Adaptor::NativeImageSourceQueue, public NativeImageInterface::Extension
47 * Create a new NativeImageSourceQueueAndroid internally.
48 * Depending on hardware the width and height may have to be a power of two.
49 * @param[in] width The width of the image.
50 * @param[in] height The height of the image.
51 * @param[in] depth color depth of the image.
52 * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
53 * @return A smart-pointer to a newly allocated image.
55 static NativeImageSourceQueueAndroid* New( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
58 * @copydoc Dali::NativeImageSourceQueue::GetNativeImageSourceQueue()
60 Any GetNativeImageSourceQueue() const override;
63 * @copydoc Dali::NativeImageSourceQueue::SetSize
65 void SetSize( uint32_t width, uint32_t height ) override;
70 ~NativeImageSourceQueueAndroid() override;
73 * @copydoc Dali::NativeImageInterface::GlExtensionCreate()
75 bool GlExtensionCreate() override;
78 * @copydoc Dali::NativeImageInterface::GlExtensionDestroy()
80 void GlExtensionDestroy() override;
83 * @copydoc Dali::NativeImageInterface::TargetTexture()
85 uint32_t TargetTexture() override;
88 * @copydoc Dali::NativeImageInterface::PrepareTexture()
90 void PrepareTexture() override;
93 * @copydoc Dali::NativeImageInterface::GetWidth()
95 uint32_t GetWidth() const override
101 * @copydoc Dali::NativeImageInterface::GetHeight()
103 uint32_t GetHeight() const override
109 * @copydoc Dali::NativeImageInterface::RequiresBlending()
111 bool RequiresBlending() const override
117 * @copydoc Dali::NativeImageInterface::GetExtension()
119 NativeImageInterface::Extension* GetNativeImageInterfaceExtension() override
125 * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
127 const char* GetCustomFragmentPreFix() override;
130 * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
132 const char* GetCustomSamplerTypename() override;
135 * @copydoc Dali::NativeImageInterface::Extension::GetEglImageTextureTarget()
137 int GetEglImageTextureTarget() override;
142 * Private constructor; @see NativeImageSourceQueue::New()
143 * @param[in] width The width of the image.
144 * @param[in] height The height of the image.
145 * @param[in] colour depth of the image.
146 * @param[in] nativeImageSourceQueue contains tbm_surface_queue_h or is empty
148 NativeImageSourceQueueAndroid( uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorDepth depth, Any nativeImageSourceQueue );
152 uint32_t mWidth; ///< image width
153 uint32_t mHeight; ///< image height
157 } // namespace Adaptor
159 } // namespace Internal
163 #endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_QUEUE_IMPL_ANDROID_H