8using namespace QskVertex;
10#ifndef QT_NO_DEBUG_STREAM
14QDebug operator<<( QDebug debug,
Color color )
16 QDebugStateSaver saver( debug );
19 debug << color.r <<
"," << color.g <<
"," << color.b <<
"," << color.a;
25QDebug operator<<( QDebug debug,
const ColoredLine& line )
27 qDebug() << qRound( line.p1.x ) << qRound( line.p1.y )
28 <<
"->" << qRound( line.p2.x ) << qRound( line.p2.y );
33QDebug operator<<( QDebug debug,
const Line& line )
35 qDebug() << qRound( line.p1.x ) << qRound( line.p1.y )
36 <<
"->" << qRound( line.p2.x ) << qRound( line.p2.y );
44static inline void qskDebugGeometry(
const Line* lines,
int count )
46#ifndef QT_NO_DEBUG_STREAM
47 for (
int i = 0; i < count; i++ )
49 const auto l = lines[i];
52 << qRound( l.p1.x ) << qRound( l.p1.y )
53 <<
"->" << qRound( l.p2.x ) << qRound( l.p2.y );
58void QskVertex::debugGeometry(
const QSGGeometry& geometry )
60 const auto lineCount = geometry.vertexCount() / 2;
62 if ( geometry.attributeCount() == 1 )
64 const auto lines =
reinterpret_cast< const Line*
>( geometry.vertexData() );
65 qskDebugGeometry( lines, lineCount );
67 else if ( geometry.attributeCount() == 2 )
69 const auto lines =
reinterpret_cast< const ColoredLine*
>( geometry.vertexData() );
70 qskDebugGeometry( lines, lineCount );