X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali-toolkit%2Finternal%2Fvisuals%2Fcolor%2Fcolor-visual.cpp;h=6406bccd100b01b3c07e1fa5393d2cac8aaa3b7b;hb=c3f9162ab11786380e2ec9c55f217c2daf7722e8;hp=2146e5096b2b1faf75d9ad426f8139791e1f2151;hpb=1972f043026a3e1bdcaad71c17859a8f324d1e6d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/color/color-visual.cpp b/dali-toolkit/internal/visuals/color/color-visual.cpp index 2146e50..6406bcc 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) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -22,10 +22,11 @@ #include //INTERNAL INCLUDES +#include #include #include #include -#include +#include namespace Dali { @@ -65,7 +66,7 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( } ColorVisual::ColorVisual( VisualFactoryCache& factoryCache ) -: Visual( factoryCache ), +: Visual::Base( factoryCache ), mMixColorIndex( Property::INVALID_INDEX ) { } @@ -76,42 +77,32 @@ ColorVisual::~ColorVisual() void ColorVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap ) { - Property::Value* color = propertyMap.Find( COLOR_NAME ); + Property::Value* color = propertyMap.Find( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME ); if( !( color && color->Get(mMixColor) ) ) { - DALI_LOG_ERROR( "Fail to provide a color to the ColorVisual object" ); + DALI_LOG_ERROR( "Fail to provide a color to the ColorVisual object\n" ); } } void ColorVisual::SetSize( const Vector2& size ) { - Visual::SetSize( size ); + Visual::Base::SetSize( size ); // ToDo: renderer responds to the size change } -void ColorVisual::SetClipRect( const Rect& clipRect ) -{ - Visual::SetClipRect( clipRect ); - - //ToDo: renderer responds to the clipRect change -} - -void ColorVisual::SetOffset( const Vector2& offset ) -{ - //ToDo: renderer applies the offset -} - void ColorVisual::DoSetOnStage( Actor& actor ) { InitializeRenderer(); + + actor.AddRenderer( mImpl->mRenderer ); } void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const { map.Clear(); - map.Insert( RENDERER_TYPE, COLOR_RENDERER ); - map.Insert( COLOR_NAME, mMixColor ); + map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR ); + map.Insert( Toolkit::ColorVisual::Property::MIX_COLOR, mMixColor ); } void ColorVisual::InitializeRenderer() @@ -132,7 +123,7 @@ void ColorVisual::InitializeRenderer() mImpl->mRenderer = Renderer::New( geometry, shader ); - mMixColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mMixColor ); + mMixColorIndex = mImpl->mRenderer.RegisterProperty( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME, mMixColor ); if( mMixColor.a < 1.f ) { mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );