VirtualBox

Changeset 66394 in vbox


Ignore:
Timestamp:
Apr 3, 2017 7:31:44 AM (8 years ago)
Author:
vboxsync
Message:

Main: remove the old resizing code.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r66329 r66394  
    3434#include "DisplaySourceBitmapWrap.h"
    3535
    36 #define NEW_RESIZE
    37 
    3836class Console;
    3937struct VIDEORECCONTEXT;
     
    158156
    159157    // public methods only for internal purposes
    160 #ifndef NEW_RESIZE
    161     int  i_handleDisplayResize(unsigned uScreenId, uint32_t bpp, void *pvVRAM, uint32_t cbLine,
    162                                uint32_t w, uint32_t h, uint16_t flags);
    163 #else
    164158    int i_handleDisplayResize(unsigned uScreenId, uint32_t bpp, void *pvVRAM,
    165159                              uint32_t cbLine, uint32_t w, uint32_t h, uint16_t flags,
    166160                              uint32_t xOrigin, uint32_t yOrigin, bool fVGAResize);
    167 #endif
    168161    void i_handleDisplayUpdate(unsigned uScreenId, int x, int y, int w, int h);
    169162    void i_handleUpdateVMMDevSupportsGraphics(bool fSupportsGraphics);
     
    310303                                 BitmapFormat_T aBitmapFormat,
    311304                                 ULONG *pcbOut);
    312 #ifdef NEW_RESIZE
    313305    int processVBVAResize(PCVBVAINFOVIEW pView, PCVBVAINFOSCREEN pScreen, void *pvVRAM, bool fResetInputMapping);
    314 #endif
    315306
    316307#ifdef VBOX_WITH_CRHGSMI
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r66330 r66394  
    889889}
    890890
    891 #ifndef NEW_RESIZE
    892 /**
    893  *  Handles display resize event.
    894  *
    895  * @param uScreenId Screen ID
    896  * @param bpp       New bits per pixel.
    897  * @param pvVRAM    VRAM pointer.
    898  * @param cbLine    New bytes per line.
    899  * @param w         New display width.
    900  * @param h         New display height.
    901  * @param flags     Flags of the new video mode.
    902  *
    903  * @thread EMT
    904  */
    905 int Display::i_handleDisplayResize(unsigned uScreenId, uint32_t bpp, void *pvVRAM,
    906                                    uint32_t cbLine, uint32_t w, uint32_t h, uint16_t flags)
    907 #else
    908891/**
    909892 *  Handles display resize event.
     
    923906                                   uint32_t cbLine, uint32_t w, uint32_t h, uint16_t flags,
    924907                                   uint32_t xOrigin, uint32_t yOrigin, bool fVGAResize)
    925 #endif
    926908{
    927909    LogRel(("Display::handleDisplayResize: uScreenId=%d pvVRAM=%p w=%d h=%d bpp=%d cbLine=0x%X flags=0x%X\n", uScreenId,
    928910            pvVRAM, w, h, bpp, cbLine, flags));
    929 
    930 #ifndef NEW_RESIZE
    931     if (uScreenId >= mcMonitors)
    932         return VINF_SUCCESS;
    933 
    934     DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];
    935 
    936     /* Reset the update mode. */
    937     pFBInfo->updateImage.pSourceBitmap.setNull();
    938     pFBInfo->updateImage.pu8Address = NULL;
    939     pFBInfo->updateImage.cbLine = 0;
    940 
    941     if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
    942     {
    943         pFBInfo->w = w;
    944         pFBInfo->h = h;
    945 
    946         pFBInfo->u16BitsPerPixel = (uint16_t)bpp;
    947         pFBInfo->pu8FramebufferVRAM = (uint8_t *)pvVRAM;
    948         pFBInfo->u32LineSize = cbLine;
    949         pFBInfo->flags = flags;
    950     }
    951 
    952     /* Guest screen image will be invalid during resize, make sure that it is not updated. */
    953     if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
    954     {
    955         if (mpDrv)
    956         {
    957             mpDrv->pUpPort->pfnSetRenderVRAM(mpDrv->pUpPort, false);
    958 
    959             mpDrv->IConnector.pbData     = NULL;
    960             mpDrv->IConnector.cbScanline = 0;
    961             mpDrv->IConnector.cBits      = 32; /* DevVGA does not work with cBits == 0. */
    962             mpDrv->IConnector.cx         = 0;
    963             mpDrv->IConnector.cy         = 0;
    964         }
    965     }
    966 
    967     maFramebuffers[uScreenId].pSourceBitmap.setNull();
    968 
    969     if (!maFramebuffers[uScreenId].pFramebuffer.isNull())
    970     {
    971         HRESULT hr = maFramebuffers[uScreenId].pFramebuffer->NotifyChange(uScreenId, 0, 0, w, h); /** @todo origin */
    972         LogFunc(("NotifyChange hr %08X\n", hr));
    973         NOREF(hr);
    974     }
    975 
    976     bool fUpdateImage = RT_BOOL(pFBInfo->u32Caps & FramebufferCapabilities_UpdateImage);
    977     if (fUpdateImage && !pFBInfo->pFramebuffer.isNull())
    978     {
    979         ComPtr<IDisplaySourceBitmap> pSourceBitmap;
    980         HRESULT hr = QuerySourceBitmap(uScreenId, pSourceBitmap.asOutParam());
    981         if (SUCCEEDED(hr))
    982         {
    983             BYTE *pAddress = NULL;
    984             ULONG ulWidth = 0;
    985             ULONG ulHeight = 0;
    986             ULONG ulBitsPerPixel = 0;
    987             ULONG ulBytesPerLine = 0;
    988             BitmapFormat_T bitmapFormat = BitmapFormat_Opaque;
    989 
    990             hr = pSourceBitmap->QueryBitmapInfo(&pAddress,
    991                                                 &ulWidth,
    992                                                 &ulHeight,
    993                                                 &ulBitsPerPixel,
    994                                                 &ulBytesPerLine,
    995                                                 &bitmapFormat);
    996             if (SUCCEEDED(hr))
    997             {
    998                 pFBInfo->updateImage.pSourceBitmap = pSourceBitmap;
    999                 pFBInfo->updateImage.pu8Address = pAddress;
    1000                 pFBInfo->updateImage.cbLine = ulBytesPerLine;
    1001             }
    1002         }
    1003     }
    1004 
    1005     /* Inform the VRDP server about the change of display parameters. */
    1006     LogRelFlowFunc(("Calling VRDP\n"));
    1007     mParent->i_consoleVRDPServer()->SendResize();
    1008 
    1009     /* And re-send the seamless rectangles if necessary. */
    1010     if (mfSeamlessEnabled)
    1011         i_handleSetVisibleRegion(mcRectVisibleRegion, mpRectVisibleRegion);
    1012 
    1013 #ifdef VBOX_WITH_VIDEOREC
    1014     videoCaptureScreenChanged(uScreenId);
    1015 #endif
    1016 
    1017 #else /* NEW_RESIZE */
    1018911
    1019912    /* Caller must not hold the object lock. */
     
    1087980#endif
    1088981
    1089 #endif /* NEW_RESIZE */
    1090 
    1091982    LogRelFlowFunc(("[%d]: default format %d\n", uScreenId, pFBInfo->fDefaultFormat));
    1092983
     
    11491040        return; */
    11501041
    1151 #ifndef NEW_RESIZE
    1152     i_checkCoordBounds(&x, &y, &w, &h, maFramebuffers[uScreenId].w,
    1153                                        maFramebuffers[uScreenId].h);
    1154 
    1155     IFramebuffer *pFramebuffer = maFramebuffers[uScreenId].pFramebuffer;
    1156     if (pFramebuffer != NULL)
    1157     {
    1158         if (w != 0 && h != 0)
    1159         {
    1160             bool fUpdateImage = RT_BOOL(maFramebuffers[uScreenId].u32Caps & FramebufferCapabilities_UpdateImage);
    1161             if (RT_LIKELY(!fUpdateImage))
    1162             {
    1163                 pFramebuffer->NotifyUpdate(x, y, w, h);
    1164             }
    1165             else
    1166             {
    1167                 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1168 
    1169                 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];
    1170 
    1171                 if (!pFBInfo->updateImage.pSourceBitmap.isNull())
    1172                 {
    1173                     Assert(pFBInfo->updateImage.pu8Address);
    1174 
    1175                     size_t cbData = w * h * 4;
    1176                     com::SafeArray<BYTE> image(cbData);
    1177 
    1178                     uint8_t *pu8Dst = image.raw();
    1179                     const uint8_t *pu8Src = pFBInfo->updateImage.pu8Address + pFBInfo->updateImage.cbLine * y + x * 4;
    1180 
    1181                     int i;
    1182                     for (i = y; i < y + h; ++i)
    1183                     {
    1184                         memcpy(pu8Dst, pu8Src, w * 4);
    1185                         pu8Dst += w * 4;
    1186                         pu8Src += pFBInfo->updateImage.cbLine;
    1187                     }
    1188 
    1189                     pFramebuffer->NotifyUpdateImage(x, y, w, h, ComSafeArrayAsInParam(image));
    1190                 }
    1191             }
    1192         }
    1193     }
    1194 #else /* NEW_RESIZE */
    11951042    DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];
    11961043    AutoReadLock alockr(this COMMA_LOCKVAL_SRC_POS);
     
    12951142        }
    12961143    }
    1297 #endif /* NEW_RESIZE */
    12981144
    12991145#ifndef VBOX_WITH_HGSMI
     
    17821628        if (!pFBInfo->fDisabled)
    17831629        {
    1784 #ifndef NEW_RESIZE
    1785             i_handleDisplayResize(uScreenId, 32,
    1786                                   pFBInfo->pu8FramebufferVRAM,
    1787                                   pFBInfo->u32LineSize,
    1788                                   pFBInfo->w,
    1789                                   pFBInfo->h,
    1790                                   pFBInfo->flags);
    1791 #else
    17921630            i_handleDisplayResize(uScreenId, 32,
    17931631                                  pFBInfo->pu8FramebufferVRAM,
     
    17991637                                  pFBInfo->yOrigin,
    18001638                                  false);
    1801 #endif
    18021639        }
    18031640    }
     
    18731710    if (mpDrv)
    18741711    {
    1875 #ifndef NEW_RESIZE
    1876         /* Setup the new framebuffer. */
    1877         i_handleDisplayResize(aScreenId, pFBInfo->u16BitsPerPixel,
    1878                               pFBInfo->pu8FramebufferVRAM,
    1879                               pFBInfo->u32LineSize,
    1880                               pFBInfo->w,
    1881                               pFBInfo->h,
    1882                               pFBInfo->flags);
    1883 #else
    18841712        /* Inform the framebuffer about the actual screen size. */
    18851713        HRESULT hr = aFramebuffer->NotifyChange(aScreenId, 0, 0, pFBInfo->w, pFBInfo->h); /** @todo origin */
     
    18891717        if (mfSeamlessEnabled)
    18901718            i_handleSetVisibleRegion(mcRectVisibleRegion, mpRectVisibleRegion);
    1891 #endif
    18921719    }
    18931720
     
    30762903    if (pFBInfo->pSourceBitmap.isNull())
    30772904    {
    3078 #ifndef NEW_RESIZE
    30792905        /* Create a new object. */
    30802906        ComObjPtr<DisplaySourceBitmap> obj;
     
    30852911        if (SUCCEEDED(hr))
    30862912        {
    3087             bool fDefaultFormat = !obj->i_usesVRAM();
     2913            pFBInfo->pSourceBitmap = obj;
     2914            pFBInfo->fDefaultFormat = !obj->i_usesVRAM();
    30882915
    30892916            if (aScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     
    30972924                BitmapFormat_T bitmapFormat = BitmapFormat_Opaque;
    30982925
    3099                 obj->QueryBitmapInfo(&pAddress,
    3100                                      &ulWidth,
    3101                                      &ulHeight,
    3102                                      &ulBitsPerPixel,
    3103                                      &ulBytesPerLine,
    3104                                      &bitmapFormat);
    3105 
    3106                 mpDrv->IConnector.pbData     = pAddress;
    3107                 mpDrv->IConnector.cbScanline = ulBytesPerLine;
    3108                 mpDrv->IConnector.cBits      = ulBitsPerPixel;
    3109                 mpDrv->IConnector.cx         = ulWidth;
    3110                 mpDrv->IConnector.cy         = ulHeight;
    3111 
    3112                 fSetRenderVRAM = fDefaultFormat;
    3113             }
    3114 
    3115             /* Make sure that the bitmap contains the latest image. */
    3116             fInvalidate = fDefaultFormat;
    3117 
    3118             pFBInfo->pSourceBitmap = obj;
    3119             pFBInfo->fDefaultFormat = fDefaultFormat;
    3120         }
    3121 #else /* NEW_RESIZE */
    3122         /* Create a new object. */
    3123         ComObjPtr<DisplaySourceBitmap> obj;
    3124         hr = obj.createObject();
    3125         if (SUCCEEDED(hr))
    3126             hr = obj->init(this, aScreenId, pFBInfo);
    3127 
    3128         if (SUCCEEDED(hr))
    3129         {
    3130             pFBInfo->pSourceBitmap = obj;
    3131             pFBInfo->fDefaultFormat = !obj->i_usesVRAM();
    3132 
    3133             if (aScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
    3134             {
    3135                 /* Start buffer updates. */
    3136                 BYTE *pAddress = NULL;
    3137                 ULONG ulWidth = 0;
    3138                 ULONG ulHeight = 0;
    3139                 ULONG ulBitsPerPixel = 0;
    3140                 ULONG ulBytesPerLine = 0;
    3141                 BitmapFormat_T bitmapFormat = BitmapFormat_Opaque;
    3142 
    31432926                pFBInfo->pSourceBitmap->QueryBitmapInfo(&pAddress,
    31442927                                                        &ulWidth,
     
    31602943            fInvalidate = pFBInfo->fDefaultFormat;
    31612944        }
    3162 #endif /* NEW_RESIZE */
    31632945    }
    31642946
     
    33563138    }
    33573139
    3358 #ifndef NEW_RESIZE
    3359     int rc = pThis->i_handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy, VBVA_SCREEN_F_ACTIVE);
    3360 #else
    33613140    int rc = pThis->i_handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy,
    33623141                                          VBVA_SCREEN_F_ACTIVE, 0, 0, true);
    3363 #endif
    33643142
    33653143    /* Restore the flag.  */
     
    43584136    Display *pThis = pDrv->pDisplay;
    43594137
    4360 #ifndef NEW_RESIZE
    4361     DISPLAYFBINFO *pFBInfo = &pThis->maFramebuffers[pScreen->u32ViewIndex];
     4138    return pThis->processVBVAResize(pView, pScreen, pvVRAM, fResetInputMapping);
     4139}
     4140
     4141int Display::processVBVAResize(PCVBVAINFOVIEW pView, PCVBVAINFOSCREEN pScreen, void *pvVRAM, bool fResetInputMapping)
     4142{
     4143    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     4144
     4145    DISPLAYFBINFO *pFBInfo = &maFramebuffers[pScreen->u32ViewIndex];
    43624146
    43634147    if (pScreen->u16Flags & VBVA_SCREEN_F_DISABLED)
    43644148    {
    4365         pThis->i_notifyCroglResize(pView, pScreen, pvVRAM);
    4366 
    4367         pFBInfo->fDisabled = true;
    4368         pFBInfo->flags = pScreen->u16Flags;
    4369 
    43704149        /* Ask the framebuffer to resize using a default format. The framebuffer will be black.
    43714150         * So if the frontend does not support GuestMonitorChangedEventType_Disabled event,
     
    43734152        uint32_t u32Width = pFBInfo->w ? pFBInfo->w : 640;
    43744153        uint32_t u32Height = pFBInfo->h ? pFBInfo->h : 480;
    4375         pThis->i_handleDisplayResize(pScreen->u32ViewIndex, 0, (uint8_t *)NULL, 0,
    4376                                      u32Width, u32Height, pScreen->u16Flags);
    4377 
    4378         fireGuestMonitorChangedEvent(pThis->mParent->i_getEventSource(),
     4154        int32_t xOrigin = pFBInfo->xOrigin;
     4155        int32_t yOrigin = pFBInfo->yOrigin;
     4156
     4157        alock.release();
     4158
     4159        i_notifyCroglResize(pView, pScreen, pvVRAM);
     4160
     4161        i_handleDisplayResize(pScreen->u32ViewIndex, 0, (uint8_t *)NULL, 0,
     4162                              u32Width, u32Height, pScreen->u16Flags, xOrigin, yOrigin, false);
     4163
     4164        fireGuestMonitorChangedEvent(mParent->i_getEventSource(),
    43794165                                     GuestMonitorChangedEventType_Disabled,
    43804166                                     pScreen->u32ViewIndex,
     
    44054191    }
    44064192
    4407     /* If display was disabled or there is no framebuffer, a resize will be required,
    4408      * because the framebuffer was/will be changed.
     4193    /* Resize if VBVA was just enabled or display was in disabled state.
     4194     * Also if there is no framebuffer, a resize will be required, because the framebuffer was/will be changed.
    44094195     */
    4410     bool fResize = pFBInfo->fDisabled || pFBInfo->pFramebuffer.isNull();
    4411 
    4412     if (pFBInfo->fVBVAForceResize)
    4413     {
    4414         /* VBVA was just enabled. Do the resize. */
    4415         fResize = true;
    4416         pFBInfo->fVBVAForceResize = false;
    4417     }
    4418 
    4419     /* If the screen if blanked, then do a resize request to make sure that the framebuffer
    4420      * switches to the default format.
     4196    bool fResize = pFBInfo->fVBVAForceResize || pFBInfo->fDisabled || pFBInfo->pFramebuffer.isNull();
     4197
     4198    /* If the screen blanked state is changing, then do a resize request to make sure that the framebuffer
     4199     * is notified and requests a new source bitmap.
    44214200     */
    44224201    fResize = fResize || RT_BOOL((pScreen->u16Flags ^ pFBInfo->flags) & VBVA_SCREEN_F_BLANK);
     
    44354214                      || pFBInfo->yOrigin != pScreen->i32OriginY;
    44364215
    4437     if (fNewOrigin || fResize)
    4438         pThis->i_notifyCroglResize(pView, pScreen, pvVRAM);
    4439 
    4440     if (pFBInfo->fDisabled)
    4441     {
    4442         pFBInfo->fDisabled = false;
    4443         fireGuestMonitorChangedEvent(pThis->mParent->i_getEventSource(),
    4444                                      GuestMonitorChangedEventType_Enabled,
    4445                                      pScreen->u32ViewIndex,
    4446                                      pScreen->i32OriginX, pScreen->i32OriginY,
    4447                                      pScreen->u32Width, pScreen->u32Height);
    4448         /* Continue to update pFBInfo. */
    4449     }
    4450 
    4451     pFBInfo->u32Offset = pView->u32ViewOffset; /* Not used in HGSMI. */
    4452     pFBInfo->u32MaxFramebufferSize = pView->u32MaxScreenSize; /* Not used in HGSMI. */
    4453     pFBInfo->u32InformationSize = 0; /* Not used in HGSMI. */
    4454 
    4455     pFBInfo->xOrigin = pScreen->i32OriginX;
    4456     pFBInfo->yOrigin = pScreen->i32OriginY;
    4457 
    4458     pFBInfo->w = pScreen->u32Width;
    4459     pFBInfo->h = pScreen->u32Height;
    4460 
    4461     pFBInfo->u16BitsPerPixel = pScreen->u16BitsPerPixel;
    4462     pFBInfo->pu8FramebufferVRAM = (uint8_t *)pvVRAM + pScreen->u32StartOffset;
    4463     pFBInfo->u32LineSize = pScreen->u32LineSize;
    4464 
    4465     pFBInfo->flags = pScreen->u16Flags;
    4466 
    4467     if (fResetInputMapping)
    4468     {
    4469         pThis->xInputMappingOrigin = 0;
    4470         pThis->yInputMappingOrigin = 0;
    4471         pThis->cxInputMapping = 0;
    4472         pThis->cyInputMapping = 0;
    4473     }
    4474 
    4475     if (fNewOrigin)
    4476     {
    4477         fireGuestMonitorChangedEvent(pThis->mParent->i_getEventSource(),
    4478                                      GuestMonitorChangedEventType_NewOrigin,
    4479                                      pScreen->u32ViewIndex,
    4480                                      pScreen->i32OriginX, pScreen->i32OriginY,
    4481                                      0, 0);
    4482     }
    4483 
    4484     if (!fResize)
    4485     {
    4486         /* No parameters of the framebuffer have actually changed. */
    4487         if (fNewOrigin)
    4488         {
    4489             /* VRDP server still need this notification. */
    4490             LogRelFlowFunc(("Calling VRDP\n"));
    4491             pThis->mParent->i_consoleVRDPServer()->SendResize();
    4492         }
    4493         return VINF_SUCCESS;
    4494     }
    4495 
    4496     /* Do a regular resize. */
    4497     return pThis->i_handleDisplayResize(pScreen->u32ViewIndex, pScreen->u16BitsPerPixel,
    4498                                         (uint8_t *)pvVRAM + pScreen->u32StartOffset,
    4499                                         pScreen->u32LineSize, pScreen->u32Width, pScreen->u32Height, pScreen->u16Flags);
    4500 #else /* NEW_RESIZE */
    4501     return pThis->processVBVAResize(pView, pScreen, pvVRAM, fResetInputMapping);
    4502 #endif /* NEW_RESIZE */
    4503 }
    4504 
    4505 #ifdef NEW_RESIZE
    4506 int Display::processVBVAResize(PCVBVAINFOVIEW pView, PCVBVAINFOSCREEN pScreen, void *pvVRAM, bool fResetInputMapping)
    4507 {
    4508     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    4509 
    4510     DISPLAYFBINFO *pFBInfo = &maFramebuffers[pScreen->u32ViewIndex];
    4511 
    4512     if (pScreen->u16Flags & VBVA_SCREEN_F_DISABLED)
    4513     {
    4514         /* Ask the framebuffer to resize using a default format. The framebuffer will be black.
    4515          * So if the frontend does not support GuestMonitorChangedEventType_Disabled event,
    4516          * the VM window will be black. */
    4517         uint32_t u32Width = pFBInfo->w ? pFBInfo->w : 640;
    4518         uint32_t u32Height = pFBInfo->h ? pFBInfo->h : 480;
    4519         int32_t xOrigin = pFBInfo->xOrigin;
    4520         int32_t yOrigin = pFBInfo->yOrigin;
    4521 
    4522         alock.release();
    4523 
    4524         i_notifyCroglResize(pView, pScreen, pvVRAM);
    4525 
    4526         i_handleDisplayResize(pScreen->u32ViewIndex, 0, (uint8_t *)NULL, 0,
    4527                               u32Width, u32Height, pScreen->u16Flags, xOrigin, yOrigin, false);
    4528 
    4529         fireGuestMonitorChangedEvent(mParent->i_getEventSource(),
    4530                                      GuestMonitorChangedEventType_Disabled,
    4531                                      pScreen->u32ViewIndex,
    4532                                      0, 0, 0, 0);
    4533         return VINF_SUCCESS;
    4534     }
    4535 
    4536     VBVAINFOSCREEN screenInfo;
    4537     RT_ZERO(screenInfo);
    4538 
    4539     if (pScreen->u16Flags & VBVA_SCREEN_F_BLANK2)
    4540     {
    4541         /* Init a local VBVAINFOSCREEN structure, which will be used instead of
    4542          * the original pScreen. Set VBVA_SCREEN_F_BLANK, which will force
    4543          * the code below to choose the "blanking" branches.
    4544          */
    4545         screenInfo.u32ViewIndex    = pScreen->u32ViewIndex;
    4546         screenInfo.i32OriginX      = pFBInfo->xOrigin;
    4547         screenInfo.i32OriginY      = pFBInfo->yOrigin;
    4548         screenInfo.u32StartOffset  = 0; /* Irrelevant */
    4549         screenInfo.u32LineSize     = pFBInfo->u32LineSize;
    4550         screenInfo.u32Width        = pFBInfo->w;
    4551         screenInfo.u32Height       = pFBInfo->h;
    4552         screenInfo.u16BitsPerPixel = pFBInfo->u16BitsPerPixel;
    4553         screenInfo.u16Flags        = pScreen->u16Flags | VBVA_SCREEN_F_BLANK;
    4554 
    4555         pScreen = &screenInfo;
    4556     }
    4557 
    4558     /* Resize if VBVA was just enabled or display was in disabled state.
    4559      * Also if there is no framebuffer, a resize will be required, because the framebuffer was/will be changed.
    4560      */
    4561     bool fResize = pFBInfo->fVBVAForceResize || pFBInfo->fDisabled || pFBInfo->pFramebuffer.isNull();
    4562 
    4563     /* If the screen blanked state is changing, then do a resize request to make sure that the framebuffer
    4564      * is notified and requests a new source bitmap.
    4565      */
    4566     fResize = fResize || RT_BOOL((pScreen->u16Flags ^ pFBInfo->flags) & VBVA_SCREEN_F_BLANK);
    4567 
    4568     /* Check if this is a real resize or a notification about the screen origin.
    4569      * The guest uses this VBVAResize call for both.
    4570      */
    4571     fResize =    fResize
    4572               || pFBInfo->u16BitsPerPixel != pScreen->u16BitsPerPixel
    4573               || pFBInfo->pu8FramebufferVRAM != (uint8_t *)pvVRAM + pScreen->u32StartOffset
    4574               || pFBInfo->u32LineSize != pScreen->u32LineSize
    4575               || pFBInfo->w != pScreen->u32Width
    4576               || pFBInfo->h != pScreen->u32Height;
    4577 
    4578     bool fNewOrigin =    pFBInfo->xOrigin != pScreen->i32OriginX
    4579                       || pFBInfo->yOrigin != pScreen->i32OriginY;
    4580 
    45814216    /* The event for disabled->enabled transition. */
    45824217    const bool fGuestMonitorChangedEvent = pFBInfo->fDisabled;
     
    46284263                                 pScreen->i32OriginX, pScreen->i32OriginY, false);
    46294264}
    4630 #endif /* NEW_RESIZE */
    46314265
    46324266DECLCALLBACK(int) Display::i_displayVBVAMousePointerShape(PPDMIDISPLAYCONNECTOR pInterface, bool fVisible, bool fAlpha,
  • trunk/src/VBox/Main/src-client/DisplayImplLegacy.cpp

    r66328 r66394  
    957957                }
    958958
    959 #ifndef NEW_RESIZE
    960                 i_handleDisplayResize(uScreenId, pScreen->bitsPerPixel,
    961                                                       (uint8_t *)pvVRAM + pFBInfo->u32Offset,
    962                                                       pScreen->u32LineSize,
    963                                                       pScreen->u16Width, pScreen->u16Height,
    964                                                       VBVA_SCREEN_F_ACTIVE);
    965 #else
    966959                i_handleDisplayResize(uScreenId, pScreen->bitsPerPixel,
    967960                                                      (uint8_t *)pvVRAM + pFBInfo->u32Offset,
     
    970963                                                      VBVA_SCREEN_F_ACTIVE,
    971964                                                      pScreen->xOrigin, pScreen->yOrigin, false);
    972 #endif
    973965            }
    974966        }
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