{
public:
- TestRenderSurface( PositionSize positionSize ) {};
+ TestRenderSurface( PositionSize positionSize ) : mPositionSize(positionSize) {};
- PositionSize GetPositionSize() const override { PositionSize size; return size; };
+ PositionSize GetPositionSize() const override { return mPositionSize; };
virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; }
bool ReplaceGraphicsSurface() override { return false; };
- void MoveResize( Dali::PositionSize positionSize ) override {};
+ void MoveResize( Dali::PositionSize positionSize ) override { mPositionSize = positionSize; };
void StartRender() override {};
void SetBackgroundColor( Vector4 color ) {};
Vector4 GetBackgroundColor() { return Color::WHITE; };
+
+private:
+ PositionSize mPositionSize;
};
namespace Internal
Dali::RenderSurfaceInterface& GetRenderSurface();
-private:
+protected:
TestRenderSurface mRenderSurface;
Integration::Scene mScene;
namespace Dali
{
-typedef Dali::Rect<int> PositionSize;
+using PositionSize = Dali::Rect<int>;
+using WindowPosition = Uint16Pair;
namespace Internal
{
Window( const PositionSize& positionSize );
virtual ~Window() = default;
static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent);
+
+ WindowPosition GetPosition() const;
+ PositionSize GetPositionSize() const;
+
+ void SetPositionSize(PositionSize positionSize);
+
FocusChangeSignalType mFocusChangeSignal;
ResizeSignalType mResizeSignal;
int mRotationAngle;
return new Window( positionSize );
}
+WindowPosition Window::GetPosition() const
+{
+ PositionSize positionSize = mRenderSurface.GetPositionSize();
+
+ return WindowPosition(positionSize.x, positionSize.y);
+}
+
+PositionSize Window::GetPositionSize() const
+{
+ return mRenderSurface.GetPositionSize();
+}
+
+void Window::SetPositionSize(PositionSize positionSize)
+{
+ mRenderSurface.MoveResize(positionSize);
+
+ Uint16Pair newSize(positionSize.width, positionSize.height);
+ Dali::Window handle(this);
+ mResizeSignal.Emit(handle, newSize);
+}
+
} // Adaptor
} // Internal
void SetPositionSize(Window window, PositionSize positionSize)
{
- Uint16Pair newSize(positionSize.width, positionSize.height);
- GetImplementation( window ).mResizeSignal.Emit(window,newSize);
+ GetImplementation( window ).SetPositionSize(positionSize);
}
int GetPhysicalOrientation(Window window)
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-PREDEFINED = DALI_TOOLKIT_API \
+PREDEFINED = DALI_CORE_API \
+ DALI_ADAPTOR_API \
+ DALI_TOOLKIT_API \
+ DALI_SCENE_LOADER_API \
DALI_INTERNAL \
- __attribute__ \
- ((visibility \
- "(default )))" \
- __attribute__ \
- ((visibility \
- "(hidden )))"
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
DALI_TOOLKIT_API \
DALI_SCENE_LOADER_API \
DALI_INTERNAL \
- __attribute__ \
- ((visibility \
- "(default )))" \
- __attribute__ \
- ((visibility \
- "(hidden )))"
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
{\r
namespace\r
{\r
+static constexpr float FULLY_TRANSPARENT(0.01f); ///< Alpha values must rise above this, before an object is considered to be visible.\r
+\r
static int MajorAxisDistanceRaw(Dali::Toolkit::Control::KeyboardFocus::Direction direction, Dali::Rect<float> source, Dali::Rect<float> dest)\r
{\r
switch(direction)\r
case Dali::Toolkit::Control::KeyboardFocus::RIGHT:\r
{\r
// the distance between the center verticals\r
- return std::abs(\r
- (((source.top + source.bottom) * 0.5f) -\r
- (((dest.top + dest.bottom) * 0.5f))));\r
+ return std::abs((source.top + (source.bottom - source.top) * 0.5f) -\r
+ (dest.top + (dest.bottom - dest.top) * 0.5f));\r
}\r
case Dali::Toolkit::Control::KeyboardFocus::UP:\r
case Dali::Toolkit::Control::KeyboardFocus::DOWN:\r
{\r
// the distance between the center horizontals\r
- return std::abs(\r
- (((source.left + source.right) * 0.5f) -\r
- (((dest.left + dest.right) * 0.5f))));\r
+ return std::abs((source.left + (source.right - source.left) * 0.5f) -\r
+ (dest.left + (dest.right - dest.left) * 0.5f));\r
}\r
default:\r
{\r
{\r
case Dali::Toolkit::Control::KeyboardFocus::LEFT:\r
{\r
- return (srcRect.right > destRect.right || srcRect.left >= destRect.right) && srcRect.left > destRect.left;\r
+ return (srcRect.right > destRect.right || srcRect.left >= destRect.right);\r
}\r
case Dali::Toolkit::Control::KeyboardFocus::RIGHT:\r
{\r
- return (srcRect.left < destRect.left || srcRect.right <= destRect.left) && srcRect.right < destRect.right;\r
+ return (srcRect.left < destRect.left || srcRect.right <= destRect.left);\r
}\r
case Dali::Toolkit::Control::KeyboardFocus::UP:\r
{\r
- return (srcRect.bottom > destRect.bottom || srcRect.top >= destRect.bottom) && srcRect.top > destRect.top;\r
+ return (srcRect.bottom > destRect.bottom || srcRect.top >= destRect.bottom);\r
}\r
case Dali::Toolkit::Control::KeyboardFocus::DOWN:\r
{\r
- return (srcRect.top < destRect.top || srcRect.bottom <= destRect.top) && srcRect.bottom < destRect.bottom;\r
+ return (srcRect.top < destRect.top || srcRect.bottom <= destRect.top);\r
}\r
default:\r
{\r
MinorAxisDistance(direction, focusedRect, bestCandidateRect)));\r
}\r
\r
+bool IsFocusable(Actor& actor)\r
+{\r
+ return (actor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) &&\r
+ actor.GetProperty<bool>(Actor::Property::VISIBLE) &&\r
+ actor.GetProperty<bool>(Actor::Property::SENSITIVE) &&\r
+ actor.GetProperty<Vector4>(Actor::Property::WORLD_COLOR).a > FULLY_TRANSPARENT);\r
+}\r
+\r
Actor FindNextFocus(Actor& actor, Actor& focusedActor, Rect<float>& focusedRect, Rect<float>& bestCandidateRect, Toolkit::Control::KeyboardFocus::Direction direction)\r
{\r
Actor nearestActor;\r
for(auto i = 0u; i < childCount; ++i)\r
{\r
Dali::Actor child = actor.GetChildAt(i);\r
- if(child && child != focusedActor && child.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE))\r
+ if(child && child != focusedActor && IsFocusable(child))\r
{\r
Rect<float> candidateRect = DevelActor::CalculateScreenExtents(child);\r
\r
// EXTERNAL INCLUDES
#include <dali/integration-api/adaptor-framework/adaptor.h>
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
-
namespace Dali
{
namespace Toolkit
mLoadThread.Start();
mIsLoadThreadStarted = true;
}
- if(url.IsBufferResource())
- {
- auto visualFactory = Toolkit::VisualFactory::Get();
- if(visualFactory)
- {
- // Get EncodedImageBuffer from texturemanager
- // and make new LoadingTask with buffer
- auto& textureManager = GetImplementation(visualFactory).GetTextureManager();
+ mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, url, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad));
- const EncodedImageBuffer& encodedBuffer = textureManager.GetEncodedImageBuffer(url.GetUrl());
+ return mLoadTaskId;
+}
- mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, encodedBuffer, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad));
- }
- }
- else
+uint32_t AsyncImageLoader::LoadEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer,
+ ImageDimensions dimensions,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection,
+ DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
+{
+ if(!mIsLoadThreadStarted)
{
- mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, url, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad));
+ mLoadThread.Start();
+ mIsLoadThreadStarted = true;
}
+ mLoadThread.AddTask(new LoadingTask(++mLoadTaskId, encodedImageBuffer, dimensions, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad));
return mLoadTaskId;
}
DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad);
/**
+ * @brief Starts an image loading task by encoded image buffer.
+ * @param[in] encodedImageBuffer The encoded buffer of the image to load
+ * @param[in] dimensions The width and height to fit the loaded image to
+ * @param[in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter
+ * @param[in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size
+ * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header
+ * @param[in] preMultiplyOnLoad ON if the image color should be multiplied by it's alpha. Set to OFF if there is no alpha.
+ * @return The loading task id
+ */
+ uint32_t LoadEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer,
+ ImageDimensions dimensions,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection,
+ DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad);
+
+ /**
* @brief Starts an mask applying task.
* @param[in] pixelBuffer of the to be masked image
* @param[in] maskPixelBuffer of the mask image
DevelAsyncImageLoader::PreMultiplyOnLoad preMultiplyOnLoad)
{
mLoadingInfoContainer.push_back(AsyncLoadingInfo(textureId));
- auto id = GetImplementation(mLoader).Load(url, desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
- mLoadingInfoContainer.back().loadId = id;
+ if(DALI_UNLIKELY(url.IsBufferResource()))
+ {
+ auto id = GetImplementation(mLoader).LoadEncodedImageBuffer(mTextureManager.GetEncodedImageBuffer(url.GetUrl()), desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
+ mLoadingInfoContainer.back().loadId = id;
+ }
+ else
+ {
+ auto id = GetImplementation(mLoader).Load(url, desiredSize, fittingMode, samplingMode, orientationCorrection, preMultiplyOnLoad);
+ mLoadingInfoContainer.back().loadId = id;
+ }
}
void TextureManager::AsyncLoadingHelper::ApplyMask(TextureId textureId,
%description -n %{dali2_scene_loader}-devel
Development components for dali-scene-loader.
-##############################
-# Preparation
-##############################
-%prep
-%setup -q
-
%define dali_data_rw_dir %TZ_SYS_SHARE/dali/
%define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
%define dali_xml_file_dir %TZ_SYS_RO_PACKAGES
+##############################
+# Preparation
+##############################
+%prep
+%setup -q
+
+##############################
+# Build
+##############################
+%build
# PO
{
cd %{_builddir}/dali2-toolkit-%{version}/dali-toolkit/po
done
} &> /dev/null
-##############################
-# Build
-##############################
-%build
PREFIX="/usr"
CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "