VirtualBox

Changeset 57502 in vbox


Ignore:
Timestamp:
Aug 23, 2015 5:29:15 PM (9 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA*: Some viewport sanity adjustments and comments.

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r57358 r57502  
    544544    Log(("vmsvgaPortSetViewPort: screen %d (%d,%d)(%d,%d)\n", uScreenId, x, y, cx, cy));
    545545
    546     pThis->svga.viewport.x  = x;
    547     pThis->svga.viewport.y  = y;
    548     pThis->svga.viewport.cx = RT_MIN(cx, (uint32_t)pThis->svga.uWidth);
    549     pThis->svga.viewport.cy = RT_MIN(cy, (uint32_t)pThis->svga.uHeight);
    550     return;
     546    if (x < pThis->svga.uWidth)
     547    {
     548        pThis->svga.viewport.x  = x;
     549        pThis->svga.viewport.cx = RT_MIN(cx, pThis->svga.uWidth - x);
     550    }
     551    else
     552    {
     553        pThis->svga.viewport.x  = pThis->svga.uWidth;
     554        pThis->svga.viewport.cx = 0;
     555    }
     556    if (y < pThis->svga.uHeight)
     557    {
     558        pThis->svga.viewport.y  = y;
     559        pThis->svga.viewport.cy = RT_MIN(cy, pThis->svga.uHeight - y);
     560    }
     561    else
     562    {
     563        pThis->svga.viewport.y  = pThis->svga.uHeight;
     564        pThis->svga.viewport.cy = 0;
     565    }
    551566}
    552567
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r57358 r57502  
    26572657        || pSurface->pMipmapLevels[0].size.height != pThis->svga.uHeight)
    26582658    {
    2659         float xMultiplier = (float)pSurface->pMipmapLevels[0].size.width / (float)pThis->svga.uWidth;
     2659        float xMultiplier = (float)pSurface->pMipmapLevels[0].size.width  / (float)pThis->svga.uWidth;
    26602660        float yMultiplier = (float)pSurface->pMipmapLevels[0].size.height / (float)pThis->svga.uHeight;
    26612661
     
    29412941
    29422942#endif
    2943 #ifndef RT_OS_DARWIN /* darwin: later */
     2943#ifndef RT_OS_DARWIN /* darwin: postponed till after buffer swap. */
    29442944    /* Reset the frame buffer association - see below.  */
    29452945    VMSVGA3D_ASSERT_GL_CALL(pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, pContext->idFramebuffer), pState, pContext);
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r57410 r57502  
    309309    /** Maximum height supported. */
    310310    uint32_t                    u32MaxHeight;
    311     /** Viewport rectangle */
     311    /** Viewport rectangle, i.e. what's currently visible of the target host
     312     *  window.  This is usually (0,0)(uWidth,uHeight), but if the window is
     313     *  shrunk and scrolling applied, both the origin and size may differ.  */
    312314    struct
    313315    {
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