Esempio n. 1
0
void Layer::paintTrack( QPainter& painter, TimeLineCells* cells, int x, int y, int width, int height, bool selected, int frameSize )
{
    painter.setFont( QFont( "helvetica", height / 2 ) );
    if ( visible )
    {
        QColor col;
        if ( type() == BITMAP ) col = QColor( 130, 130, 245 );
        if ( type() == VECTOR ) col = QColor( 100, 205, 150 );
        if ( type() == SOUND ) col = QColor( 245, 130, 130 );
        if ( type() == CAMERA ) col = QColor( 100, 128, 140 );
        if ( !selected ) col = QColor( ( 1 * col.red() + 2 * 200 ) / 3, ( 1 * col.green() + 2 * 200 ) / 3, ( 1 * col.blue() + 2 * 200 ) / 3 );

        painter.setBrush( col );
        painter.setPen( QPen( QBrush( QColor( 100, 100, 100 ) ), 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ) );
        painter.drawRect( x, y - 1, width, height );

        paintFrames( painter, cells, x, y, width, height, selected, frameSize );

        // changes the apparence if selected
        if ( selected )
        {
            paintSelection( painter, x, y, width, height );
        }
    }
    else
    {
        painter.setBrush( Qt::gray );
        painter.setPen( QPen( QBrush( QColor( 100, 100, 100 ) ), 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ) );
        painter.drawRect( x, y - 1, width, height ); // empty rectangle  by default
    }
}
Esempio n. 2
0
SimDisplayItemList SimCompositor::beginFrame() {
  DCHECK(m_webViewImpl);
  DCHECK(!m_deferCommits);
  DCHECK(m_needsBeginFrame);
  m_needsBeginFrame = false;

  // Always advance the time as if the compositor was running at 60fps.
  m_lastFrameTimeMonotonic = monotonicallyIncreasingTime() + 0.016;

  m_webViewImpl->beginFrame(m_lastFrameTimeMonotonic);
  m_webViewImpl->updateAllLifecyclePhases();

  LocalFrame* root = m_webViewImpl->mainFrameImpl()->frame();

  SimDisplayItemList displayList;
  paintFrames(*root, displayList);

  return displayList;
}
SimDisplayItemList SimCompositor::beginFrame()
{
    ASSERT(m_webViewImpl);
    ASSERT(!m_deferCommits);
    ASSERT(m_needsAnimate);
    m_needsAnimate = false;

    // Always advance the time as if the compositor was running at 60fps.
    m_lastFrameTimeMonotonic = monotonicallyIncreasingTime() + 0.016;

    m_webViewImpl->beginFrame(m_lastFrameTimeMonotonic);
    m_webViewImpl->layout();

    LocalFrame* root = m_webViewImpl->mainFrameImpl()->frame();

    SimDisplayItemList displayList;
    paintFrames(*root, displayList);

    return displayList;
}