VirtualBox

忽略:
時間撮記:
2015-1-15 上午11:00:51 (10 年 以前)
作者:
vboxsync
訊息:

Host 3D: prepare for content scaling.

位置:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.h

    r53262 r53814  
    215215        int SetVisibleRegionsChanged();
    216216        int SetCompositor(const struct VBOXVR_SCR_COMPOSITOR * pCompositor);
     217        void SetScaleFactor(GLdouble scaleFactor);
     218        GLdouble GetScaleFactor();
    217219        int UpdateBegin();
    218220        void UpdateEnd();
     
    250252        CR_FBWIN_FLAGS mFlags;
    251253        uint64_t mParentId;
     254        volatile uint32_t mScaleFactorStorage;
    252255};
    253256
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/window.cpp

    r53262 r53814  
    2828    mWidth(0),
    2929    mHeight(0),
    30     mParentId(parentId)
     30    mParentId(parentId),
     31    mScaleFactorStorage(1)
    3132{
    3233    mFlags.Value = 0;
     
    128129    }
    129130
    130     LOG(("CrWIN: Size [%d ; %d]", width, height));
    131 
    132131    if (mWidth != width || mHeight != height)
    133132    {
     133        GLdouble scaleFactor = GetScaleFactor();
     134
    134135        mFlags.fCompositoEntriesModified = 1;
    135         mWidth = width;
    136         mHeight = height;
     136        mWidth  = scaleFactor ? (uint32_t)((GLdouble)width  * scaleFactor) : width;
     137        mHeight = scaleFactor ? (uint32_t)((GLdouble)height * scaleFactor) : height;
     138
     139        LOG(("CrWIN: Size [%d ; %d]", width, height));
     140
    137141        if (mSpuWindow)
    138             cr_server.head_spu->dispatch_table.WindowSize(mSpuWindow, width, height);
     142            cr_server.head_spu->dispatch_table.WindowSize(mSpuWindow, mWidth, mHeight);
    139143    }
    140144
     
    193197
    194198
     199void CrFbWindow::SetScaleFactor(GLdouble scaleFactor)
     200{
     201    ASMAtomicWriteU32(&mScaleFactorStorage, (uint32_t)scaleFactor);
     202}
     203
     204
     205GLdouble CrFbWindow::GetScaleFactor()
     206{
     207    return (GLdouble)ASMAtomicReadU32(&mScaleFactorStorage);
     208}
     209
     210
    195211int CrFbWindow::UpdateBegin()
    196212{
     
    226242        if (fPresentNeeded || mFlags.fForcePresentOnReenable)
    227243        {
     244            GLdouble scaleFactor = GetScaleFactor();
     245
    228246            mFlags.fForcePresentOnReenable = false;
    229247            if (mpCompositor)
     248            {
     249                CrVrScrCompositorSetStretching((VBOXVR_SCR_COMPOSITOR *)mpCompositor, scaleFactor, scaleFactor);
    230250                cr_server.head_spu->dispatch_table.VBoxPresentComposition(mSpuWindow, mpCompositor, NULL);
     251            }
    231252            else
    232253            {
     
    238259                Rect.yBottom = mHeight;
    239260                CrVrScrCompositorInit(&TmpCompositor, &Rect);
     261                CrVrScrCompositorSetStretching((VBOXVR_SCR_COMPOSITOR *)&TmpCompositor, scaleFactor, scaleFactor);
    240262                /* this is a cleanup operation
    241263                 * empty compositor is guarantid to be released on VBoxPresentComposition return */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette