VirtualBox

Ignore:
Timestamp:
Jan 31, 2008 10:02:59 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27711
Message:

Mac OS X: Added Quartz2D framebuffer implementation.
This fixes the outstanding seamless issues also. Added commandline switch
"-rmode quartz2d" to VirtualBox. As from now the Quartz2D framebuffer
is the default painting engine on Mac OS X.

Location:
trunk/src/VBox/Frontends/VirtualBox/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h

    r5999 r6645  
    115115    enum RenderMode
    116116    {
    117         InvalidRenderMode, TimerMode, QImageMode, SDLMode, DDRAWMode
     117        InvalidRenderMode, TimerMode, QImageMode, SDLMode, DDRAWMode, Quartz2DMode
    118118    };
    119119
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r5999 r6645  
    459459#endif
    460460
     461/////////////////////////////////////////////////////////////////////////////
     462
     463#if defined(Q_WS_MAC) && defined (VBOX_GUI_USE_QUARTZ2D)
     464
     465#include <Carbon/Carbon.h>
     466class VBoxQuartz2DFrameBuffer : public VBoxFrameBuffer
     467{
     468public:
     469
     470    VBoxQuartz2DFrameBuffer (VBoxConsoleView *aView);
     471    virtual ~VBoxQuartz2DFrameBuffer ();
     472
     473    STDMETHOD (NotifyUpdate) (ULONG aX, ULONG aY,
     474                              ULONG aW, ULONG aH,
     475                              BOOL *aFinished);
     476    STDMETHOD (SetVisibleRegion) (BYTE *aRectangles, ULONG aCount);
     477
     478    uchar *address () { return mDataAddress; }
     479    ulong bitsPerPixel () { return CGImageGetBitsPerPixel (mImage); }
     480    ulong bytesPerLine () { return CGImageGetBytesPerRow (mImage); }
     481    ulong pixelFormat () { return mPixelFormat; };
     482    bool usesGuestVRAM () { return mBitmapData == NULL; }
     483
     484    const CGImageRef imageRef () const { return mImage; }
     485
     486    void paintEvent (QPaintEvent *pe);
     487    void resizeEvent (VBoxResizeEvent *re);
     488
     489private:
     490    inline CGRect QRectToCGRect (const QRect &aRect) const
     491    {
     492        return CGRectMake (aRect.x (), aRect.y (), aRect.width (), aRect.height ());
     493    }
     494    inline QRect mapYOrigin (const QRect &aRect, int aHeight) const
     495    {
     496        /* The cgcontext has a fliped y-coord relative to the
     497         * qt coord system. So we need some mapping here */
     498        return QRect (aRect.x (), aHeight - (aRect.y () + aRect.height ()), aRect.width (), aRect.height ());
     499    }
     500    void clean ();
     501
     502    uchar *mDataAddress;
     503    void *mBitmapData;
     504    ulong mPixelFormat;
     505    CGImageRef mImage;
     506    CGRect *mRegionRects;
     507    ULONG mRegionCount;
     508};
     509
     510#endif
     511
    461512#endif // __VBoxFrameBuffer_h__
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils.h

    r6482 r6645  
    255255CGImageRef DarwinQPixmapFromMimeSourceToCGImage (const char *aSource);
    256256CGImageRef DarwinCreateDockBadge (const char *aSource);
     257CGImageRef DarwinCreateDockPreview (CGImageRef aVMImage, CGImageRef aOverlayImage);
    257258CGImageRef DarwinCreateDockPreview (VBoxFrameBuffer *aFrameBuffer, CGImageRef aOverlayImage);
    258259OSStatus DarwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette