1 #ifndef DALI_VECTOR_ANIMATION_RENDERER_TIZEN_H
2 #define DALI_VECTOR_ANIMATION_RENDERER_TIZEN_H
5 * Copyright (c) 2023 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/adaptor-framework/native-image-source-queue.h>
23 #include <tbm_surface.h>
24 #include <tbm_surface_queue.h>
27 #include <dali-extension/vector-animation-renderer/vector-animation-renderer.h>
34 * @brief Implementation of the Tizen vector animation renderer class which has Tizen platform dependency.
36 class VectorAnimationRendererTizen : public VectorAnimationRenderer
42 VectorAnimationRendererTizen();
47 virtual ~VectorAnimationRendererTizen();
50 * @copydoc Dali::VectorAnimationRendererPlugin::Render()
52 bool Render(uint32_t frameNumber) override;
55 * @copydoc Dali::VectorAnimationRendererPlugin::RenderStopped()
57 void RenderStopped() override;
61 * @brief Set shader for NativeImageSourceQueue with custom sampler type and prefix.
63 void SetShader() override;
66 * @brief Reset buffer list.
68 void ResetBuffers() override;
71 * @copydoc VectorAnimationRenderer::Finalize()
73 void OnFinalize() override;
76 * @copydoc VectorAnimationRenderer::OnSetSize()
78 void OnSetSize() override;
81 * @brief Event callback to process events.
83 void OnLottieRendered() override
87 * @copydoc VectorAnimationRenderer::PrepareTarget()
89 void PrepareTarget() override;
92 * @copydoc VectorAnimationRenderer::IsTargetPrepared()
94 bool IsTargetPrepared() override;
97 * @copydoc VectorAnimationRenderer::IsRenderReady()
99 bool IsRenderReady() override;
102 * @copydoc VectorAnimationRenderer::GetTargetTexture()
104 Dali::Texture GetTargetTexture() override;
107 using SurfacePair = std::pair<tbm_surface_h, rlottie::Surface>;
109 std::vector<SurfacePair> mBuffers; ///< EGL Image vector
111 Dali::Texture mRenderedTexture; ///< Rendered Texture
112 std::vector<Dali::Texture> mPreviousTextures; ///< Previous rendered texture
113 NativeImageSourceQueuePtr mTargetSurface; ///< The target surface
114 tbm_surface_queue_h mTbmQueue; ///< Tbm surface queue handle
117 } // namespace Plugin
121 #endif // DALI_TIZEN_VECTOR_ANIMATION_RENDERER_PLUGIN_H