VirtualBox

Changeset 6683 in vbox


Ignore:
Timestamp:
Jan 31, 2008 7:58:39 PM (17 years ago)
Author:
vboxsync
Message:

r=bird: see @todo. spaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp

    r6649 r6683  
     1/* $Id$ */
    12/** @file
    2  *
    3  * VBox frontends: Qt GUI ("VirtualBox"):
    4  * Quartz2D framebuffer implementation
     3 * Qt GUI (aka VirtualBox) - Quartz2D framebuffer implementation.
    54 */
    65
     
    7877        return E_POINTER;
    7978
     79    /** @todo r=bird: Is this thread safe? If I remember the code flow correctly, the
     80     * GUI thread could be happily jogging along paintEvent now on another cpu core.
     81     * This function is called on the EMT (emulation thread). Which means, blocking
     82     * execution waiting for a lock is out of the question. A quick solution using
     83     * ASMAtomic(Cmp)XchgPtr and a struct { cAllocated; cRects; aRects[1]; }
     84     * *mRegion, *mUnusedRegion; should suffice (and permit you to reuse allocations). */
    8085    RTMemFree (mRegionRects);
    8186    mRegionCount = 0;
    82     mRegionRects = static_cast<CGRect*>(RTMemAlloc (sizeof (CGRect) * aCount));
     87    mRegionRects = static_cast <CGRect*> (RTMemAlloc (sizeof (CGRect) * aCount));
    8388
    8489    QRegion reg;
     
    171176
    172177    /* Create the context to draw on */
    173     WindowPtr window = static_cast<WindowPtr>(mView->viewport()->handle());
     178    WindowPtr window = static_cast <WindowPtr> (mView->viewport()->handle());
    174179    SetPortWindowPort (window);
    175180    CGContextRef ctx;
    176181    QDBeginCGContext (GetWindowPort (window), &ctx);
    177182    /* We handle the seamless mode as a special case. */
    178     if (static_cast<VBoxConsoleWnd*>(pMain)->isTrueSeamless())
     183    if (static_cast <VBoxConsoleWnd*> (pMain)->isTrueSeamless())
    179184    {
    180185        /* Here we paint the windows without any wallpaper.
     
    210215        /* At this point draw the real vm image */
    211216        CGContextDrawImage (ctx, QRectToCGRect (Q2DViewRect), subImage);
    212     }else
     217    }
     218    else
    213219    {
    214220        /* Here we paint if we didn't care about any masks */
     
    223229        /* Ok, for more performance we set a clipping path of the
    224230         * regions given by this paint event. */
    225         QMemArray<QRect> a = pe->region().rects();
     231        QMemArray <QRect> a = pe->region().rects();
    226232        if (a.size() > 0)
    227233        {
     
    278284     * Mac OS X supports 16 bit also but not in the 565 mode. So we could use
    279285     * 32 bit only. */
    280     if (re->pixelFormat() == FramebufferPixelFormat_FOURCC_RGB &&
    281         re->bitsPerPixel() == 32)
     286    if (   re->pixelFormat() == FramebufferPixelFormat_FOURCC_RGB
     287        && re->bitsPerPixel() == 32)
    282288    {
    283289//        printf ("VRAM\n");
     
    302308                               kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little, dp, 0, false,
    303309                               kCGRenderingIntentDefault);
    304         mDataAddress = static_cast<uchar*>(mBitmapData);
     310        mDataAddress = static_cast <uchar*> (mBitmapData);
    305311        CGDataProviderRelease (dp);
    306312    }
Note: See TracChangeset for help on using the changeset viewer.

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