// EXTERNAL INCLUDES
#include <stdint.h>
#include <dali/public-api/common/dali-vector.h>
- #include <dali/public-api/images/atlas.h>
-#include <dali/devel-api/geometry/mesh-data.h>
+ #include <dali/devel-api/images/atlas.h>
#include <dali/public-api/images/buffer-image.h>
+#include <dali/public-api/shader-effects/material.h>
namespace Dali
{
} // namespace Dali
--#endif // __DALI_TOOLKIT_ATLAS_MANAGER_H__
++#endif // __DALI_TOOLKIT_ATLAS_MANAGER_H__
// Bouncing effect is presented by stacked three layers with same color and opacity
const size_t NUM_LAYERS( 3 );
const Vector3 LAYER_HEIGHTS( 1.f, 27.f/42.f, 13.f/42.f);
--
++/*
// use the actor color to paint every layer
const char* MESH_FRAGMENT_SHADER =
"void main()\n"
"{\n"
" gl_FragColor = uColor;\n"
"}\n";
--
++*/
// Constraint to move the vertices vertically
struct VertexPositionConstraint
{
Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex )
{
++ Actor meshActor;
++/*
Dali::AnimatableMesh mesh;
Dali::MeshActor meshActor;
constraint = Constraint::New<Vector3>( mesh, mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::POSITION), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) );
constraint.AddSource( Source(meshActor, bouncePropertyIndex) );
constraint.Apply();
-- }
++ }*/
return meshActor;
}
#include "tool-bar-impl.h"
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/renderable-actor.h>
+#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/object/type-registry.h>
- #include <dali/public-api/object/type-registry-helper.h>
+ #include <dali/devel-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
// EXTERNAL INCLUDES
#include <dali/dali.h>
#include <dali/integration-api/debug.h>
- //#include <dali/public-api/actors/renderer.h>
- #include <dali/public-api/text-abstraction/text-abstraction.h>
+ #include <dali/devel-api/text-abstraction/font-client.h>
-#include <dali/devel-api/actors/mesh-actor.h>
-#include <dali/devel-api/geometry/mesh.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/internal/atlas-manager/atlas-manager.h>
+ #include <dali-toolkit/internal/text/line-run.h>
#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
#include <dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h>
- #if defined(DEBUG_ENABLED)
- Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_ATLAS_RENDERER");
- #endif
+ #include <dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h>
-#include <dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.h>
++//#include <dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.h>
using namespace Dali;
using namespace Dali::Toolkit;
}
}
- Vector2 position = positions[ i ];
+ const Vector2& position = positions[ i ];
- MeshData newMeshData;
+ AtlasManager::Mesh2D newMesh;
mGlyphManager.Cached( glyph.fontId, glyph.index, slot );
if ( slot.mImageId )
// Create a new image for the glyph
BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
-
- // Ensure that the next image will fit into the current block size
- bool setSize = false;
- if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth )
+ if ( bitmap )
{
- setSize = true;
- mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
- }
- if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
- {
- setSize = true;
- mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
- }
+ // Ensure that the next image will fit into the current block size
+ bool setSize = false;
+ if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth )
+ {
+ setSize = true;
+ mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
+ }
+ if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
+ {
+ setSize = true;
+ mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
+ }
- if ( setSize )
- {
- mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
- DEFAULT_ATLAS_HEIGHT,
- mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
- mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
- }
+ if ( setSize )
+ {
+ mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
+ DEFAULT_ATLAS_HEIGHT,
+ mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
+ mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
+ }
- // Locate a new slot for our glyph
- mGlyphManager.Add( glyph, bitmap, slot );
+ // Locate a new slot for our glyph
+ mGlyphManager.Add( glyph, bitmap, slot );
- // Generate mesh data for this quad, plugging in our supplied position
- if ( slot.mImageId )
- {
- mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
- mImageIds.PushBack( slot.mImageId );
+ // Generate mesh data for this quad, plugging in our supplied position
+ if ( slot.mImageId )
+ {
- mGlyphManager.GenerateMeshData( slot.mImageId, position, newMeshData );
++ mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
+ mImageIds.PushBack( slot.mImageId );
+ }
}
}
// Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
return Text::RendererPtr( new AtlasRenderer() );
}
-RenderableActor AtlasRenderer::Render( Text::ViewInterface& view )
+Actor AtlasRenderer::Render( Text::ViewInterface& view )
{
-
UnparentAndReset( mImpl->mActor );
- Text::Length numberOfGlyphs = view.GetNumberOfGlyphs();
+ Length numberOfGlyphs = view.GetNumberOfGlyphs();
- if( numberOfGlyphs > 0 )
+ if( numberOfGlyphs > 0u )
{
Vector<GlyphInfo> glyphs;
glyphs.Resize( numberOfGlyphs );
// CLASS HEADER
#include <dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h>
- // INTERNAL INCLUDES
- #include <dali/public-api/text-abstraction/font-client.h>
+ // EXTERNAL INCLUDES
+ #include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/public-api/actors/image-actor.h>
- #include <dali/public-api/images/atlas.h>
-#include <dali/devel-api/actors/mesh-actor.h>
+ #include <dali/devel-api/images/atlas.h>
-#include <dali/devel-api/geometry/mesh.h>
+ #include <dali/integration-api/debug.h>
+
+ // INTERNAL INCLUDES
+ #include <dali-toolkit/internal/text/line-run.h>
#include <dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h>
#include <dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h>
--- /dev/null
-
+ /*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+ // CLASS HEADER
+ #include <dali-toolkit/internal/text/rendering/text-renderer.h>
+
+ namespace Dali
+ {
+
+ namespace Toolkit
+ {
+
+ namespace Text
+ {
+
+ namespace BasicShadowShader
+ {
-
++/*
+ Dali::ShaderEffect New()
+ {
+ std::string vertexShader = DALI_COMPOSE_SHADER(
+ void main()\n
+ {\n
+ gl_Position = vec4( aPosition.xy, 0.0, 1.0 );\n
+ vTexCoord = aTexCoord.xy;\n
+ }\n
+ );
+
+ std::string fragmentShader = DALI_COMPOSE_SHADER(
+ void main()\n
+ {\n
+ mediump vec4 color = texture2D( sTexture, vTexCoord );
+ gl_FragColor = vec4(uColor.rgb, uColor.a*color.r);
+ }\n
+ );
+
+ Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader,
+ Dali::GeometryType( Dali::GEOMETRY_TYPE_TEXTURED_MESH ),
+ Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) );
+ return shaderEffect;
+ }
++*/
+ } // namespace BasicShadowShader
+
+ } // namespace Text
+
+ } // namespace Toolkit
+
+ } // namespace Dali
#include <limits>
#include <stack>
#include <dali/public-api/actors/image-actor.h>
-#include <dali/devel-api/actors/mesh-actor.h>
#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/animation/constraints.h>
-#include <dali/devel-api/geometry/mesh.h>
#include <dali/public-api/object/type-registry.h>
- #include <dali/public-api/object/type-registry-helper.h>
- #include <dali/public-api/scripting/scripting.h>
+ #include <dali/devel-api/object/type-registry-helper.h>
+ #include <dali/devel-api/scripting/scripting.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
#include <dali/integration-api/debug.h>