X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-base-data-impl.h;h=52e0d98b6f765561c3961be57f4781af9407b4d1;hb=HEAD;hp=568af248e95d8a9fc57eeb835a1e2d7420115e5f;hpb=e70007fa5b0de4fcaa1960c52a2f1dc582d1d44d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/visual-base-data-impl.h b/dali-toolkit/internal/visuals/visual-base-data-impl.h index 568af24..e54c3ae 100644 --- a/dali-toolkit/internal/visuals/visual-base-data-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-data-impl.h @@ -53,10 +53,10 @@ struct Base::Impl enum Flags { - IS_ON_SCENE = 1, - IS_ATLASING_APPLIED = 1 << 1, - IS_PREMULTIPLIED_ALPHA = 1 << 2, - IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 3 + IS_ON_SCENE = 1, + IS_ATLASING_APPLIED = 1 << 1, + IS_PREMULTIPLIED_ALPHA = 1 << 2, + IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 3, }; struct CustomShader @@ -114,6 +114,133 @@ struct Base::Impl Toolkit::Align::Type mAnchorPoint; }; + struct DecorationData + { + // Default constructor + DecorationData() + : mBorderlineColor(Color::BLACK), + mCornerRadius(Vector4::ZERO), + mBorderlineWidth(0.0f), + mBorderlineOffset(0.0f), + mCornerRadiusPolicy(static_cast(Toolkit::Visual::Transform::Policy::ABSOLUTE)) + { + } + Vector4 mBorderlineColor; + Vector4 mCornerRadius; + float mBorderlineWidth; + float mBorderlineOffset; + int mCornerRadiusPolicy; + }; + + DecorationData* EnsureDecorationData() + { + if(mDecorationData == nullptr) + { + mDecorationData = new DecorationData(); + } + return mDecorationData; + } + + /** + * @brief Get decoration data value : borderline width + * + * Keep these API as inline function due to the performance. + */ + float GetBorderlineWidth() + { + return mDecorationData ? mDecorationData->mBorderlineWidth : 0.0f; + } + + /** + * @brief Set decoration data value : borderline width + * + * Keep these API as inline function due to the performance. + */ + void SetBorderlineWidth(float value) + { + EnsureDecorationData()->mBorderlineWidth = value; + } + + /** + * @brief Get decoration data value : borderline color + * + * Keep these API as inline function due to the performance. + */ + Vector4 GetBorderlineColor() + { + return mDecorationData ? mDecorationData->mBorderlineColor : Color::BLACK; + } + + /** + * @brief Set decoration data value : borderline color + * + * Keep these API as inline function due to the performance. + */ + void SetBorderlineColor(Vector4 value) + { + EnsureDecorationData()->mBorderlineColor = value; + } + + /** + * @brief Get decoration data value : borderline offset + * + * Keep these API as inline function due to the performance. + */ + float GetBorderlineOffset() + { + return mDecorationData ? mDecorationData->mBorderlineOffset : 0.0f; + } + + /** + * @brief Set decoration data value : borderline offset + * + * Keep these API as inline function due to the performance. + */ + void SetBorderlineOffset(float value) + { + EnsureDecorationData()->mBorderlineOffset = value; + } + + /** + * @brief Get decoration data value : corner radius + * + * Keep these API as inline function due to the performance. + */ + Vector4 GetCornerRadius() + { + return mDecorationData ? mDecorationData->mCornerRadius : Vector4::ZERO; + } + + /** + * @brief Set decoration data value : corner radius + * + * Keep these API as inline function due to the performance. + */ + void SetCornerRadius(Vector4 value) + { + EnsureDecorationData()->mCornerRadius = value; + } + + /** + * @brief Get decoration data value : corner radius policy + * + * Keep these API as inline function due to the performance. + */ + int GetCornerRadiusPolicy() + { + return mDecorationData ? mDecorationData->mCornerRadiusPolicy : static_cast(Toolkit::Visual::Transform::Policy::ABSOLUTE); + } + + /** + * @brief Set decoration data value : corner radius policy + * + * Keep these API as inline function due to the performance. + */ + void SetCornerRadiusPolicy(int value) + { + EnsureDecorationData()->mCornerRadiusPolicy = value; + } + VisualRenderer mRenderer; CustomShader* mCustomShader; EventObserver* mEventObserver; ///< Allows controls to observe when the visual has events to notify @@ -121,18 +248,14 @@ struct Base::Impl Transform mTransform; Vector4 mMixColor; Size mControlSize; - float mBorderlineWidth; - Vector4 mBorderlineColor; - float mBorderlineOffset; - Vector4 mCornerRadius; - float mCornerRadiusPolicy; + DecorationData* mDecorationData; int mDepthIndex; FittingMode mFittingMode; ///< How the contents should fit the view int mFlags; Toolkit::Visual::ResourceStatus mResourceStatus; const Toolkit::Visual::Type mType; - bool mAlwaysUsingBorderline : 1; ///< Whether we need the borderline in shader always. - bool mAlwaysUsingCornerRadius : 1; ///< Whether we need the corner radius in shader always. + bool mAlwaysUsingBorderline : 1; ///< Whether we need the borderline in shader always. + bool mAlwaysUsingCornerRadius : 1; ///< Whether we need the corner radius in shader always. }; } // namespace Visual