X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Fcommon%2Frender-debug.cpp;h=e418a6bb7a329b9a61d5d2b23ce5ea1211c3e7e1;hb=df900c39d55e86098dc87945e269634f351fa0e5;hp=c7894f45a209d7d45197bc037a6bdda2a93a052f;hpb=5c66381841dd4dfd82c5a118d34104a00a2e0e1c;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/common/render-debug.cpp b/dali/internal/render/common/render-debug.cpp index c7894f4..e418a6b 100644 --- a/dali/internal/render/common/render-debug.cpp +++ b/dali/internal/render/common/render-debug.cpp @@ -1,18 +1,19 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.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://floralicense.org/license/ -// -// 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. -// +/* + * 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. + * 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 @@ -25,7 +26,9 @@ #include #include #include +#include +using Dali::Internal::SceneGraph::Node; using Dali::Internal::SceneGraph::RenderList; namespace Dali @@ -37,6 +40,10 @@ namespace Internal namespace Render { +// These functions should only be defined if they are being used by the #define in the header. +// Otherwise they will contribute negatively to code coverage. +#ifdef DALI_PRINT_RENDER_INFO + void PrintFrameStart( BufferIndex bufferIndex ) { DALI_LOG_RENDER_INFO( "RENDER START - bufferIndex: %d\n", bufferIndex ); @@ -47,12 +54,12 @@ void PrintFrameEnd() DALI_LOG_RENDER_INFO( "RENDER END\n\n" ); } -void PrintRenderInstruction( const SceneGraph::RenderInstruction& instruction ) +void PrintRenderInstruction( const SceneGraph::RenderInstruction& instruction, BufferIndex index ) { - const char* target = (0 != instruction.mOffscreenTextureId) ? "FrameBuffer" : "Screen"; + const char* target = (nullptr != instruction.mFrameBuffer) ? "FrameBuffer" : "Screen"; std::stringstream debugStream; - debugStream << "Rendering to " << target << ", View: " << *(instruction.mViewMatrix) << " Projection: " << *(instruction.mProjectionMatrix); + debugStream << "Rendering to " << target << ", View: " << *(instruction.GetViewMatrix(index)) << " Projection: " << *(instruction.GetProjectionMatrix(index)); if( instruction.mIsViewportSet ) { @@ -70,50 +77,9 @@ void PrintRenderInstruction( const SceneGraph::RenderInstruction& instruction ) void PrintRenderList( const RenderList& list ) { - unsigned int flags = list.GetFlags(); - std::stringstream debugStream; debugStream << "Rendering items"; - if( flags ) - { - debugStream << " with:"; - - if( flags & RenderList::DEPTH_TEST ) - { - debugStream << " DEPTH_TEST"; - } - - if( flags & RenderList::DEPTH_WRITE ) - { - debugStream << " DEPTH_WRITE"; - } - - if( flags & RenderList::DEPTH_CLEAR ) - { - debugStream << " DEPTH_CLEAR"; - } - - if( flags & RenderList::STENCIL_TEST ) - { - debugStream << " STENCIL_TEST"; - } - - if( flags & RenderList::STENCIL_WRITE ) - { - debugStream << " STENCIL_WRITE"; - } - - if( flags & RenderList::STENCIL_CLEAR ) - { - debugStream << " STENCIL_CLEAR"; - } - } - else - { - debugStream << " without any DEPTH_TEST, DEPTH_WRITE etc"; - } - if( list.IsClipping() ) { debugStream << ", ClippingBox: " << list.GetClippingBox().x << "," << list.GetClippingBox().y << " " << list.GetClippingBox().width << "x" << list.GetClippingBox().height; @@ -126,12 +92,22 @@ void PrintRenderList( const RenderList& list ) void PrintRenderItem( const SceneGraph::RenderItem& item ) { std::stringstream debugStream; - debugStream << "Rendering item, ModelView: " << item.GetModelViewMatrix(); + debugStream << "Rendering item, ModelView: " << item.mModelViewMatrix; std::string debugString( debugStream.str() ); DALI_LOG_RENDER_INFO( " %s\n", debugString.c_str() ); } +void PrintRendererCount( unsigned int frameCount, unsigned int rendererCount ) +{ + if( frameCount % 120 == 30 ) // Print every 2 seconds reg + { + Debug::LogMessage( Debug::DebugInfo, "Renderer Total # renderers: %u\n", rendererCount ); + } +} + +#endif + } // Render } // Internal