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
Merge "Don't count '\r' in text-field" into devel/master
[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
..
3319e92
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>
@@
-67,11
+67,13
@@
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
+ uniform lowp float opacity;\n
\n
void main()\n
{\n
\n
void main()\n
{\n
- gl_FragColor = uColor;\n
+ gl_FragColor = uColor
* vec4( mixColor, opacity )
;\n
}\n
);
}\n
);
@@
-94,7
+96,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
+107,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
),
mActualVisual( actualVisual )
{
}
mActualVisual( actualVisual )
{
}
@@
-147,13
+149,24
@@
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::DoSetOnStage( Actor& actor )
}
void WireframeVisual::DoSetOnStage( Actor& actor )
@@
-161,6
+174,9
@@
void WireframeVisual::DoSetOnStage( 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()