Commit 10dd5023 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Removed BeginLayer and EndLayer functions. Resolved Cairo layers drawing...

Removed BeginLayer and EndLayer functions. Resolved Cairo layers drawing problem in a different way.
parent bb3f3d06
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -178,6 +178,8 @@ void CAIRO_GAL::BeginDrawing() throw( int )
    lineWidth = 0;

    isDeleteSavedPixels = true;

    cairo_push_group( cairoImage );
}


@@ -186,6 +188,9 @@ void CAIRO_GAL::EndDrawing()
    // Force remaining objects to be drawn
    Flush();

    cairo_pop_group_to_source( cairoImage );
    cairo_paint_with_alpha( cairoImage, fillColor.a );

    // This code was taken from the wxCairo example - it's not the most efficient one
    // Here is a good place for optimizations

@@ -521,6 +526,19 @@ void CAIRO_GAL::ClearScreen()
}


void CAIRO_GAL::SetLayerDepth( double aLayerDepth )
{
    super::SetLayerDepth( aLayerDepth );

    storePath();

    cairo_pop_group_to_source( cairoImage );
    cairo_paint_with_alpha( cairoImage, fillColor.a );

    cairo_push_group( cairoImage );
}


void CAIRO_GAL::Transform( MATRIX3x3D aTransformation )
{
    cairo_matrix_t cairoTransformation;
@@ -617,21 +635,6 @@ void CAIRO_GAL::Restore()
}


void CAIRO_GAL::BeginLayer()
{
    cairo_push_group( cairoImage );
}


void CAIRO_GAL::EndLayer()
{
    storePath();

    cairo_pop_group_to_source( cairoImage );
    cairo_paint_with_alpha( cairoImage, fillColor.a );
}


int CAIRO_GAL::BeginGroup()
{
    // If the grouping is started: the actual path is stored in the group, when
+0 −9
Original line number Diff line number Diff line
@@ -1288,15 +1288,6 @@ void OPENGL_GAL::Restore()
}


void OPENGL_GAL::BeginLayer()
{
}

void OPENGL_GAL::EndLayer()
{
}


// TODO Error handling
int OPENGL_GAL::BeginGroup()
{
+1 −10
Original line number Diff line number Diff line
@@ -95,12 +95,6 @@ public:
    /// @copydoc GAL::EndDrawing()
    virtual void EndDrawing();

    /// @copydoc GAL::BeginLayer()
    virtual void BeginLayer();

    /// @copydoc GAL::EndLayer()
    virtual void EndLayer();

    /// @copydoc GAL::DrawLine()
    virtual void DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );

@@ -178,10 +172,7 @@ public:
    double       GetLineWidth();

    /// @copydoc GAL::SetLayerDepth()
    virtual void SetLayerDepth( double aLayerDepth )
    {
        super::SetLayerDepth( aLayerDepth );
    }
    virtual void SetLayerDepth( double aLayerDepth );

    // --------------
    // Transformation
+0 −6
Original line number Diff line number Diff line
@@ -95,12 +95,6 @@ public:
    /// @brief End the drawing, needs to be called for every new frame.
    virtual void EndDrawing() = 0;

    /// @brief Begin the layer drawing, needs to be called for every new layer.
    virtual void BeginLayer() = 0;

    /// @brief Finish the layer drawing, needs to be called for every new layer.
    virtual void EndLayer() = 0;

    /**
     * @brief Draw a line.
     *
+0 −6
Original line number Diff line number Diff line
@@ -102,12 +102,6 @@ public:
    /// @copydoc GAL::EndDrawing()
    virtual void EndDrawing();

    /// @copydoc GAL::BeginLayer()
    virtual void BeginLayer();

    /// @copydoc GAL::EndLayer()
    virtual void EndLayer();

    /// @copydoc GAL::DrawLine()
    virtual void DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );