Commit bc305859 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Mainly case changes.

parent 0ac3e1fb
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ void CAIRO_GAL::SetIsFill( bool aIsFillEnabled )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_SET_FILL;
        groupElement.boolArgument = aIsFillEnabled;
        currentGroup->push_back( groupElement );
@@ -340,7 +340,7 @@ void CAIRO_GAL::SetIsStroke( bool aIsStrokeEnabled )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_SET_STROKE;
        groupElement.boolArgument = aIsStrokeEnabled;
        currentGroup->push_back( groupElement );
@@ -355,7 +355,7 @@ void CAIRO_GAL::SetStrokeColor( const COLOR4D& aColor )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_SET_STROKECOLOR;
        groupElement.arguments[0] = strokeColor.r;
        groupElement.arguments[1] = strokeColor.g;
@@ -373,7 +373,7 @@ void CAIRO_GAL::SetFillColor( const COLOR4D& aColor )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_SET_FILLCOLOR;
        groupElement.arguments[0] = fillColor.r;
        groupElement.arguments[1] = fillColor.g;
@@ -392,7 +392,7 @@ void CAIRO_GAL::SetLineWidth( double aLineWidth )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_SET_LINE_WIDTH;
        groupElement.arguments[0] = aLineWidth;
        currentGroup->push_back( groupElement );
@@ -446,7 +446,7 @@ void CAIRO_GAL::Rotate( double aAngle )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_ROTATE;
        groupElement.arguments[0] = aAngle;
        currentGroup->push_back( groupElement );
@@ -464,7 +464,7 @@ void CAIRO_GAL::Translate( const VECTOR2D& aTranslation )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_TRANSLATE;
        groupElement.arguments[0] = aTranslation.x;
        groupElement.arguments[1] = aTranslation.y;
@@ -483,7 +483,7 @@ void CAIRO_GAL::Scale( const VECTOR2D& aScale )

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_SCALE;
        groupElement.arguments[0] = aScale.x;
        groupElement.arguments[1] = aScale.y;
@@ -502,7 +502,7 @@ void CAIRO_GAL::Save()

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_SAVE;
        currentGroup->push_back( groupElement );
    }
@@ -519,7 +519,7 @@ void CAIRO_GAL::Restore()

    if( isGrouping )
    {
        GroupElement groupElement;
        GROUP_ELEMENT groupElement;
        groupElement.command = CMD_RESTORE;
        currentGroup->push_back( groupElement );
    }
@@ -538,7 +538,7 @@ int CAIRO_GAL::BeginGroup()
    // a attribute was changed or when grouping stops with the end group method.
    storePath();

    Group group;
    GROUP group;
    int groupNumber = getNewGroupNumber();
    groups.insert( std::make_pair( groupNumber, group ) );
    currentGroup = &groups[groupNumber];
@@ -564,7 +564,7 @@ void CAIRO_GAL::DrawGroup( int aGroupNumber )

    storePath();

    for( Group::iterator it = groups[aGroupNumber].begin();
    for( GROUP::iterator it = groups[aGroupNumber].begin();
         it != groups[aGroupNumber].end(); ++it )
    {
        switch( it->command )
@@ -649,7 +649,7 @@ void CAIRO_GAL::ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor )
{
    storePath();

    for( Group::iterator it = groups[aGroupNumber].begin();
    for( GROUP::iterator it = groups[aGroupNumber].begin();
         it != groups[aGroupNumber].end(); ++it )
    {
        if( it->command == CMD_SET_FILLCOLOR || it->command == CMD_SET_STROKECOLOR )
@@ -675,7 +675,7 @@ void CAIRO_GAL::DeleteGroup( int aGroupNumber )
    storePath();

    // Delete the Cairo paths
    std::deque<GroupElement>::iterator it, end;
    std::deque<GROUP_ELEMENT>::iterator it, end;

    for( it = groups[aGroupNumber].begin(), end = groups[aGroupNumber].end(); it != end; ++it )
    {
@@ -730,7 +730,7 @@ void CAIRO_GAL::RestoreScreen()
}


void CAIRO_GAL::SetTarget( RenderTarget aTarget )
void CAIRO_GAL::SetTarget( RENDER_TARGET aTarget )
{
    // If the compositor is not set, that means that there is a recaching process going on
    // and we do not need the compositor now
@@ -766,13 +766,13 @@ void CAIRO_GAL::SetTarget( RenderTarget aTarget )
}


RenderTarget CAIRO_GAL::GetTarget() const
RENDER_TARGET CAIRO_GAL::GetTarget() const
{
    return currentTarget;
}


void CAIRO_GAL::ClearTarget( RenderTarget aTarget )
void CAIRO_GAL::ClearTarget( RENDER_TARGET aTarget )
{
    // Save the current state
    unsigned int currentBuffer = compositor->GetBuffer();
@@ -844,7 +844,7 @@ void CAIRO_GAL::storePath()
            // add this command to the group list;
            if( isStrokeEnabled )
            {
                GroupElement groupElement;
                GROUP_ELEMENT groupElement;
                groupElement.cairoPath = cairo_copy_path( currentContext );
                groupElement.command   = CMD_STROKE_PATH;
                currentGroup->push_back( groupElement );
@@ -852,7 +852,7 @@ void CAIRO_GAL::storePath()

            if( isFillEnabled )
            {
                GroupElement groupElement;
                GROUP_ELEMENT groupElement;
                groupElement.cairoPath = cairo_copy_path( currentContext );
                groupElement.command   = CMD_FILL_PATH;
                currentGroup->push_back( groupElement );
+15 −15
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ CACHED_CONTAINER::CACHED_CONTAINER( unsigned int aSize ) :
    VERTEX_CONTAINER( aSize ), m_item( NULL )
{
    // In the beginning there is only free space
    m_freeChunks.insert( Chunk( aSize, 0 ) );
    m_freeChunks.insert( CHUNK( aSize, 0 ) );
}


@@ -80,7 +80,7 @@ void CACHED_CONTAINER::FinishItem()
        int itemOffset = m_item->GetOffset();

        // Add the not used memory back to the pool
        m_freeChunks.insert( Chunk( m_chunkSize - m_itemSize, itemOffset + m_itemSize ) );
        m_freeChunks.insert( CHUNK( m_chunkSize - m_itemSize, itemOffset + m_itemSize ) );
        m_freeSpace += ( m_chunkSize - m_itemSize );
        // mergeFreeChunks();   // veery slow and buggy
    }
@@ -152,7 +152,7 @@ void CACHED_CONTAINER::Delete( VERTEX_ITEM* aItem )
    // Insert a free memory chunk entry in the place where item was stored
    if( size > 0 )
    {
        m_freeChunks.insert( Chunk( size, offset ) );
        m_freeChunks.insert( CHUNK( size, offset ) );
        m_freeSpace += size;
        // Indicate that the item is not stored in the container anymore
        aItem->setSize( 0 );
@@ -186,7 +186,7 @@ void CACHED_CONTAINER::Clear()

    // Set the size of all the stored VERTEX_ITEMs to 0, so it is clear that they are not held
    // in the container anymore
    Items::iterator it;
    ITEMS::iterator it;

    for( it = m_items.begin(); it != m_items.end(); ++it )
    {
@@ -198,7 +198,7 @@ void CACHED_CONTAINER::Clear()

    // Now there is only free space left
    m_freeChunks.clear();
    m_freeChunks.insert( Chunk( m_freeSpace, 0 ) );
    m_freeChunks.insert( CHUNK( m_freeSpace, 0 ) );
}


@@ -240,7 +240,7 @@ unsigned int CACHED_CONTAINER::reallocate( unsigned int aSize )
    }

    // Look for the free space chunk of at least given size
    FreeChunkMap::iterator newChunk = m_freeChunks.lower_bound( aSize );
    FREE_CHUNK_MAP::iterator newChunk = m_freeChunks.lower_bound( aSize );

    if( newChunk == m_freeChunks.end() )
    {
@@ -277,7 +277,7 @@ unsigned int CACHED_CONTAINER::reallocate( unsigned int aSize )

        // Free the space previously used by the chunk
        wxASSERT( m_itemSize > 0 );
        m_freeChunks.insert( Chunk( m_itemSize, m_chunkOffset ) );
        m_freeChunks.insert( CHUNK( m_itemSize, m_chunkOffset ) );
        m_freeSpace += m_itemSize;
    }

@@ -287,7 +287,7 @@ unsigned int CACHED_CONTAINER::reallocate( unsigned int aSize )
    // If there is some space left, return it to the pool - add an entry for it
    if( chunkSize > aSize )
    {
        m_freeChunks.insert( Chunk( chunkSize - aSize, chunkOffset + aSize ) );
        m_freeChunks.insert( CHUNK( chunkSize - aSize, chunkOffset + aSize ) );
    }

    m_freeSpace -= aSize;
@@ -321,7 +321,7 @@ bool CACHED_CONTAINER::defragment( VERTEX* aTarget )
    }

    int newOffset = 0;
    Items::iterator it, it_end;
    ITEMS::iterator it, it_end;

    for( it = m_items.begin(), it_end = m_items.end(); it != it_end; ++it )
    {
@@ -345,7 +345,7 @@ bool CACHED_CONTAINER::defragment( VERTEX* aTarget )
    // Now there is only one big chunk of free memory
    m_freeChunks.clear();
    wxASSERT( m_freeSpace > 0 );
    m_freeChunks.insert( Chunk( m_freeSpace, m_currentSize - m_freeSpace ) );
    m_freeChunks.insert( CHUNK( m_freeSpace, m_currentSize - m_freeSpace ) );

#if CACHED_CONTAINER_TEST > 0
    prof_end( &totalTime );
@@ -369,9 +369,9 @@ void CACHED_CONTAINER::mergeFreeChunks()
#endif

    // Reversed free chunks map - this one stores chunk size with its offset as the key
    std::list<Chunk> freeChunks;
    std::list<CHUNK> freeChunks;

    FreeChunkMap::const_iterator it, it_end;
    FREE_CHUNK_MAP::const_iterator it, it_end;

    for( it = m_freeChunks.begin(), it_end = m_freeChunks.end(); it != it_end; ++it )
    {
@@ -381,7 +381,7 @@ void CACHED_CONTAINER::mergeFreeChunks()
    m_freeChunks.clear();
    freeChunks.sort();

    std::list<Chunk>::const_iterator itf, itf_end;
    std::list<CHUNK>::const_iterator itf, itf_end;
    unsigned int offset = freeChunks.front().first;
    unsigned int size   = freeChunks.front().second;
    freeChunks.pop_front();
@@ -449,7 +449,7 @@ bool CACHED_CONTAINER::resizeContainer( unsigned int aNewSize )
        // We have to correct freeChunks after defragmentation
        m_freeChunks.clear();
        wxASSERT( aNewSize - reservedSpace() > 0 );
        m_freeChunks.insert( Chunk( aNewSize - reservedSpace(), reservedSpace() ) );
        m_freeChunks.insert( CHUNK( aNewSize - reservedSpace(), reservedSpace() ) );
    }
    else
    {
@@ -463,7 +463,7 @@ bool CACHED_CONTAINER::resizeContainer( unsigned int aNewSize )
        }

        // Add an entry for the new memory chunk at the end of the container
        m_freeChunks.insert( Chunk( aNewSize - m_currentSize, m_currentSize ) );
        m_freeChunks.insert( CHUNK( aNewSize - m_currentSize, m_currentSize ) );
    }

    m_vertices = newContainer;
+3 −3
Original line number Diff line number Diff line
@@ -691,7 +691,7 @@ void OPENGL_GAL::RestoreScreen()
}


void OPENGL_GAL::SetTarget( RenderTarget aTarget )
void OPENGL_GAL::SetTarget( RENDER_TARGET aTarget )
{
    switch( aTarget )
    {
@@ -713,13 +713,13 @@ void OPENGL_GAL::SetTarget( RenderTarget aTarget )
}


RenderTarget OPENGL_GAL::GetTarget() const
RENDER_TARGET OPENGL_GAL::GetTarget() const
{
    return currentTarget;
}


void OPENGL_GAL::ClearTarget( RenderTarget aTarget )
void OPENGL_GAL::ClearTarget( RENDER_TARGET aTarget )
{
    // Save the current state
    unsigned int oldTarget = compositor.GetBuffer();
+3 −3
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ SHADER::~SHADER()
}


bool SHADER::LoadBuiltinShader( unsigned int aShaderNumber, ShaderType aShaderType )
bool SHADER::LoadBuiltinShader( unsigned int aShaderNumber, SHADER_TYPE aShaderType )
{
    if( aShaderNumber >= shaders_number )
        return false;
@@ -72,7 +72,7 @@ bool SHADER::LoadBuiltinShader( unsigned int aShaderNumber, ShaderType aShaderTy
}


bool SHADER::LoadShaderFromFile( const std::string& aShaderSourceName, ShaderType aShaderType )
bool SHADER::LoadShaderFromFile( const std::string& aShaderSourceName, SHADER_TYPE aShaderType )
{
    // Load shader sources
    const std::string shaderSource = readSource( aShaderSourceName );
@@ -219,7 +219,7 @@ std::string SHADER::readSource( std::string aShaderSourceName )
}


bool SHADER::addSource( const std::string& aShaderSource, ShaderType aShaderType )
bool SHADER::addSource( const std::string& aShaderSource, SHADER_TYPE aShaderType )
{
    if( isShaderLinked )
    {
+9 −9
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe

    for( int j = 0; j < aNewStrokeFontSize; j++ )
    {
        Glyph    glyph;
        GLYPH    glyph;
        double   glyphStartX = 0.0;
        double   glyphEndX = 0.0;
        VECTOR2D glyphBoundingX;
@@ -118,21 +118,21 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
}


BOX2D STROKE_FONT::computeBoundingBox( const Glyph& aGlyph, const VECTOR2D& aGlyphBoundingX ) const
BOX2D STROKE_FONT::computeBoundingBox( const GLYPH& aGLYPH, const VECTOR2D& aGLYPHBoundingX ) const
{
    BOX2D boundingBox;

    std::deque<VECTOR2D> boundingPoints;

    boundingPoints.push_back( VECTOR2D( aGlyphBoundingX.x, 0 ) );
    boundingPoints.push_back( VECTOR2D( aGlyphBoundingX.y, 0 ) );
    boundingPoints.push_back( VECTOR2D( aGLYPHBoundingX.x, 0 ) );
    boundingPoints.push_back( VECTOR2D( aGLYPHBoundingX.y, 0 ) );

    for( Glyph::const_iterator pointListIt = aGlyph.begin(); pointListIt != aGlyph.end(); ++pointListIt )
    for( GLYPH::const_iterator pointListIt = aGLYPH.begin(); pointListIt != aGLYPH.end(); ++pointListIt )
    {
        for( std::deque<VECTOR2D>::const_iterator pointIt = pointListIt->begin();
                pointIt != pointListIt->end(); ++pointIt )
        {
            boundingPoints.push_back( VECTOR2D( aGlyphBoundingX.x, pointIt->y ) );
            boundingPoints.push_back( VECTOR2D( aGLYPHBoundingX.x, pointIt->y ) );
        }
    }

@@ -241,15 +241,15 @@ void STROKE_FONT::Draw( std::string aText, const VECTOR2D& aPosition, double aRo
            continue;
        }

        GlyphList::iterator glyphIt = m_glyphs.begin();
        GLYPH_LIST::iterator glyphIt = m_glyphs.begin();
        std::deque<BOX2D>::iterator bbIt = m_glyphBoundingBoxes.begin();

        advance( glyphIt, (int) ( *chIt ) - (int) ' ' );
        advance( bbIt, (int) ( *chIt ) - (int) ' ' );

        Glyph glyph = *glyphIt;
        GLYPH glyph = *glyphIt;

        for( Glyph::iterator pointListIt = glyph.begin(); pointListIt != glyph.end();
        for( GLYPH::iterator pointListIt = glyph.begin(); pointListIt != glyph.end();
             pointListIt++ )
        {
            std::deque<VECTOR2D> pointListScaled;
Loading