X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-image%2Frolling-image-cache.h;h=a0d734d27aca4dd482ef1afb67e6a2e68ccd8c28;hp=6f5607cb2fb1f367f6ba269465525660e234a9db;hb=69ca1d127beedc5bc18d30f59b50afa14aa07f0d;hpb=46322a558e537267a6d3c48630c45afca91b5e27 diff --git a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h index 6f5607c..a0d734d 100644 --- a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h +++ b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_ROLLING_IMAGE_CACHE_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ #include #include -#include +#include namespace Dali { @@ -34,7 +34,7 @@ namespace Internal * Class to manage a rolling cache of images, where the cache size * is smaller than the total number of images. */ -class RollingImageCache : public ImageCache +class RollingImageCache : public ImageCache, public TextureUploadObserver { public: /** @@ -63,14 +63,14 @@ public: * Get the first frame. If it's not ready, this will trigger the * sending of FrameReady() when the image becomes ready. */ - virtual TextureSet FirstFrame(); + TextureSet FirstFrame() override; /** * Get the next frame. If it's not ready, this will trigger the * sending of FrameReady() when the image becomes ready. * This will trigger the loading of the next batch. */ - virtual TextureSet NextFrame(); + TextureSet NextFrame() override; private: /** @@ -106,12 +106,19 @@ private: void CheckFrontFrame( bool wasReady ); protected: - virtual void UploadComplete( + void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, - const Vector4& atlasRect ); + const Vector4& atlasRect, + bool preMultiplied ) override; + + void LoadComplete( + bool loadSuccess, + Devel::PixelBuffer pixelBuffer, + const VisualUrl& url, + bool preMultiplied ) override; private: /** @@ -119,10 +126,11 @@ private: */ struct ImageFrame { - unsigned int mUrlIndex; - bool mReady; + unsigned int mUrlIndex = 0u; + bool mReady = false; }; + std::vector& mImageUrls; CircularQueue mQueue; };