projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename OnStage signals and related internal changes
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
visuals
/
wireframe
/
wireframe-visual.cpp
diff --git
a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
index
5fd3160
..
e170655
100644
(file)
--- a/
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
+++ b/
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
6
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
8
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-20,7
+20,7
@@
#include "wireframe-visual.h"
// INTERNAL INCLUDES
#include "wireframe-visual.h"
// INTERNAL INCLUDES
-#include <dali-toolkit/
devel-api/visuals/visual-properties-devel
.h>
+#include <dali-toolkit/
public-api/visuals/visual-properties
.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
@@
-42,7
+42,7
@@
const char * const INDEX_NAME("indices");
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
-uniform
mediump
mat4 uMvpMatrix;\n
+uniform
highp
mat4 uMvpMatrix;\n
uniform mediump vec3 uSize;\n
\n
uniform mediump vec3 uSize;\n
\n
@@
-67,11
+67,12
@@
void main()\n
);
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(\n
);
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(\n
-uniform lowp vec4 uColor;\n
+ uniform lowp vec4 uColor;\n
+ uniform lowp vec3 mixColor;\n
\n
void main()\n
{\n
\n
void main()\n
{\n
- gl_FragColor = uColor;\n
+ gl_FragColor = uColor
* vec4( mixColor, 1.0 )
;\n
}\n
);
}\n
);
@@
-94,7
+95,7
@@
WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache, Visua
WireframeVisualPtr wireframeVisual( new WireframeVisual( factoryCache, actualVisual ) );
// Instead of calling SetProperties, looking for the only valid property 'transform'
WireframeVisualPtr wireframeVisual( new WireframeVisual( factoryCache, actualVisual ) );
// Instead of calling SetProperties, looking for the only valid property 'transform'
- Property::Value* transformValue = properties.Find(
Devel
Visual::Property::TRANSFORM, TRANSFORM );
+ Property::Value* transformValue = properties.Find(
Toolkit::
Visual::Property::TRANSFORM, TRANSFORM );
Property::Map transformMap;
if( transformValue && transformValue->Get( transformMap ) )
{
Property::Map transformMap;
if( transformValue && transformValue->Get( transformMap ) )
{
@@
-105,7
+106,7
@@
WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache, Visua
}
WireframeVisual::WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual )
}
WireframeVisual::WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual )
-: Visual::Base( factoryCache ),
+: Visual::Base( factoryCache
, Visual::FittingMode::FILL, actualVisual ? actualVisual->GetType() : Toolkit::Visual::WIREFRAME
),
mActualVisual( actualVisual )
{
}
mActualVisual( actualVisual )
{
}
@@
-147,20
+148,34
@@
void WireframeVisual::DoCreatePropertyMap( Property::Map& map ) const
else
{
map.Clear();
else
{
map.Clear();
- map.Insert( Toolkit::
Devel
Visual::Property::TYPE, Toolkit::Visual::WIREFRAME );
+ map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::WIREFRAME );
}
}
}
}
+void WireframeVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
+{
+ // Do nothing
+}
+
void WireframeVisual::DoSetProperties( const Property::Map& propertyMap )
{
void WireframeVisual::DoSetProperties( const Property::Map& propertyMap )
{
- // no properties supported at the moment
+ Property::Value* mixValue = propertyMap.Find( Toolkit::Visual::Property::MIX_COLOR, MIX_COLOR );
+ if( mixValue )
+ {
+ Vector4 mixColor;
+ mixValue->Get( mixColor );
+ SetMixColor( mixColor );
+ }
}
}
-void WireframeVisual::DoSetOnS
tag
e( Actor& actor )
+void WireframeVisual::DoSetOnS
cen
e( Actor& actor )
{
InitializeRenderer();
actor.AddRenderer( mImpl->mRenderer );
{
InitializeRenderer();
actor.AddRenderer( mImpl->mRenderer );
+
+ // Wireframe generated and ready to display
+ ResourceReady( Toolkit::Visual::ResourceStatus::READY );
}
void WireframeVisual::InitializeRenderer()
}
void WireframeVisual::InitializeRenderer()
@@
-225,6
+240,16
@@
void WireframeVisual::OnSetTransform()
}
}
}
}
+Visual::Base& WireframeVisual::GetVisualObject()
+{
+ if( mActualVisual )
+ {
+ return *mActualVisual.Get();
+ }
+
+ return *this;
+}
+
} // namespace Internal
} // namespace Toolkit
} // namespace Internal
} // namespace Toolkit