From b68599f07556defd826cd14132c979e3ee4533b4 Mon Sep 17 00:00:00 2001 From: "huiyu,eun" Date: Thu, 18 Jan 2018 20:37:25 +0900 Subject: [PATCH] Revert "[4.0] Keep aspect ratio of visual in ImageView" This reverts commit 5e20550dbef7745ba12c07ad4bae45c57e57dbad. Change-Id: Iaba7106d128d95aa4764795ce3d74153232e9609 --- .../dali-toolkit-test-utils/dummy-visual.cpp | 4 +- .../devel-api/visuals/visual-properties-devel.h | 38 +------------------ .../controls/image-view/image-view-impl.cpp | 44 +++++++--------------- .../animated-gradient/animated-gradient-visual.cpp | 5 +-- .../animated-image/animated-image-visual.cpp | 2 +- .../internal/visuals/border/border-visual.cpp | 4 +- .../internal/visuals/color/color-visual.cpp | 4 +- .../internal/visuals/gradient/gradient-visual.cpp | 4 +- .../internal/visuals/image/image-visual.cpp | 6 +-- dali-toolkit/internal/visuals/mesh/mesh-visual.cpp | 4 +- .../internal/visuals/npatch/npatch-visual.cpp | 4 +- .../visuals/primitive/primitive-visual.cpp | 4 +- dali-toolkit/internal/visuals/svg/svg-visual.cpp | 4 +- dali-toolkit/internal/visuals/text/text-visual.cpp | 4 +- .../internal/visuals/visual-base-data-impl.cpp | 5 +-- .../internal/visuals/visual-base-data-impl.h | 7 +--- dali-toolkit/internal/visuals/visual-base-impl.cpp | 41 ++------------------ dali-toolkit/internal/visuals/visual-base-impl.h | 14 ++----- .../internal/visuals/visual-string-constants.cpp | 5 +-- .../internal/visuals/visual-string-constants.h | 5 +-- .../visuals/wireframe/wireframe-visual.cpp | 4 +- 21 files changed, 54 insertions(+), 158 deletions(-) diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dummy-visual.cpp b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dummy-visual.cpp index c679479..bd88e76 100755 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dummy-visual.cpp +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dummy-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -38,7 +38,7 @@ DummyVisualPtr DummyVisual::New( const Property::Map& properties ) } DummyVisual::DummyVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ), +: Visual::Base( factoryCache ), mActionCounter( 0 ) { } diff --git a/dali-toolkit/devel-api/visuals/visual-properties-devel.h b/dali-toolkit/devel-api/visuals/visual-properties-devel.h index 7839982..019b632 100644 --- a/dali-toolkit/devel-api/visuals/visual-properties-devel.h +++ b/dali-toolkit/devel-api/visuals/visual-properties-devel.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_DEVEL_API_VISUALS_VISUAL_PROPERTIES_DEVEL_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -47,41 +47,7 @@ enum Type SVG = Dali::Toolkit::Visual::SVG, ANIMATED_IMAGE = Dali::Toolkit::Visual::ANIMATED_IMAGE, - ANIMATED_GRADIENT = ANIMATED_IMAGE + 1, //< Renders an animated gradient. -}; - -/** - * @brief Visual Properties - */ -namespace Property -{ -enum Type -{ - TYPE = Dali::Toolkit::Visual::Property::TYPE, - SHADER = Dali::Toolkit::Visual::Property::SHADER, - TRANSFORM = Dali::Toolkit::Visual::Property::TRANSFORM, - PREMULTIPLIED_ALPHA = Dali::Toolkit::Visual::Property::PREMULTIPLIED_ALPHA, - MIX_COLOR = Dali::Toolkit::Visual::Property::MIX_COLOR, - OPACITY = Dali::Toolkit::Visual::Property::OPACITY, - - /** - * @brief The fitting mode of the visual - * @details Name "fittingMode", type FittingMode (Property::INTEGER) or Property::STRING. - * @see DevelVisual::FittingMode - * @note The default is defined by the type of visual (if it's suitable to be stretched or not). - */ - FITTING_MODE = OPACITY + 1, -}; - -} // namespace Property - -/** - * @brief The values of this enum determine how the visual should be fit to the view - */ -enum FittingMode -{ - FIT_KEEP_ASPECT_RATIO, ///< The visual should be scaled to fit, preserving aspect ratio - FILL, ///< The visual should be stretched to fill, not preserving aspect ratio + ANIMATED_GRADIENT = ANIMATED_IMAGE + 1, ///< Renders an animated gradient. }; } // namespace DevelVisual diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp index 84d6378..5c19757 100755 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -281,40 +281,22 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container ) Extents padding; padding = Self().GetProperty( Toolkit::Control::Property::PADDING ); - Dali::LayoutDirection::Type layoutDirection = static_cast( - Self().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get()); + Property::Map transformMap = Property::Map(); - if (Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection) + if( ( padding.start != 0 ) || ( padding.end != 0 ) || ( padding.top != 0 ) || ( padding.bottom != 0 ) ) { - std::swap(padding.start, padding.end); - } - - // remove padding from the size to know how much is left for the visual - auto paddedSize = size - Vector2(padding.start + padding.end, padding.top + padding.bottom); - - Vector2 naturalSize; - mVisual.GetNaturalSize(naturalSize); - - // scale to fit the padded area - auto finalSize = - Toolkit::GetImplementation(mVisual).GetFittingMode() == Visual::FittingMode::FILL - ? paddedSize - : naturalSize * std::min((paddedSize.width / naturalSize.width), (paddedSize.height / naturalSize.height)); + Dali::LayoutDirection::Type layoutDirection = static_cast( Self().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get() ); - // calculate final offset within the padded area - auto finalOffset = Vector2(padding.start, padding.top) + (paddedSize - finalSize) * .5f; - - // populate the transform map - Property::Map transformMap = Property::Map(); + if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection ) + { + std::swap(padding.start, padding.end); + } - transformMap.Add(Toolkit::Visual::Transform::Property::OFFSET, finalOffset) - .Add(Toolkit::Visual::Transform::Property::OFFSET_POLICY, - Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE)) - .Add(Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN) - .Add(Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN) - .Add(Toolkit::Visual::Transform::Property::SIZE, finalSize) - .Add(Toolkit::Visual::Transform::Property::SIZE_POLICY, - Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE)); + transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( padding.start, padding.top ) ) + .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) ) + .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN ) + .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN ); + } // Should provide a transform that handles aspect ratio according to image size mVisual.SetTransformAndSize( transformMap, size ); diff --git a/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp b/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp index b51f140..78ed950 100755 --- a/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -246,8 +246,7 @@ AnimatedGradientVisualPtr AnimatedGradientVisual::New( VisualFactoryCache& facto return animatedGradientVisualPtr; } -AnimatedGradientVisual::AnimatedGradientVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ) +AnimatedGradientVisual::AnimatedGradientVisual( VisualFactoryCache& factoryCache ) : Visual::Base( factoryCache ) { SetupDefaultValue(); } diff --git a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp index d809b03..d9c4cd4 100755 --- a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp @@ -160,7 +160,7 @@ void AnimatedImageVisual::InitializeGif( const VisualUrl& imageUrl ) } AnimatedImageVisual::AnimatedImageVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ), +: Visual::Base( factoryCache ), mFrameDelayTimer(), mPlacementActor(), mPixelArea( FULL_TEXTURE_RECT ), diff --git a/dali-toolkit/internal/visuals/border/border-visual.cpp b/dali-toolkit/internal/visuals/border/border-visual.cpp index cf1d6f4..2de039b 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.cpp +++ b/dali-toolkit/internal/visuals/border/border-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -131,7 +131,7 @@ BorderVisualPtr BorderVisual::New( VisualFactoryCache& factoryCache, const Prope } BorderVisual::BorderVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ), +: Visual::Base( factoryCache ), mBorderColor( Color::TRANSPARENT ), mBorderSize( 0.f ), mBorderColorIndex( Property::INVALID_INDEX ), diff --git a/dali-toolkit/internal/visuals/color/color-visual.cpp b/dali-toolkit/internal/visuals/color/color-visual.cpp index 8228550..2058e1b 100644 --- a/dali-toolkit/internal/visuals/color/color-visual.cpp +++ b/dali-toolkit/internal/visuals/color/color-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -89,7 +89,7 @@ ColorVisualPtr ColorVisual::New( VisualFactoryCache& factoryCache, const Propert } ColorVisual::ColorVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ), +: Visual::Base( factoryCache ), mRenderIfTransparent( false ) { } diff --git a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp index e54d811..2686a50 100644 --- a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -227,7 +227,7 @@ GradientVisualPtr GradientVisual::New( VisualFactoryCache& factoryCache, const P } GradientVisual::GradientVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ), +: Visual::Base( factoryCache ), mGradientType( LINEAR ), mIsOpaque( true ) { diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index bbd11d8..70bd512 100755 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -269,7 +269,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageDimensions size, FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode ) -: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ), +: Visual::Base( factoryCache ), mImage(), mPixelArea( FULL_TEXTURE_RECT ), mPlacementActor(), @@ -292,7 +292,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, } ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, const Image& image ) -: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ), +: Visual::Base( factoryCache ), mImage( image ), mPixelArea( FULL_TEXTURE_RECT ), mPlacementActor(), diff --git a/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp b/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp index f7ed731..0bea8c6 100644 --- a/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp +++ b/dali-toolkit/internal/visuals/mesh/mesh-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -375,7 +375,7 @@ MeshVisualPtr MeshVisual::New( VisualFactoryCache& factoryCache, const Property: } MeshVisual::MeshVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ), +: Visual::Base( factoryCache ), mShadingMode( Toolkit::MeshVisual::ShadingMode::TEXTURED_WITH_DETAILED_SPECULAR_LIGHTING ), mUseTexture( true ), mUseMipmapping( true ), diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index afb517b..f61848c 100755 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -429,7 +429,7 @@ void NPatchVisual::DoCreateInstancePropertyMap( Property::Map& map ) const } NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ), +: Visual::Base( factoryCache ), mLoader( factoryCache.GetNPatchLoader() ), mImageUrl(), mAuxiliaryUrl(), diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index e097ec8..28afa6a 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -185,7 +185,7 @@ PrimitiveVisualPtr PrimitiveVisual::New( VisualFactoryCache& factoryCache, const } PrimitiveVisual::PrimitiveVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ), +: Visual::Base( factoryCache ), mScaleDimensions( Vector3::ONE ), mScaleTopRadius( DEFAULT_SCALE_TOP_RADIUS ), mScaleBottomRadius( DEFAULT_SCALE_BOTTOM_RADIUS ), diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.cpp b/dali-toolkit/internal/visuals/svg/svg-visual.cpp index 826cbe8..b37bddb 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.cpp +++ b/dali-toolkit/internal/visuals/svg/svg-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -74,7 +74,7 @@ SvgVisualPtr SvgVisual::New( VisualFactoryCache& factoryCache, const VisualUrl& } SvgVisual::SvgVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ), +: Visual::Base( factoryCache ), mAtlasRect( FULL_TEXTURE_RECT ), mImageUrl( ), mParsedImage( NULL ), diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index ddb7bdb..f652e16 100755 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -436,7 +436,7 @@ void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const TextVisual::TextVisual( VisualFactoryCache& factoryCache ) -: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ), +: Visual::Base( factoryCache ), mController( Text::Controller::New() ), mTypesetter( Text::Typesetter::New( mController->GetTextModel() ) ), mAnimatableTextColorPropertyIndex( Property::INVALID_INDEX ), diff --git a/dali-toolkit/internal/visuals/visual-base-data-impl.cpp b/dali-toolkit/internal/visuals/visual-base-data-impl.cpp index b6f75ee..374ff68 100644 --- a/dali-toolkit/internal/visuals/visual-base-data-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-data-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -114,7 +114,7 @@ bool GetPolicyFromValue( const Property::Value& value, Vector2& policy ) } // unnamed namespace -Internal::Visual::Base::Impl::Impl(FittingMode fittingMode) +Internal::Visual::Base::Impl::Impl() : mCustomShader( NULL ), mBlendSlotDelegate( NULL ), mResourceObserver( NULL ), @@ -124,7 +124,6 @@ Internal::Visual::Base::Impl::Impl(FittingMode fittingMode) mDepthIndex( 0.0f ), mMixColorIndex( Property::INVALID_INDEX ), mOpacityIndex( Property::INVALID_INDEX ), - mFittingMode( fittingMode ), mFlags( 0 ), mResourceStatus( Toolkit::Visual::ResourceStatus::PREPARING ) { diff --git a/dali-toolkit/internal/visuals/visual-base-data-impl.h b/dali-toolkit/internal/visuals/visual-base-data-impl.h index 3ce75aa..fd24205 100644 --- a/dali-toolkit/internal/visuals/visual-base-data-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-data-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -27,7 +27,6 @@ #include #include #include -#include namespace Dali { @@ -45,9 +44,8 @@ struct Base::Impl { /** * Constructor - * @param [in] fittingMode that the derived class prefers */ - Impl(FittingMode fittingMode); + Impl(); /** * Destructor @@ -127,7 +125,6 @@ struct Base::Impl int mDepthIndex; Property::Index mMixColorIndex; Property::Index mOpacityIndex; - FittingMode mFittingMode; //< How the contents should fit the view int mFlags; Toolkit::Visual::ResourceStatus mResourceStatus; }; diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index 1cf6da7..e4f12c8 100755 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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,15 +21,12 @@ // EXTERNAL HEADER #include #include -#include #include //INTERNAL HEARDER #include #include #include -#include -#include #include #include @@ -40,8 +37,7 @@ Debug::Filter* gVisualBaseLogFilter = Debug::Filter::New( Debug::NoLogging, fals #endif const char * const PRE_MULTIPLIED_ALPHA_PROPERTY( "preMultipliedAlpha" ); - -} // namespace +} namespace Dali { @@ -52,18 +48,8 @@ namespace Toolkit namespace Internal { -namespace -{ - -DALI_ENUM_TO_STRING_TABLE_BEGIN( FITTING_MODE ) -DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FIT_KEEP_ASPECT_RATIO ) -DALI_ENUM_TO_STRING_WITH_SCOPE( Visual::FittingMode, FILL ) -DALI_ENUM_TO_STRING_TABLE_END( FITTING_MODE ) - -} // namespace - -Visual::Base::Base( VisualFactoryCache& factoryCache, FittingMode fittingMode ) -: mImpl( new Impl(fittingMode) ), +Visual::Base::Base( VisualFactoryCache& factoryCache ) +: mImpl( new Impl() ), mFactoryCache( factoryCache ) { } @@ -116,10 +102,6 @@ void Visual::Base::SetProperties( const Property::Map& propertyMap ) { matchKey = Property::Key( Toolkit::Visual::Property::OPACITY ); } - else if( matchKey == FITTING_MODE ) - { - matchKey = Property::Key( Toolkit::DevelVisual::Property::FITTING_MODE ); - } } switch( matchKey.indexKey ) @@ -181,12 +163,6 @@ void Visual::Base::SetProperties( const Property::Map& propertyMap ) } break; } - case Toolkit::DevelVisual::Property::FITTING_MODE: - { - Scripting::GetEnumerationProperty< Visual::FittingMode >( - value, FITTING_MODE_TABLE, FITTING_MODE_TABLE_COUNT, mImpl->mFittingMode ); - break; - } } } @@ -316,10 +292,6 @@ void Visual::Base::CreatePropertyMap( Property::Map& map ) const // which is ok, because they have a different key value range. map.Insert( Toolkit::Visual::Property::MIX_COLOR, mImpl->mMixColor ); // vec4 map.Insert( Toolkit::Visual::Property::OPACITY, mImpl->mMixColor.a ); - - auto fittingModeString = Scripting::GetLinearEnumerationName< FittingMode >( - mImpl->mFittingMode, FITTING_MODE_TABLE, FITTING_MODE_TABLE_COUNT ); - map.Insert( Toolkit::DevelVisual::Property::FITTING_MODE, fittingModeString ); } void Visual::Base::CreateInstancePropertyMap( Property::Map& map ) const @@ -476,11 +448,6 @@ Toolkit::Visual::ResourceStatus Visual::Base::GetResourceStatus() const return mImpl->mResourceStatus; } -Visual::FittingMode Visual::Base::GetFittingMode() const -{ - return mImpl->mFittingMode; -} - Renderer Visual::Base::GetRenderer() { return mImpl->mRenderer; diff --git a/dali-toolkit/internal/visuals/visual-base-impl.h b/dali-toolkit/internal/visuals/visual-base-impl.h index 755409f..b9cf7e9 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_VISUAL_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -33,7 +33,6 @@ #include #include #include -#include namespace Dali { @@ -49,8 +48,6 @@ namespace Visual class ResourceObserver; -using FittingMode = DevelVisual::FittingMode; - /** * Base class for all Control rendering logic. A control may have multiple visuals. * @@ -252,19 +249,14 @@ public: */ Toolkit::Visual::ResourceStatus GetResourceStatus() const; - /** - * @brief Get the fitting mode for the visual - */ - FittingMode GetFittingMode() const; - - protected: +protected: /** * @brief Constructor. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object */ - Base( VisualFactoryCache& factoryCache, FittingMode fittingMode ); + Base( VisualFactoryCache& factoryCache ); /** * @brief A reference counted object may only be deleted by calling Unreference(). diff --git a/dali-toolkit/internal/visuals/visual-string-constants.cpp b/dali-toolkit/internal/visuals/visual-string-constants.cpp index 864dde0..6c6f03c 100644 --- a/dali-toolkit/internal/visuals/visual-string-constants.cpp +++ b/dali-toolkit/internal/visuals/visual-string-constants.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -72,9 +72,6 @@ const char * const PREMULTIPLIED_ALPHA( "premultipliedAlpha" ); const char * const MIX_COLOR( "mixColor" ); const char * const OPACITY( "opacity" ); -// Fitting mode -const char * const FITTING_MODE( "fittingMode" ); - // Color visual const char * const RENDER_IF_TRANSPARENT_NAME( "renderIfTransparent" ); diff --git a/dali-toolkit/internal/visuals/visual-string-constants.h b/dali-toolkit/internal/visuals/visual-string-constants.h index 88e6c0a..f1fe499 100644 --- a/dali-toolkit/internal/visuals/visual-string-constants.h +++ b/dali-toolkit/internal/visuals/visual-string-constants.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_VISUAL_STRING_CONSTANTS_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -58,9 +58,6 @@ extern const char * const PREMULTIPLIED_ALPHA; extern const char * const MIX_COLOR; extern const char * const OPACITY; -// Fitting mode -extern const char * const FITTING_MODE; - // Color visual extern const char * const RENDER_IF_TRANSPARENT_NAME; diff --git a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp index 3319e92..7d6e6e6 100644 --- a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp +++ b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -107,7 +107,7 @@ WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache, Visua } WireframeVisual::WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual ) -: Visual::Base( factoryCache, Visual::FittingMode::FILL ), +: Visual::Base( factoryCache ), mActualVisual( actualVisual ) { } -- 2.7.4