VirtualBox

Changeset 98557 in vbox


Ignore:
Timestamp:
Feb 14, 2023 12:09:21 PM (22 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: Reworking CDisplay wrapper usage step-by-step; This one is about display invalidation and viewport update stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
6 edited

Legend:

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

    r98556 r98557  
    474474{
    475475    return uisession()->setSeamlessMode(fEnabled);
     476}
     477
     478bool UIMachine::viewportChanged(ulong uScreenId, ulong xOrigin, ulong yOrigin, ulong uWidth, ulong uHeight)
     479{
     480    return uisession()->viewportChanged(uScreenId, xOrigin, yOrigin, uWidth, uHeight);
     481}
     482
     483bool UIMachine::invalidateAndUpdate()
     484{
     485    return uisession()->invalidateAndUpdate();
     486}
     487
     488bool UIMachine::invalidateAndUpdateScreen(ulong uScreenId)
     489{
     490    return uisession()->invalidateAndUpdateScreen(uScreenId);
    476491}
    477492
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98556 r98557  
    297297        /** Defines whether seamless mode is enabled for display. */
    298298        bool setSeamlessMode(bool fEnabled);
     299        /** Notifies display about viewport changes. */
     300        bool viewportChanged(ulong uScreenId, ulong xOrigin, ulong yOrigin, ulong uWidth, ulong uHeight);
     301        /** Notifies display about all screens were invalidated. */
     302        bool invalidateAndUpdate();
     303        /** Notifies display about screen with passed uScreenId was invalidated. */
     304        bool invalidateAndUpdateScreen(ulong uScreenId);
    299305    /** @} */
    300306
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r98556 r98557  
    6666/* COM includes: */
    6767#include "CConsole.h"
    68 #include "CDisplay.h"
    6968#include "CGraphicsAdapter.h"
    7069#include "CSession.h"
     
    371370void UIMachineView::updateViewport()
    372371{
    373     display().ViewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());
     372    uimachine()->viewportChanged(screenId(), contentsX(), contentsY(), visibleWidth(), visibleHeight());
    374373}
    375374
     
    672671    /* Ask for just required guest display update (it will also update
    673672     * the viewport through IFramebuffer::NotifyUpdate): */
    674     display().InvalidateAndUpdateScreen(m_uScreenId);
     673    uimachine()->invalidateAndUpdateScreen(m_uScreenId);
    675674
    676675    /* If we are in normal or scaled mode and if GA are active,
     
    10851084                    /* Ask for full guest display update (it will also update
    10861085                     * the viewport through IFramebuffer::NotifyUpdate): */
    1087                     display().InvalidateAndUpdate();
     1086                    uimachine()->invalidateAndUpdate();
    10881087                }
    10891088            }
     
    14021401     * Note: VBOX_WITH_CROGL additionally requires us to call DetachFramebuffer
    14031402     * to ensure 3D gets notified of view being destroyed... */
    1404     if (console().isOk() && !display().isNull())
     1403    if (console().isOk())
    14051404        frameBuffer()->detach();
    14061405
     
    14291428{
    14301429    return uisession()->console();
    1431 }
    1432 
    1433 CDisplay& UIMachineView::display() const
    1434 {
    1435     return uisession()->display();
    14361430}
    14371431
     
    16041598
    16051599    /* Dim screen-shot if it is Ok: */
    1606     if (display().isOk() && !screenShot.isNull())
     1600    if (!screenShot.isNull())
    16071601        dimImage(screenShot);
    16081602
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r98517 r98557  
    6767class UISession;
    6868class CConsole;
    69 class CDisplay;
    7069class CGuest;
    7170class CMachine;
     
    278277    /** Returns the session's console reference. */
    279278    CConsole& console() const;
    280     /** Returns the console's display reference. */
    281     CDisplay& display() const;
    282279
    283280    /* Protected getters: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98556 r98557  
    510510    CDisplay comDisplay = display();
    511511    comDisplay.SetSeamlessMode(fEnabled);
     512    const bool fSuccess = comDisplay.isOk();
     513    if (!fSuccess)
     514        UINotificationMessage::cannotChangeDisplayParameter(comDisplay);
     515    return fSuccess;
     516}
     517
     518bool UISession::viewportChanged(ulong uScreenId, ulong xOrigin, ulong yOrigin, ulong uWidth, ulong uHeight)
     519{
     520    CDisplay comDisplay = display();
     521    comDisplay.ViewportChanged(uScreenId, xOrigin, yOrigin, uWidth, uHeight);
     522    const bool fSuccess = comDisplay.isOk();
     523    if (!fSuccess)
     524        UINotificationMessage::cannotChangeDisplayParameter(comDisplay);
     525    return fSuccess;
     526}
     527
     528bool UISession::invalidateAndUpdate()
     529{
     530    CDisplay comDisplay = display();
     531    comDisplay.InvalidateAndUpdate();
     532    const bool fSuccess = comDisplay.isOk();
     533    if (!fSuccess)
     534        UINotificationMessage::cannotChangeDisplayParameter(comDisplay);
     535    return fSuccess;
     536}
     537
     538bool UISession::invalidateAndUpdateScreen(ulong uScreenId)
     539{
     540    CDisplay comDisplay = display();
     541    comDisplay.InvalidateAndUpdateScreen(uScreenId);
    512542    const bool fSuccess = comDisplay.isOk();
    513543    if (!fSuccess)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98556 r98557  
    315315        /** Defines whether seamless mode is enabled for display. */
    316316        bool setSeamlessMode(bool fEnabled);
     317        /** Notifies display about viewport changes. */
     318        bool viewportChanged(ulong uScreenId, ulong xOrigin, ulong yOrigin, ulong uWidth, ulong uHeight);
     319        /** Notifies display about all screens were invalidated. */
     320        bool invalidateAndUpdate();
     321        /** Notifies display about screen with passed uScreenId was invalidated. */
     322        bool invalidateAndUpdateScreen(ulong uScreenId);
    317323    /** @} */
    318324
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