VirtualBox

Changeset 22846 in vbox


Ignore:
Timestamp:
Sep 8, 2009 7:33:55 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52082
Message:

video hw accel: overlay update fixes

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFBOverlay.h

    r22836 r22846  
    431431    void updatedMem(const QRect * aRect);
    432432
    433     void performDisplay(VBoxVHWASurfaceBase *pPrimary);
     433    bool performDisplay(VBoxVHWASurfaceBase *pPrimary, bool bForce);
    434434
    435435    void setRects(VBoxVHWASurfaceBase *pPrimary, const QRect & aTargRect, const QRect & aSrcRect, const QRect & aVisibleTargRect, bool bForceReinit);
     
    583583    GLuint createDisplay(VBoxVHWASurfaceBase *pPrimary);
    584584    void doDisplay(VBoxVHWASurfaceBase *pPrimary, VBoxVHWAGlProgramVHWA * pProgram, bool bBindDst);
    585     void synchTexMem(const QRect * aRect);
     585    bool synchTexMem(const QRect * aRect);
    586586
    587587    int performBlt(const QRect * pDstRect, VBoxVHWASurfaceBase * pSrcSurface, const QRect * pSrcRect, const VBoxVHWAColorKey * pDstCKey, const VBoxVHWAColorKey * pSrcCKey, bool blt);
     
    772772    }
    773773
    774     void performDisplay()
     774    bool performDisplay(bool bForce)
    775775    {
    776776        VBoxVHWASurfaceBase * pPrimary = mPrimary.current();
    777         pPrimary->performDisplay(NULL);
     777        bForce |= pPrimary->performDisplay(NULL, bForce);
    778778
    779779        for (OverlayList::const_iterator it = mOverlays.begin();
     
    783783            if(pOverlay)
    784784            {
    785                 pOverlay->performDisplay(pPrimary);
     785                bForce |= pOverlay->performDisplay(pPrimary, bForce);
    786786            }
    787787        }
     788        return bForce;
    788789    }
    789790
     
    10611062    const QRect & vboxViewport() const {return mViewport;}
    10621063
    1063     void performDisplay() { mDisplay.performDisplay(); }
     1064    bool performDisplay(bool bForce) { return mDisplay.performDisplay(bForce); }
    10641065protected:
    10651066
     
    10731074//        else
    10741075//        {
    1075             mDisplay.performDisplay();
     1076            mDisplay.performDisplay(true);
    10761077//        }
    10771078    }
     
    11651166
    11661167
    1167 typedef enum
    1168 {
    1169     VBOXFBOVERLAY_DONE = 1,
    1170     VBOXFBOVERLAY_MODIFIED,
    1171     VBOXFBOVERLAY_UNTOUCHED
    1172 } VBOXFBOVERLAY_RESUT;
     1168//typedef enum
     1169//{
     1170//    VBOXFBOVERLAY_DONE = 1,
     1171//    VBOXFBOVERLAY_MODIFIED,
     1172//    VBOXFBOVERLAY_UNTOUCHED
     1173//} VBOXFBOVERLAY_RESUT;
    11731174
    11741175class VBoxQGLOverlay
     
    12011202    }
    12021203
    1203     VBOXFBOVERLAY_RESUT onPaintEvent (const QPaintEvent *pe, QRect *pRect);
     1204//    VBOXFBOVERLAY_RESUT onPaintEvent (const QPaintEvent *pe, QRect *pRect);
     1205
    12041206    void onResizeEvent (const class VBoxResizeEvent *re);
    12051207    void onResizeEventPostprocess (const class VBoxResizeEvent *re);
    12061208
    1207     void viewportResized(QResizeEvent * re)
     1209    void onViewportResized(QResizeEvent * re)
    12081210    {
    12091211        vboxDoCheckUpdateViewport();
     
    12111213    }
    12121214
    1213     void viewportScrolled(int dx, int dy)
     1215    void onViewportScrolled(int dx, int dy)
    12141216    {
    12151217        vboxDoCheckUpdateViewport();
     
    12571259#else
    12581260            makeCurrent();
    1259             mpOverlayWidget->performDisplay();
     1261            mpOverlayWidget->performDisplay(false);
    12601262            mpOverlayWidget->swapBuffers();
    12611263#endif
     
    13501352    }
    13511353
    1352     void paintEvent (QPaintEvent *pe)
    1353     {
    1354         QRect rect;
    1355         VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect);
    1356         switch(res)
    1357         {
    1358             case VBOXFBOVERLAY_MODIFIED:
    1359             {
    1360                 QPaintEvent modified(rect);
    1361                 T::paintEvent(&modified);
    1362             } break;
    1363             case VBOXFBOVERLAY_UNTOUCHED:
    1364                 T::paintEvent(pe);
    1365                 break;
    1366             default:
    1367                 break;
    1368         }
    1369     }
     1354//    void paintEvent (QPaintEvent *pe)
     1355//    {
     1356//        QRect rect;
     1357//        VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect);
     1358//        switch(res)
     1359//        {
     1360//            case VBOXFBOVERLAY_MODIFIED:
     1361//            {
     1362//                QPaintEvent modified(rect);
     1363//                T::paintEvent(&modified);
     1364//            } break;
     1365//            case VBOXFBOVERLAY_UNTOUCHED:
     1366//                T::paintEvent(pe);
     1367//                break;
     1368//            default:
     1369//                break;
     1370//        }
     1371//    }
    13701372
    13711373    void resizeEvent (VBoxResizeEvent *re)
     
    13781380    void viewportResized(QResizeEvent * re)
    13791381    {
    1380         mOverlay.viewportResized(re);
     1382        mOverlay.onViewportResized(re);
    13811383        T::viewportResized(re);
    13821384    }
     
    13841386    void viewportScrolled(int dx, int dy)
    13851387    {
    1386         mOverlay.viewportScrolled(dx, dy);
     1388        mOverlay.onViewportScrolled(dx, dy);
    13871389        T::viewportScrolled(dx, dy);
    13881390    }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r22842 r22846  
    21472147GLenum VBoxVHWATextureNP2Rect::texTarget() {return GL_TEXTURE_RECTANGLE; }
    21482148
    2149 void VBoxVHWASurfaceBase::synchTexMem(const QRect * pRect)
     2149bool VBoxVHWASurfaceBase::synchTexMem(const QRect * pRect)
    21502150{
    21512151    if(pRect)
     
    21552155
    21562156    if(mUpdateMem2TexRect.isClear())
    2157         return;
     2157        return false;
    21582158
    21592159    if(pRect && !mUpdateMem2TexRect.rect().intersects(*pRect))
    2160         return;
     2160        return false;
    21612161
    21622162    mpTex[0]->update(&mUpdateMem2TexRect.rect());
     
    21792179//    VBOXPRINTDIF(dbgTime, ("texMem:"));
    21802180//#endif
     2181    return true;
    21812182}
    21822183
     
    28702871//}
    28712872
    2872 void VBoxVHWASurfaceBase::performDisplay(VBoxVHWASurfaceBase *pPrimary)
     2873bool VBoxVHWASurfaceBase::performDisplay(VBoxVHWASurfaceBase *pPrimary, bool bForce)
    28732874{
    28742875    Assert(mVisibleDisplayInitialized);
     
    28792880        Assert(mVisibleSrcRect.isEmpty());
    28802881        Assert(mVisibleTargRect.isEmpty());
    2881         return;
     2882        return false;
    28822883    }
    28832884    else
     
    28872888    }
    28882889
    2889     synchTexMem(&mVisibleSrcRect);
     2890    bForce |= synchTexMem(&mVisibleSrcRect);
    28902891    if(pPrimary && getActiveDstOverlayCKey(pPrimary))
    28912892    {
    2892         pPrimary->synchTexMem(&mVisibleTargRect);
    2893     }
     2893        bForce |= pPrimary->synchTexMem(&mVisibleTargRect);
     2894    }
     2895
     2896    if(!bForce)
     2897        return false;
    28942898
    28952899#ifdef DEBUG_misha
     
    29242928                );
    29252929    }
     2930
     2931    Assert(bForce);
     2932    return true;
    29262933}
    29272934
     
    51655172}
    51665173
    5167 VBOXFBOVERLAY_RESUT VBoxQGLOverlay::onPaintEvent (const QPaintEvent *pe, QRect *pRect)
    5168 {
    5169     Q_UNUSED(pe);
    5170     Q_UNUSED(pRect);
    5171 
    5172 //    if(mOverlayWidgetVisible && !mProcessingCommands)
    5173 //    {
    5174 //        Assert(!mGlCurrent);
    5175 //        vboxDoCheckUpdateViewport();
    5176 //        vboxOpExit();
    5177 //    }
    5178     return VBOXFBOVERLAY_UNTOUCHED;
    5179 }
     5174//VBOXFBOVERLAY_RESUT VBoxQGLOverlay::onPaintEvent (const QPaintEvent *pe, QRect *pRect)
     5175//{
     5176//    Q_UNUSED(pe);
     5177//    Q_UNUSED(pRect);
     5178//
     5179////    if(mOverlayWidgetVisible && !mProcessingCommands)
     5180////    {
     5181////        Assert(!mGlCurrent);
     5182////        vboxDoCheckUpdateViewport();
     5183////        vboxOpExit();
     5184////    }
     5185//    return VBOXFBOVERLAY_UNTOUCHED;
     5186//}
    51805187
    51815188void VBoxQGLOverlay::onResizeEvent (const VBoxResizeEvent *re)
     
    53915398    {
    53925399        mpOverlayWidget->vboxDoUpdateRect(&aRect);
    5393         if(aRect.intersects(mpOverlayWidget->vboxViewport()))
    5394         {
    5395             mNeedOverlayRepaint = true;
    5396         }
     5400        mNeedOverlayRepaint = true;
    53975401    }
    53985402}
     
    54035407    VBoxVHWASurfaceBase * pVGA = mpOverlayWidget->vboxGetVGASurface();
    54045408    const VBoxVHWADirtyRect & rect = pVGA->getDirtyRect();
     5409    mNeedOverlayRepaint = true;
    54055410    if(!rect.isClear())
    54065411    {
     
    54385443                }
    54395444                vboxDoCheckUpdateViewport();
     5445                mNeedOverlayRepaint = true;
    54405446            }
    54415447        } break;
     
    54565462                }
    54575463                vboxDoCheckUpdateViewport();
     5464                mNeedOverlayRepaint = true;
    54585465            }
    54595466        } break;
     
    54725479            VBOXVHWACMD_SURF_BLT * pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_BLT);
    54735480            pCmd->rc = mpOverlayWidget->vhwaSurfaceBlt(pBody);
     5481            mNeedOverlayRepaint = true;
    54745482        } break;
    54755483        case VBOXVHWACMD_TYPE_SURF_FLIP:
     
    54895497            }
    54905498            vboxDoCheckUpdateViewport();
     5499            mNeedOverlayRepaint = true;
    54915500        } break;
    54925501        case VBOXVHWACMD_TYPE_SURF_OVERLAY_SETPOSITION:
     
    55005509            }
    55015510            vboxDoCheckUpdateViewport();
     5511            mNeedOverlayRepaint = true;
    55025512        } break;
    55035513        case VBOXVHWACMD_TYPE_SURF_COLORKEY_SET:
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQGL.cpp

    r22836 r22846  
    130130    }
    131131
    132     pw->performDisplay();
     132    pw->performDisplay(true);
    133133
    134134    pw->swapBuffers();
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