Rendering API clean-up
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / renderer-factory / renderer-factory.cpp
index 6eaaea2..b1de7f0 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/renderers/renderer-factory-impl.h>
 
-
 namespace Dali
 {
 
 namespace Toolkit
 {
 
+namespace
+{
+  const char * const DALI_DEBUG_RENDERING("DALI_DEBUG_RENDERING");
+}
+
 RendererFactory RendererFactory::Get()
 {
   RendererFactory factory;
@@ -46,10 +51,17 @@ RendererFactory RendererFactory::Get()
       factory = RendererFactory( dynamic_cast<Internal::RendererFactory*>(handle.GetObjectPtr()) );
     }
 
-    if( !factory )
+    if( !factory )// If not, create the RendererFactory and register it as a singleton
     {
-      // If not, create the RendererFactory and register it as a singleton
-      factory = RendererFactory( new Internal::RendererFactory() );
+      // Check whether debug rendering is required
+      if( EnvironmentVariable::GetEnvironmentVariable( DALI_DEBUG_RENDERING ) )
+      {
+        factory = RendererFactory( new Internal::RendererFactory(true) );
+      }
+      else
+      {
+        factory = RendererFactory( new Internal::RendererFactory(false) );
+      }
       singletonService.Register( typeid(RendererFactory), factory );
 
     }
@@ -99,7 +111,13 @@ void RendererFactory::ResetRenderer( ControlRenderer& renderer, Actor& actor, co
 
 ControlRenderer RendererFactory::GetControlRenderer( float borderSize, const Vector4& borderColor )
 {
-  return GetImplementation( *this ).GetControlRenderer( borderSize, borderColor );
+  return GetImplementation( *this ).GetControlRenderer( borderSize, borderColor, false );
+}
+
+
+ControlRenderer RendererFactory::GetControlRenderer( float borderSize, const Vector4& borderColor, bool antiAliasing )
+{
+  return GetImplementation( *this ).GetControlRenderer( borderSize, borderColor, antiAliasing );
 }
 
 ControlRenderer RendererFactory::GetControlRenderer( const Image& image )