- Timestamp:
- Jul 13, 2007 1:02:30 PM (18 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBDDRAW.cpp
r2981 r3611 138 138 mSurface (NULL), 139 139 mPrimarySurface (NULL), 140 mPixelFormat (FramebufferPixelFormat_PixelFormat Default),140 mPixelFormat (FramebufferPixelFormat_PixelFormatOpaque), 141 141 mGuestVRAMSurface (FALSE), 142 142 mWndX (0), … … 166 166 167 167 VBoxResizeEvent *re = 168 new VBoxResizeEvent (FramebufferPixelFormat_PixelFormat Default,168 new VBoxResizeEvent (FramebufferPixelFormat_PixelFormatOpaque, 169 169 NULL, 0, 640, 480); 170 170 … … 295 295 { 296 296 /* Unsupported format leads to use of the default format. */ 297 pixelFormat = FramebufferPixelFormat_PixelFormat Default;297 pixelFormat = FramebufferPixelFormat_PixelFormatOpaque; 298 298 } 299 299 } … … 301 301 recreateSurface (pixelFormat, pvVRAM, lineSize, w, h); 302 302 303 if (!mSurface && pixelFormat != FramebufferPixelFormat_PixelFormat Default)303 if (!mSurface && pixelFormat != FramebufferPixelFormat_PixelFormatOpaque) 304 304 { 305 305 /* Unable to create a new surface. Try to create a default format surface. */ 306 pixelFormat = FramebufferPixelFormat_PixelFormat Default;306 pixelFormat = FramebufferPixelFormat_PixelFormatOpaque; 307 307 recreateSurface (pixelFormat, NULL, 0, w, h); 308 308 } … … 334 334 sd.dwHeight = h; 335 335 336 if (pixelFormat == FramebufferPixelFormat_PixelFormat Default)336 if (pixelFormat == FramebufferPixelFormat_PixelFormatOpaque) 337 337 { 338 338 /* Default format is a 32 bpp surface. */ … … 351 351 switch (pixelFormat) 352 352 { 353 case FramebufferPixelFormat_PixelFormat Default:353 case FramebufferPixelFormat_PixelFormatOpaque: 354 354 case FramebufferPixelFormat_PixelFormatRGB32: 355 355 { … … 378 378 379 379 /* Allocate surface memory. */ 380 if (pvVRAM != NULL && pixelFormat != FramebufferPixelFormat_PixelFormat Default)380 if (pvVRAM != NULL && pixelFormat != FramebufferPixelFormat_PixelFormatOpaque) 381 381 { 382 382 sd.lpSurface = pvVRAM; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp
r3578 r3611 305 305 VBoxFrameBuffer (aView) 306 306 { 307 resizeEvent (new VBoxResizeEvent (FramebufferPixelFormat_PixelFormat Default,307 resizeEvent (new VBoxResizeEvent (FramebufferPixelFormat_PixelFormatOpaque, 308 308 NULL, 0, 640, 480)); 309 309 } … … 399 399 { 400 400 mScreen = NULL; 401 mPixelFormat = FramebufferPixelFormat_PixelFormat Default;401 mPixelFormat = FramebufferPixelFormat_PixelFormatOpaque; 402 402 mPtrVRAM = NULL; 403 403 mSurfVRAM = NULL; 404 404 mLineSize = 0; 405 405 406 resizeEvent (new VBoxResizeEvent (FramebufferPixelFormat_PixelFormat Default,406 resizeEvent (new VBoxResizeEvent (FramebufferPixelFormat_PixelFormatOpaque, 407 407 NULL, 0, 640, 480)); 408 408 } … … 536 536 { 537 537 /* Unsupported format leads to use of the default format. */ 538 mPixelFormat = FramebufferPixelFormat_PixelFormat Default;538 mPixelFormat = FramebufferPixelFormat_PixelFormatOpaque; 539 539 } 540 540 } 541 541 542 if (mPixelFormat != FramebufferPixelFormat_PixelFormat Default)542 if (mPixelFormat != FramebufferPixelFormat_PixelFormatOpaque) 543 543 { 544 544 /* Create a source surface from guest VRAM. */ -
trunk/src/VBox/Main/DisplayImpl.cpp
r3576 r3611 277 277 case 24: pixelFormat = FramebufferPixelFormat_PixelFormatRGB24; break; 278 278 case 16: pixelFormat = FramebufferPixelFormat_PixelFormatRGB16; break; 279 default: pixelFormat = FramebufferPixelFormat_PixelFormat Default; cbLine = 0;279 default: pixelFormat = FramebufferPixelFormat_PixelFormatOpaque; cbLine = 0; 280 280 } 281 281 … … 345 345 pFBInfo->pFramebuffer->COMGETTER(PixelFormat) (&newPixelFormat); 346 346 347 pFBInfo->fDefaultFormat = (newPixelFormat == FramebufferPixelFormat_PixelFormat Default);347 pFBInfo->fDefaultFormat = (newPixelFormat == FramebufferPixelFormat_PixelFormatOpaque); 348 348 349 349 mpDrv->pUpPort->pfnSetRenderVRAM (mpDrv->pUpPort, pFBInfo->fDefaultFormat); -
trunk/src/VBox/Main/FramebufferImpl.cpp
r3578 r3611 101 101 if (!pixelFormat) 102 102 return E_POINTER; 103 *pixelFormat = FramebufferPixelFormat_PixelFormat Default;103 *pixelFormat = FramebufferPixelFormat_PixelFormatOpaque; 104 104 return S_OK; 105 105 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r3599 r3611 6123 6123 <enum 6124 6124 name="FramebufferPixelFormat" 6125 uuid=" 0389bf8d-3b41-476c-94be-53f5c84be9b5"6125 uuid="3bd87520-2b5f-4786-a891-f8c6aeb19a1f" 6126 6126 > 6127 <const name="PixelFormatDefault" value="0"/> 6127 <desc> 6128 Format of the virtual video card's memory buffer. See 6129 <link to="IFramebuffer::requestResize()"/> for more information. 6130 </desc> 6131 <const name="PixelFormatOpaque" value="0"/> 6128 6132 <const name="PixelFormatRGB16" value="1"/> 6129 6133 <const name="PixelFormatRGB24" value="2"/> … … 6188 6192 <desc> 6189 6193 Locks the framebuffer. 6190 Gets called by the display object where thisbuffer is6191 registered.6194 Gets called by the IDisplay object where this framebuffer is 6195 bound to. 6192 6196 </desc> 6193 6197 </method> … … 6196 6200 <desc> 6197 6201 Unlocks the framebuffer. 6198 Gets called by the display object where thisbuffer is6199 registered.6202 Gets called by the IDisplay object where this framebuffer is 6203 bound to. 6200 6204 </desc> 6201 6205 </method> … … 6218 6222 Requests a size and pixel format change. 6219 6223 6220 The IFramebuffer implementation should try to setup 6221 a memory buffer suitable for the given pixel format 6222 and line size. 6223 6224 If the requested pixel format is not supported, 6225 or a PixelFormatDefault is requested, 6226 a default format is set. 6227 6228 The callee is allowed to use the guest video memory 6229 buffer (pointed to by the @a vram parameter) directly instead 6230 of allocating its own buffer. To indicate that the framebuffer 6231 uses the guest video memory, its <link to="#address"/> 6232 implementation must return the same address as it gets in 6233 the @a vram parameter of this method. 6234 6235 For non linear modes (such as text and standard VGA), the @a 6236 vram parameter is @c NULL and must not be used. When it's not 6237 NULL, it is recommended to use it to access the guest video 6238 memory instead of creating a separate buffer as it will at 6239 least remove one copy operation. 6240 6241 The caller checks if the call was successful 6242 via the <link to="#pixelFormat"/> property. 6243 6244 <note> 6245 This method is called by IDisplay under the IFramebuffer 6246 lock. 6224 There are two strategies of working with the video buffer of the 6225 virtual machine. The first strategy implies that the IFramebuffer 6226 implementation allocates a memory buffer for the requested display mode 6227 and provides it to the virtual machine. In the second strategy, the 6228 IFramebuffer implementation uses the memory buffer allocated and owned 6229 by the virtual machine. The second strategy is usually faster because 6230 the implementation gets a pointer to the virtual machine video card's 6231 memory which it can directly use for visualising the contents of the 6232 virtual display, as opposed to the first strategy where the video 6233 card's memory contents are copied to the memory buffer provided by the 6234 implementation every time a display update occurs. 6235 6236 It is important to note that the second strategy is really fast only 6237 when the implementation uses the provided video buffer directly, for 6238 example, by blitting it to the window representing the virtual 6239 machine's display, which saves at least one copy operation comparing 6240 to the first strategy. However, using the video card's memory directly 6241 is not always possible: for example, the format and the color depth of 6242 the window representing the virtual display may differ from the format 6243 or the color depth of the virtual video buffer, or the format of the 6244 latter may be unknown or unsupported. In this case, the first strategy 6245 (that is always available) is used as a fallback: when the virtual 6246 video card's memory contents are copied to the implementation-provided 6247 memory buffer, color and format conversion is done authomatically by 6248 the underlying code. 6249 6250 The @a pixelFormat and @a VRAM parameters define whether the second 6251 strategy is available or not. If @a pixelFormat is 6252 <link to="PixelFormat::PixelFormatOpaque"/> (which usually indicates a 6253 text mode of the virtual display) or if @a VRAM is <tt>null</tt> 6254 (which means a non-linear graphical mode), then direct access to the 6255 virtual card's video memory buffer is not available, the @a VRAM 6256 parameter must be ignored and the implementation must use the first 6257 strategy. In all other cases, @a pixelFormat together with @a lineSize 6258 define the format of the video memory buffer pointed to by the @a VRAM 6259 parameter and the implementation is free to choose which strategy to 6260 use. To indicate that this framebuffer uses the second strategy, its 6261 implementation of the <link to="#address()"/> method must return the 6262 same address as it gets in the @a VRAM parameter of this method; 6263 otherwise it is assumed that the first strategy is chosen. 6264 6265 The @a width and @a height parameters represent the size of the 6266 requested display mode in both cases. In case of the first strategy, 6267 the provided memory buffer should be enough to store data of the given 6268 display mode. In case of the second strategy, it is guaranteed that 6269 the given @a VRAM buffer contains enough space to represent the 6270 display mode of the given size. Note that this framebuffer's 6271 <link to="#width()"/> and <link to="#height()"/> properties must 6272 return exactly the same values as passed to this method after the 6273 resize is completed (see below). 6274 6275 The @a finished output parameter determines if the implementation has 6276 finished resizing the framebuffer or not. If, for some reason, the 6277 resize cannot be finished immediately during this call, @a finished 6278 must be set to @c false, and the implementation must call 6279 <link to="IDisplay::resizeCompleted()"/> after it has returned from 6280 this method as soon as possible. If @a finished is @c false, the 6281 machine will not call any framebuffer methods until 6282 <link to="IDisplay::resizeCompleted()"/> is called. 6283 6284 Note that if the second strategy is choosen, the 6285 <link to="#colorDepth()"/>, <link to="#lineSize()"/> and 6286 <link to="#pixelFormat()"/> properties of this framebuffer must return 6287 exactly the same values as specified in the parameters of this method 6288 after the resize is completed. In case of the first strategy these 6289 properties must return values describing the format of the 6290 implementation's own memory buffer <link to="#address()"/> points 6291 to. Note also that the <link to="#colorDepth()"/> value must always 6292 correlate with <link to="#pixelFormat()"/> when the latter returns any 6293 value other than <link to="PixelFormat::PixelFormatOpaque"/>. 6294 6295 <note> 6296 This method is called by the IDisplay object under the 6297 <link to="#lock()"/> provided by this IFramebuffer 6298 implementation. If this method returns @c false in @a finished, then 6299 this lock is not released until 6300 <link to="IDisplay::resizeCompleted()"/> is called. 6247 6301 </note> 6248 6302 </desc> 6249 6303 <param name="screenId" type="unsigned long" dir="in"> 6250 <desc>The value to be used in the <link to="IDisplay::resizeCompleted()"/> call.</desc> 6304 <desc> 6305 Logical screen number. Must be used in the corresponding call to 6306 <link to="IDisplay::resizeCompleted()"/> if this call is made. 6307 </desc> 6251 6308 </param> 6252 6309 <param name="pixelFormat" type="FramebufferPixelFormat" dir="in"> 6253 <desc>Pixel format of the surface (BPP and layout)</desc>6254 </param> 6255 <param name=" vram" type="octet" mod="ptr" dir="in">6256 <desc>Pointer to the guest VRAM (NULL for non linear modes)</desc>6310 <desc>Pixel format of the memory buffer pointed to by @a VRAM.</desc> 6311 </param> 6312 <param name="VRAM" type="octet" mod="ptr" dir="in"> 6313 <desc>Pointer to the virtual video card's VRAM (may be @c null).</desc> 6257 6314 </param> 6258 6315 <param name="lineSize" type="unsigned long" dir="in">
Note:
See TracChangeset
for help on using the changeset viewer.