ganeswidgets/inc/hgvgquadrenderer.h
author William Roberts <williamr@symbian.org>
Fri, 11 Jun 2010 16:25:05 +0100
branchGCC_SURGE
changeset 4 463f1934e292
parent 2 49c70dcc3f17
child 5 4fa04caf0f43
permissions -rw-r--r--
Branch for GCC_SURGE fixes

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:    
*
*/

#ifndef HGVGQUADRENDERER_H
#define HGVGQUADRENDERER_H

#include "hgtransformedquadrenderer.h"
#include <qlist>
#include <VG/openvg.h>
#include <qimage>
#include <qtransform>

class QPoint;
class QPainter;
class QRectF;
class QMatrix4x4;
class HgVgQuad;
class HgVgImage;
class QSize;
class HgTransformedQuad;
/**
 * OpenVG implementation of the HgQuadRenderer.
 */
class HgVgQuadRenderer: public HgTransformedQuadRenderer
{
public:
    HgVgQuadRenderer(int maxQuads);
    virtual ~HgVgQuadRenderer();    
        
    // From HgQuadRenderer
    virtual void drawQuads(QPainter* painter, const QRectF& rect, 
        const QMatrix4x4& viewMatrix, const QMatrix4x4& projectionMatrix,
        Qt::Orientation orientation, 
        const QTransform& sceneTransform);    
    virtual HgImage* createNativeImage();
    virtual void setDefaultImage(QImage defaultImage);

    // new functions
    HgVgImage* defaultImage();
    
protected:

    // From HgTransformedQuadRenderer
    virtual HgTransformedQuad* createNativeQuad();

private:
    
    QTransform qtToVgTransform(QPainter* painter, const QTransform& sceneTransform, 
        const QRectF& rect, Qt::Orientation orientation) const;

private:    
    HgVgImage* mDefaultVgImage;    
};

#endif