Changeset 54063 in webkit


Ignore:
Timestamp:
Jan 29, 2010 7:43:08 AM (14 years ago)
Author:
jpetsovits@rim.com
Message:

2010-01-29 Jakob Petsovits <jpetsovits@rim.com>

Reviewed by Nikolas Zimmermann.

[OpenVG] Implement a basic GraphicsContext on top of a new PainterOpenVG class
https://bugs.webkit.org/show_bug.cgi?id=33405

PainterOpenVG provides painter state management that works
on a single (EGL) context, and apart from painter state
implements a single drawing operation (for now), drawRect().

It is a generic painter class that cooperates with
SurfaceOpenVG to enable robust surface/context switching
(given that EGL doesn't notify us if somebody switches
the surface/context behind our backs), and provides
painting operations close to OpenVG's way of working
that GraphicsContext, Path, Image, Font and other WebKit
platform classes can use to draw on.

Initial code for state management and OpenVG scissoring by
Eli Fidler <efidler@rim.com>. VGRect/VGMatrix and the bulk
of the transformations code by Adam Treat <atreat@rim.com>.
Preliminary drawFocusRing() implementation by Yong Li <yoli@rim.com>.

  • platform/graphics/FloatRect.h:
  • platform/graphics/GraphicsContext.cpp:
  • platform/graphics/GraphicsContext.h:
  • platform/graphics/openvg/GraphicsContextOpenVG.cpp: Added. (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): (WebCore::GraphicsContext::GraphicsContext): (WebCore::GraphicsContext::~GraphicsContext): (WebCore::GraphicsContext::platformContext): (WebCore::GraphicsContext::getCTM): (WebCore::GraphicsContext::savePlatformState): (WebCore::GraphicsContext::restorePlatformState): (WebCore::GraphicsContext::drawRect): (WebCore::GraphicsContext::drawLine): (WebCore::GraphicsContext::drawEllipse): (WebCore::GraphicsContext::strokeArc): (WebCore::GraphicsContext::drawConvexPolygon): (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::fillRoundedRect): (WebCore::GraphicsContext::beginPath): (WebCore::GraphicsContext::addPath): (WebCore::GraphicsContext::clip): (WebCore::GraphicsContext::clipPath): (WebCore::GraphicsContext::drawFocusRing): (WebCore::GraphicsContext::drawLineForText): (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar): (WebCore::GraphicsContext::roundToDevicePixels): (WebCore::GraphicsContext::setPlatformShadow): (WebCore::GraphicsContext::clearPlatformShadow): (WebCore::GraphicsContext::beginTransparencyLayer): (WebCore::GraphicsContext::endTransparencyLayer): (WebCore::GraphicsContext::clearRect): (WebCore::GraphicsContext::strokeRect): (WebCore::GraphicsContext::setLineCap): (WebCore::GraphicsContext::setLineDash): (WebCore::GraphicsContext::setLineJoin): (WebCore::GraphicsContext::setMiterLimit): (WebCore::GraphicsContext::setAlpha): (WebCore::GraphicsContext::setCompositeOperation): (WebCore::GraphicsContext::canvasClip): (WebCore::GraphicsContext::clipOut): (WebCore::GraphicsContext::scale): (WebCore::GraphicsContext::rotate): (WebCore::GraphicsContext::translate): (WebCore::GraphicsContext::origin): (WebCore::GraphicsContext::clipOutEllipseInRect): (WebCore::GraphicsContext::clipToImageBuffer): (WebCore::GraphicsContext::addInnerRoundedRectClip): (WebCore::GraphicsContext::concatCTM): (WebCore::GraphicsContext::setURLForRect): (WebCore::GraphicsContext::setPlatformStrokeColor): (WebCore::GraphicsContext::setPlatformStrokeStyle): (WebCore::GraphicsContext::setPlatformStrokeThickness): (WebCore::GraphicsContext::setPlatformFillColor): (WebCore::GraphicsContext::setPlatformShouldAntialias): (WebCore::GraphicsContext::setImageInterpolationQuality): (WebCore::GraphicsContext::imageInterpolationQuality):
  • platform/graphics/openvg/PainterOpenVG.cpp: Added. (WebCore::isNonRotatedAffineTransformation): (WebCore::toVGCapStyle): (WebCore::toVGJoinStyle): (WebCore::toVGFillRule): (WebCore::colorToVGColor): (WebCore::setVGSolidColor): (WebCore::PlatformPainterState::PlatformPainterState): (WebCore::PlatformPainterState::copyPaintState): (WebCore::PlatformPainterState::applyState): (WebCore::PlatformPainterState::applyBlending): (WebCore::PlatformPainterState::applyTransformationMatrix): (WebCore::PlatformPainterState::applyScissorRect): (WebCore::PlatformPainterState::applyStrokeStyle): (WebCore::PlatformPainterState::strokeDisabled): (WebCore::PlatformPainterState::fillDisabled): (WebCore::PainterOpenVG::PainterOpenVG): (WebCore::PainterOpenVG::~PainterOpenVG): (WebCore::PainterOpenVG::begin): (WebCore::PainterOpenVG::end): (WebCore::PainterOpenVG::destroyPainterStates): (WebCore::PainterOpenVG::applyState): (WebCore::PainterOpenVG::blitToSurface): (WebCore::PainterOpenVG::transformationMatrix): (WebCore::PainterOpenVG::concatTransformationMatrix): (WebCore::PainterOpenVG::setTransformationMatrix): (WebCore::PainterOpenVG::compositeOperation): (WebCore::PainterOpenVG::setCompositeOperation): (WebCore::PainterOpenVG::opacity): (WebCore::PainterOpenVG::setOpacity): (WebCore::PainterOpenVG::strokeThickness): (WebCore::PainterOpenVG::setStrokeThickness): (WebCore::PainterOpenVG::strokeStyle): (WebCore::PainterOpenVG::setStrokeStyle): (WebCore::PainterOpenVG::setLineDash): (WebCore::PainterOpenVG::setLineCap): (WebCore::PainterOpenVG::setLineJoin): (WebCore::PainterOpenVG::setMiterLimit): (WebCore::PainterOpenVG::strokeColor): (WebCore::PainterOpenVG::setStrokeColor): (WebCore::PainterOpenVG::fillColor): (WebCore::PainterOpenVG::setFillColor): (WebCore::PainterOpenVG::antialiasingEnabled): (WebCore::PainterOpenVG::setAntialiasingEnabled): (WebCore::PainterOpenVG::scale): (WebCore::PainterOpenVG::rotate): (WebCore::PainterOpenVG::translate): (WebCore::PainterOpenVG::intersectScissorRect): (WebCore::PainterOpenVG::intersectClipRect): (WebCore::PainterOpenVG::drawRect): (WebCore::PainterOpenVG::save): (WebCore::PainterOpenVG::restore):
  • platform/graphics/openvg/PainterOpenVG.h: Added. (WebCore::PainterOpenVG::): (WebCore::PainterOpenVG::surface):
  • platform/graphics/openvg/SurfaceOpenVG.cpp: (WebCore::SurfaceOpenVG::SurfaceOpenVG): (WebCore::SurfaceOpenVG::~SurfaceOpenVG): (WebCore::SurfaceOpenVG::makeCurrent): (WebCore::SurfaceOpenVG::makeCompatibleCurrent): (WebCore::SurfaceOpenVG::setActivePainter): (WebCore::SurfaceOpenVG::activePainter):
  • platform/graphics/openvg/SurfaceOpenVG.h: (WebCore::SurfaceOpenVG::):
  • platform/graphics/openvg/VGUtils.cpp: Added. (WebCore::VGMatrix::VGMatrix): (WebCore::VGMatrix::operator TransformationMatrix): (WebCore::TransformationMatrix::operator VGMatrix): (WebCore::VGRect::VGRect): (WebCore::VGRect::operator FloatRect): (WebCore::FloatRect::operator VGRect):
  • platform/graphics/openvg/VGUtils.h: (WebCore::VGMatrix::toVGfloat): (WebCore::VGRect::toVGfloat):
  • platform/graphics/transforms/TransformationMatrix.h:
Location:
trunk/WebCore
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r54061 r54063  
     12010-01-29  Jakob Petsovits  <jpetsovits@rim.com>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        [OpenVG] Implement a basic GraphicsContext on top of a new PainterOpenVG class
     6        https://bugs.webkit.org/show_bug.cgi?id=33405
     7
     8        PainterOpenVG provides painter state management that works
     9        on a single (EGL) context, and apart from painter state
     10        implements a single drawing operation (for now), drawRect().
     11
     12        It is a generic painter class that cooperates with
     13        SurfaceOpenVG to enable robust surface/context switching
     14        (given that EGL doesn't notify us if somebody switches
     15        the surface/context behind our backs), and provides
     16        painting operations close to OpenVG's way of working
     17        that GraphicsContext, Path, Image, Font and other WebKit
     18        platform classes can use to draw on.
     19
     20        Initial code for state management and OpenVG scissoring by
     21        Eli Fidler <efidler@rim.com>. VGRect/VGMatrix and the bulk
     22        of the transformations code by Adam Treat <atreat@rim.com>.
     23        Preliminary drawFocusRing() implementation by Yong Li <yoli@rim.com>.
     24
     25        * platform/graphics/FloatRect.h:
     26        * platform/graphics/GraphicsContext.cpp:
     27        * platform/graphics/GraphicsContext.h:
     28        * platform/graphics/openvg/GraphicsContextOpenVG.cpp: Added.
     29        (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
     30        (WebCore::GraphicsContext::GraphicsContext):
     31        (WebCore::GraphicsContext::~GraphicsContext):
     32        (WebCore::GraphicsContext::platformContext):
     33        (WebCore::GraphicsContext::getCTM):
     34        (WebCore::GraphicsContext::savePlatformState):
     35        (WebCore::GraphicsContext::restorePlatformState):
     36        (WebCore::GraphicsContext::drawRect):
     37        (WebCore::GraphicsContext::drawLine):
     38        (WebCore::GraphicsContext::drawEllipse):
     39        (WebCore::GraphicsContext::strokeArc):
     40        (WebCore::GraphicsContext::drawConvexPolygon):
     41        (WebCore::GraphicsContext::fillPath):
     42        (WebCore::GraphicsContext::strokePath):
     43        (WebCore::GraphicsContext::fillRect):
     44        (WebCore::GraphicsContext::fillRoundedRect):
     45        (WebCore::GraphicsContext::beginPath):
     46        (WebCore::GraphicsContext::addPath):
     47        (WebCore::GraphicsContext::clip):
     48        (WebCore::GraphicsContext::clipPath):
     49        (WebCore::GraphicsContext::drawFocusRing):
     50        (WebCore::GraphicsContext::drawLineForText):
     51        (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
     52        (WebCore::GraphicsContext::roundToDevicePixels):
     53        (WebCore::GraphicsContext::setPlatformShadow):
     54        (WebCore::GraphicsContext::clearPlatformShadow):
     55        (WebCore::GraphicsContext::beginTransparencyLayer):
     56        (WebCore::GraphicsContext::endTransparencyLayer):
     57        (WebCore::GraphicsContext::clearRect):
     58        (WebCore::GraphicsContext::strokeRect):
     59        (WebCore::GraphicsContext::setLineCap):
     60        (WebCore::GraphicsContext::setLineDash):
     61        (WebCore::GraphicsContext::setLineJoin):
     62        (WebCore::GraphicsContext::setMiterLimit):
     63        (WebCore::GraphicsContext::setAlpha):
     64        (WebCore::GraphicsContext::setCompositeOperation):
     65        (WebCore::GraphicsContext::canvasClip):
     66        (WebCore::GraphicsContext::clipOut):
     67        (WebCore::GraphicsContext::scale):
     68        (WebCore::GraphicsContext::rotate):
     69        (WebCore::GraphicsContext::translate):
     70        (WebCore::GraphicsContext::origin):
     71        (WebCore::GraphicsContext::clipOutEllipseInRect):
     72        (WebCore::GraphicsContext::clipToImageBuffer):
     73        (WebCore::GraphicsContext::addInnerRoundedRectClip):
     74        (WebCore::GraphicsContext::concatCTM):
     75        (WebCore::GraphicsContext::setURLForRect):
     76        (WebCore::GraphicsContext::setPlatformStrokeColor):
     77        (WebCore::GraphicsContext::setPlatformStrokeStyle):
     78        (WebCore::GraphicsContext::setPlatformStrokeThickness):
     79        (WebCore::GraphicsContext::setPlatformFillColor):
     80        (WebCore::GraphicsContext::setPlatformShouldAntialias):
     81        (WebCore::GraphicsContext::setImageInterpolationQuality):
     82        (WebCore::GraphicsContext::imageInterpolationQuality):
     83        * platform/graphics/openvg/PainterOpenVG.cpp: Added.
     84        (WebCore::isNonRotatedAffineTransformation):
     85        (WebCore::toVGCapStyle):
     86        (WebCore::toVGJoinStyle):
     87        (WebCore::toVGFillRule):
     88        (WebCore::colorToVGColor):
     89        (WebCore::setVGSolidColor):
     90        (WebCore::PlatformPainterState::PlatformPainterState):
     91        (WebCore::PlatformPainterState::copyPaintState):
     92        (WebCore::PlatformPainterState::applyState):
     93        (WebCore::PlatformPainterState::applyBlending):
     94        (WebCore::PlatformPainterState::applyTransformationMatrix):
     95        (WebCore::PlatformPainterState::applyScissorRect):
     96        (WebCore::PlatformPainterState::applyStrokeStyle):
     97        (WebCore::PlatformPainterState::strokeDisabled):
     98        (WebCore::PlatformPainterState::fillDisabled):
     99        (WebCore::PainterOpenVG::PainterOpenVG):
     100        (WebCore::PainterOpenVG::~PainterOpenVG):
     101        (WebCore::PainterOpenVG::begin):
     102        (WebCore::PainterOpenVG::end):
     103        (WebCore::PainterOpenVG::destroyPainterStates):
     104        (WebCore::PainterOpenVG::applyState):
     105        (WebCore::PainterOpenVG::blitToSurface):
     106        (WebCore::PainterOpenVG::transformationMatrix):
     107        (WebCore::PainterOpenVG::concatTransformationMatrix):
     108        (WebCore::PainterOpenVG::setTransformationMatrix):
     109        (WebCore::PainterOpenVG::compositeOperation):
     110        (WebCore::PainterOpenVG::setCompositeOperation):
     111        (WebCore::PainterOpenVG::opacity):
     112        (WebCore::PainterOpenVG::setOpacity):
     113        (WebCore::PainterOpenVG::strokeThickness):
     114        (WebCore::PainterOpenVG::setStrokeThickness):
     115        (WebCore::PainterOpenVG::strokeStyle):
     116        (WebCore::PainterOpenVG::setStrokeStyle):
     117        (WebCore::PainterOpenVG::setLineDash):
     118        (WebCore::PainterOpenVG::setLineCap):
     119        (WebCore::PainterOpenVG::setLineJoin):
     120        (WebCore::PainterOpenVG::setMiterLimit):
     121        (WebCore::PainterOpenVG::strokeColor):
     122        (WebCore::PainterOpenVG::setStrokeColor):
     123        (WebCore::PainterOpenVG::fillColor):
     124        (WebCore::PainterOpenVG::setFillColor):
     125        (WebCore::PainterOpenVG::antialiasingEnabled):
     126        (WebCore::PainterOpenVG::setAntialiasingEnabled):
     127        (WebCore::PainterOpenVG::scale):
     128        (WebCore::PainterOpenVG::rotate):
     129        (WebCore::PainterOpenVG::translate):
     130        (WebCore::PainterOpenVG::intersectScissorRect):
     131        (WebCore::PainterOpenVG::intersectClipRect):
     132        (WebCore::PainterOpenVG::drawRect):
     133        (WebCore::PainterOpenVG::save):
     134        (WebCore::PainterOpenVG::restore):
     135        * platform/graphics/openvg/PainterOpenVG.h: Added.
     136        (WebCore::PainterOpenVG::):
     137        (WebCore::PainterOpenVG::surface):
     138        * platform/graphics/openvg/SurfaceOpenVG.cpp:
     139        (WebCore::SurfaceOpenVG::SurfaceOpenVG):
     140        (WebCore::SurfaceOpenVG::~SurfaceOpenVG):
     141        (WebCore::SurfaceOpenVG::makeCurrent):
     142        (WebCore::SurfaceOpenVG::makeCompatibleCurrent):
     143        (WebCore::SurfaceOpenVG::setActivePainter):
     144        (WebCore::SurfaceOpenVG::activePainter):
     145        * platform/graphics/openvg/SurfaceOpenVG.h:
     146        (WebCore::SurfaceOpenVG::):
     147        * platform/graphics/openvg/VGUtils.cpp: Added.
     148        (WebCore::VGMatrix::VGMatrix):
     149        (WebCore::VGMatrix::operator TransformationMatrix):
     150        (WebCore::TransformationMatrix::operator VGMatrix):
     151        (WebCore::VGRect::VGRect):
     152        (WebCore::VGRect::operator FloatRect):
     153        (WebCore::FloatRect::operator VGRect):
     154        * platform/graphics/openvg/VGUtils.h:
     155        (WebCore::VGMatrix::toVGfloat):
     156        (WebCore::VGRect::toVGfloat):
     157        * platform/graphics/transforms/TransformationMatrix.h:
     158
    11592010-01-29  Philippe Normand  <pnormand@igalia.com>
    2160
  • trunk/WebCore/platform/graphics/FloatRect.h

    r52791 r54063  
    6262namespace WebCore {
    6363
     64#if PLATFORM(OPENVG)
     65class VGRect;
     66#endif
     67
    6468class IntRect;
    6569
     
    155159#endif
    156160
     161#if PLATFORM(OPENVG)
     162    operator VGRect() const;
     163#endif
     164
    157165private:
    158166    FloatPoint m_location;
  • trunk/WebCore/platform/graphics/GraphicsContext.cpp

    r53949 r54063  
    507507#endif
    508508
    509 #if !PLATFORM(QT) && !PLATFORM(CAIRO) && !PLATFORM(SKIA) && !PLATFORM(HAIKU)
     509#if !PLATFORM(QT) && !PLATFORM(CAIRO) && !PLATFORM(SKIA) && !PLATFORM(HAIKU) && !PLATFORM(OPENVG)
    510510void GraphicsContext::setPlatformStrokeStyle(const StrokeStyle&)
    511511{
  • trunk/WebCore/platform/graphics/GraphicsContext.h

    r53949 r54063  
    4242#elif PLATFORM(CAIRO)
    4343typedef struct _cairo PlatformGraphicsContext;
     44#elif PLATFORM(OPENVG)
     45namespace WebCore {
     46class SurfaceOpenVG;
     47}
     48typedef class WebCore::SurfaceOpenVG PlatformGraphicsContext;
    4449#elif PLATFORM(QT)
    4550QT_BEGIN_NAMESPACE
  • trunk/WebCore/platform/graphics/openvg/SurfaceOpenVG.cpp

    r53639 r54063  
    3030
    3131#include <wtf/Assertions.h>
    32 #include <wtf/UnusedParam.h>
    3332
    3433namespace WebCore {
    3534
     35PainterOpenVG* SurfaceOpenVG::s_currentPainter = 0;
     36
    3637SurfaceOpenVG* SurfaceOpenVG::currentSurface()
    3738{
     
    4647#if PLATFORM(EGL)
    4748SurfaceOpenVG::SurfaceOpenVG(const IntSize& size, const EGLDisplay& display, EGLConfig* confPtr, EGLint* errorCode)
    48     : m_eglDisplay(display)
     49    : m_activePainter(0)
     50    , m_eglDisplay(display)
    4951    , m_eglSurface(EGL_NO_SURFACE)
    5052    , m_eglContext(EGL_NO_CONTEXT)
     
    6466
    6567SurfaceOpenVG::SurfaceOpenVG(EGLNativeWindowType window, const EGLDisplay& display, EGLConfig* confPtr)
    66     : m_eglDisplay(display)
     68    : m_activePainter(0)
     69    , m_eglDisplay(display)
    6770    , m_eglSurface(EGL_NO_SURFACE)
    6871    , m_eglContext(EGL_NO_CONTEXT)
     
    8588// by itself.
    8689SurfaceOpenVG::SurfaceOpenVG()
    87     : m_eglDisplay(EGL_NO_DISPLAY)
     90    : m_activePainter(0)
     91    , m_eglDisplay(EGL_NO_DISPLAY)
    8892    , m_eglSurface(EGL_NO_SURFACE)
    8993    , m_eglContext(EGL_NO_CONTEXT)
     
    96100    if (!isValid())
    97101        return;
     102
     103    if (m_activePainter && this == m_activePainter->baseSurface())
     104        m_activePainter->end();
    98105
    99106#if PLATFORM(EGL)
     
    169176        eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
    170177        ASSERT_EGL_NO_ERROR();
     178        s_currentPainter = 0;
    171179    }
    172 #else
    173     UNUSED_PARAM(mode);
    174 #endif
     180#endif
     181
     182    if (m_activePainter && mode == ApplyPainterStateOnSurfaceSwitch
     183        && s_currentPainter != m_activePainter) {
     184        m_activePainter->applyState();
     185        s_currentPainter = m_activePainter;
     186    }
    175187}
    176188
     
    185197    ASSERT_EGL_NO_ERROR();
    186198
    187     if (currentSurface != m_eglSurface
    188         && !EGLDisplayOpenVG::forDisplay(m_eglDisplay)->surfacesCompatible(currentSurface, m_eglSurface)) {
     199    if (currentSurface == m_eglSurface) {
     200        if (m_activePainter && s_currentPainter != m_activePainter) {
     201            m_activePainter->applyState();
     202            s_currentPainter = m_activePainter;
     203        }
     204    } else if (!EGLDisplayOpenVG::forDisplay(m_eglDisplay)->surfacesCompatible(currentSurface, m_eglSurface)) {
    189205        eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
    190206        ASSERT_EGL_NO_ERROR();
     207        s_currentPainter = 0;
    191208    }
    192209    // else: surfaces compatible, no need to switch contexts
     
    204221}
    205222
    206 }
     223void SurfaceOpenVG::setActivePainter(PainterOpenVG* painter)
     224{
     225    ASSERT(isValid());
     226
     227    // If painter is non-zero, we want to make sure there was no previous painter set.
     228    ASSERT(!painter || !m_activePainter);
     229
     230    // Make sure a disabled painter isn't marked as global current painter anymore.
     231    if (!painter && s_currentPainter == m_activePainter)
     232        s_currentPainter = 0;
     233
     234    m_activePainter = painter;
     235}
     236
     237PainterOpenVG* SurfaceOpenVG::activePainter()
     238{
     239    ASSERT(isValid());
     240    return m_activePainter;
     241}
     242
     243}
  • trunk/WebCore/platform/graphics/openvg/SurfaceOpenVG.h

    r53639 r54063  
    3333class EGLDisplayOpenVG;
    3434#endif
     35class PainterOpenVG;
    3536class IntSize;
    3637
     
    4546class SurfaceOpenVG : public Noncopyable {
    4647public:
     48    enum MakeCurrentMode {
     49        ApplyPainterStateOnSurfaceSwitch,
     50        DontApplyPainterState,
     51    };
     52
    4753    static SurfaceOpenVG* currentSurface();
    4854
     
    9197     * OpenVG commands apply to it.
    9298     */
    93     void makeCurrent();
     99    void makeCurrent(MakeCurrentMode mode = ApplyPainterStateOnSurfaceSwitch);
    94100
    95101    /**
     
    111117    void flush();
    112118
     119    void setActivePainter(PainterOpenVG*);
     120    PainterOpenVG* activePainter();
     121
    113122private:
     123    PainterOpenVG* m_activePainter;
     124    static PainterOpenVG* s_currentPainter; // global currently active painter
     125
    114126#if PLATFORM(EGL)
    115127    SurfaceOpenVG(); // for EGLDisplayOpenVG
  • trunk/WebCore/platform/graphics/openvg/VGUtils.h

    r53639 r54063  
    5757#endif
    5858
     59
     60namespace WebCore {
     61
     62class FloatRect;
     63class TransformationMatrix;
     64
     65class VGMatrix {
     66public:
     67    VGMatrix(const VGfloat data[9]);
     68    VGMatrix(const TransformationMatrix&);
     69    const VGfloat* toVGfloat() const { return m_data; }
     70    operator TransformationMatrix() const;
     71private:
     72    VGfloat m_data[9];
     73};
     74
     75class VGRect {
     76public:
     77    VGRect(const VGfloat data[4]);
     78    VGRect(const FloatRect&);
     79    const VGfloat* toVGfloat() const { return m_data; }
     80    operator FloatRect() const;
     81private:
     82    VGfloat m_data[4];
     83};
     84
     85}
     86
    5987#endif
  • trunk/WebCore/platform/graphics/transforms/TransformationMatrix.h

    r53949 r54063  
    3636#elif PLATFORM(CAIRO)
    3737#include <cairo.h>
     38#elif PLATFORM(OPENVG)
     39#include "VGUtils.h"
    3840#elif PLATFORM(QT)
    3941#include <QTransform>
     
    308310#elif PLATFORM(CAIRO)
    309311    operator cairo_matrix_t() const;
     312#elif PLATFORM(OPENVG)
     313    operator VGMatrix() const;
    310314#elif PLATFORM(QT)
    311315    operator QTransform() const;
Note: See TracChangeset for help on using the changeset viewer.