2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include <dali/internal/render/common/render-debug.h>
24 #include <dali/integration-api/debug.h>
25 #include <dali/internal/render/common/render-item.h>
26 #include <dali/internal/render/common/render-list.h>
27 #include <dali/internal/render/common/render-instruction.h>
29 using Dali::Internal::SceneGraph::RenderList;
40 void PrintFrameStart( BufferIndex bufferIndex )
42 DALI_LOG_RENDER_INFO( "RENDER START - bufferIndex: %d\n", bufferIndex );
47 DALI_LOG_RENDER_INFO( "RENDER END\n\n" );
50 void PrintRenderInstruction( const SceneGraph::RenderInstruction& instruction )
52 const char* target = (0 != instruction.mOffscreenTextureId) ? "FrameBuffer" : "Screen";
54 std::stringstream debugStream;
55 debugStream << "Rendering to " << target << ", View: " << *(instruction.mViewMatrix) << " Projection: " << *(instruction.mProjectionMatrix);
57 if( instruction.mIsViewportSet )
59 debugStream << " Viewport: " << instruction.mViewport.x << "," << instruction.mViewport.y << " " << instruction.mViewport.width << "x" << instruction.mViewport.height;
62 if( instruction.mIsClearColorSet )
64 debugStream << " ClearColor: " << instruction.mClearColor;
67 std::string debugString( debugStream.str() );
68 DALI_LOG_RENDER_INFO( " %s\n", debugString.c_str() );
71 void PrintRenderList( const RenderList& list )
73 unsigned int flags = list.GetFlags();
75 std::stringstream debugStream;
76 debugStream << "Rendering items";
80 debugStream << " with:";
82 if( flags & RenderList::DEPTH_TEST )
84 debugStream << " DEPTH_TEST";
87 if( flags & RenderList::DEPTH_WRITE )
89 debugStream << " DEPTH_WRITE";
92 if( flags & RenderList::DEPTH_CLEAR )
94 debugStream << " DEPTH_CLEAR";
97 if( flags & RenderList::STENCIL_TEST )
99 debugStream << " STENCIL_TEST";
102 if( flags & RenderList::STENCIL_WRITE )
104 debugStream << " STENCIL_WRITE";
107 if( flags & RenderList::STENCIL_CLEAR )
109 debugStream << " STENCIL_CLEAR";
114 debugStream << " without any DEPTH_TEST, DEPTH_WRITE etc";
117 if( list.IsClipping() )
119 debugStream << ", ClippingBox: " << list.GetClippingBox().x << "," << list.GetClippingBox().y << " " << list.GetClippingBox().width << "x" << list.GetClippingBox().height;
122 std::string debugString( debugStream.str() );
123 DALI_LOG_RENDER_INFO( " %s\n", debugString.c_str() );
126 void PrintRenderItem( const SceneGraph::RenderItem& item )
128 std::stringstream debugStream;
129 debugStream << "Rendering item, ModelView: " << item.GetModelViewMatrix();
131 std::string debugString( debugStream.str() );
132 DALI_LOG_RENDER_INFO( " %s\n", debugString.c_str() );