VirtualBox

Changeset 47067 in vbox for trunk


Ignore:
Timestamp:
Jul 10, 2013 11:11:20 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Frame-buffers: Visible-region update optimization.

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

Legend:

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

    r46864 r47067  
    354354}
    355355
     356void UIFrameBuffer::applyVisibleRegion(const QRegion &region)
     357{
     358    /* Make sure async visible-region has changed: */
     359    if (m_asyncVisibleRegion == region)
     360        return;
     361
     362    /* We are accounting async visible-regions one-by-one
     363     * to keep corresponding viewport area always updated! */
     364    if (!m_asyncVisibleRegion.isEmpty())
     365        m_pMachineView->viewport()->update(m_asyncVisibleRegion - region);
     366
     367    /* Remember last visible region: */
     368    m_asyncVisibleRegion = region;
     369
     370#ifdef Q_WS_X11
     371    /* Qt 4.8.3 under X11 has Qt::WA_TranslucentBackground window attribute broken,
     372     * so we are also have to use async visible-region to apply to [Q]Widget [set]Mask
     373     * which internally wraps old one known (approved) Xshape extension: */
     374    m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion);
     375#endif /* Q_WS_X11 */
     376}
     377
    356378#ifdef VBOX_WITH_VIDEOHWACCEL
    357379void UIFrameBuffer::doProcessVHWACommand(QEvent *pEvent)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h

    r46364 r47067  
    190190    virtual void resizeEvent(UIResizeEvent *pEvent) = 0;
    191191    virtual void paintEvent(QPaintEvent *pEvent) = 0;
    192     virtual void applyVisibleRegion(const QRegion &region) = 0;
     192    virtual void applyVisibleRegion(const QRegion &region);
    193193
    194194#ifdef VBOX_WITH_VIDEOHWACCEL
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQImage.cpp

    r47058 r47067  
    178178}
    179179
    180 void UIFrameBufferQImage::applyVisibleRegion(const QRegion &region)
    181 {
    182     /* Make sure async visible-region changed: */
    183     if (m_asyncVisibleRegion == region)
    184         return;
    185 
    186     /* We are accounting async visible-regions one-by-one
    187      * to keep corresponding viewport area always updated! */
    188     m_pMachineView->viewport()->update(region + m_asyncVisibleRegion);
    189     m_asyncVisibleRegion = region;
    190 
    191 #ifdef Q_WS_X11
    192     /* Qt 4.8.3 under X11 has Qt::WA_TranslucentBackground window attribute broken,
    193      * so we are also have to use async visible-region to apply to [Q]Widget [set]Mask
    194      * which internally wraps old one known (approved) Xshape extension: */
    195     m_pMachineView->machineWindow()->setMask(m_asyncVisibleRegion);
    196 #endif /* Q_WS_X11 */
    197 }
    198 
    199180void UIFrameBufferQImage::paintDefault(QPaintEvent *pEvent)
    200181{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQImage.h

    r46364 r47067  
    4747    void resizeEvent(UIResizeEvent *pEvent);
    4848    void paintEvent(QPaintEvent *pEvent);
    49     void applyVisibleRegion(const QRegion &region);
    5049
    5150private:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQuartz2D.cpp

    r46366 r47067  
    468468}
    469469
    470 void UIFrameBufferQuartz2D::applyVisibleRegion(const QRegion &region)
    471 {
    472     /* Make sure async visible-region changed: */
    473     if (m_asyncVisibleRegion == region)
    474         return;
    475 
    476     /* We are handling the fact of async visible-region change
    477      * to invalidate whole the viewport area! */
    478     ::darwinWindowInvalidateShape(m_pMachineView->viewport());
    479     m_asyncVisibleRegion = region;
    480 }
    481 
    482470void UIFrameBufferQuartz2D::clean(bool fPreserveRegions)
    483471{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQuartz2D.h

    r46364 r47067  
    5050    void resizeEvent(UIResizeEvent *pEvent);
    5151    void paintEvent(QPaintEvent *pEvent);
    52     void applyVisibleRegion(const QRegion &region);
    5352
    5453#ifdef VBOX_WITH_VIDEOHWACCEL
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