Changeset 6683 in vbox
- Timestamp:
- Jan 31, 2008 7:58:39 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp
r6649 r6683 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VBox frontends: Qt GUI ("VirtualBox"): 4 * Quartz2D framebuffer implementation 3 * Qt GUI (aka VirtualBox) - Quartz2D framebuffer implementation. 5 4 */ 6 5 … … 78 77 return E_POINTER; 79 78 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). */ 80 85 RTMemFree (mRegionRects); 81 86 mRegionCount = 0; 82 mRegionRects = static_cast <CGRect*>(RTMemAlloc (sizeof (CGRect) * aCount));87 mRegionRects = static_cast <CGRect*> (RTMemAlloc (sizeof (CGRect) * aCount)); 83 88 84 89 QRegion reg; … … 171 176 172 177 /* Create the context to draw on */ 173 WindowPtr window = static_cast <WindowPtr>(mView->viewport()->handle());178 WindowPtr window = static_cast <WindowPtr> (mView->viewport()->handle()); 174 179 SetPortWindowPort (window); 175 180 CGContextRef ctx; 176 181 QDBeginCGContext (GetWindowPort (window), &ctx); 177 182 /* We handle the seamless mode as a special case. */ 178 if (static_cast <VBoxConsoleWnd*>(pMain)->isTrueSeamless())183 if (static_cast <VBoxConsoleWnd*> (pMain)->isTrueSeamless()) 179 184 { 180 185 /* Here we paint the windows without any wallpaper. … … 210 215 /* At this point draw the real vm image */ 211 216 CGContextDrawImage (ctx, QRectToCGRect (Q2DViewRect), subImage); 212 }else 217 } 218 else 213 219 { 214 220 /* Here we paint if we didn't care about any masks */ … … 223 229 /* Ok, for more performance we set a clipping path of the 224 230 * regions given by this paint event. */ 225 QMemArray <QRect> a = pe->region().rects();231 QMemArray <QRect> a = pe->region().rects(); 226 232 if (a.size() > 0) 227 233 { … … 278 284 * Mac OS X supports 16 bit also but not in the 565 mode. So we could use 279 285 * 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) 282 288 { 283 289 // printf ("VRAM\n"); … … 302 308 kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little, dp, 0, false, 303 309 kCGRenderingIntentDefault); 304 mDataAddress = static_cast <uchar*>(mBitmapData);310 mDataAddress = static_cast <uchar*> (mBitmapData); 305 311 CGDataProviderRelease (dp); 306 312 }
Note:
See TracChangeset
for help on using the changeset viewer.