VirtualBox

Ignore:
Timestamp:
Jan 17, 2014 4:34:07 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: presentation infrastructure rework (still work in progress)

Location:
trunk/src/VBox/HostServices/SharedOpenGL/render
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c

    r50041 r50095  
    766766
    767767static void RENDER_APIENTRY
    768 renderspuVBoxPresentComposition( GLint win, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
     768renderspuVBoxPresentComposition( GLint win, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
    769769{
    770770    WindowInfo *window;
     
    789789}
    790790
    791 void renderspuVBoxCompositorBlitStretched ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY)
    792 {
    793     VBOXVR_SCR_COMPOSITOR_ITERATOR CIter;
    794     PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
    795     CrVrScrCompositorIterInit(pCompositor, &CIter);
    796     while ((pEntry = CrVrScrCompositorIterNext(&CIter)) != NULL)
     791void renderspuVBoxCompositorBlitStretched ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY)
     792{
     793    VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter;
     794    const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry;
     795    CrVrScrCompositorConstIterInit(pCompositor, &CIter);
     796    while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL)
    797797    {
    798798        uint32_t cRegions;
     
    806806            {
    807807                RTRECT DstRect;
     808                const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry);
    808809                DstRect.xLeft = paDstRegions[i].xLeft * scaleX;
    809810                DstRect.yTop = paDstRegions[i].yTop * scaleY;
    810811                DstRect.xRight = paDstRegions[i].xRight * scaleX;
    811812                DstRect.yBottom = paDstRegions[i].yBottom * scaleY;
    812                 CrBltBlitTexMural(pBlitter, true, &pEntry->Tex, &paSrcRegions[i], &DstRect, 1, fFlags);
     813                CrBltBlitTexMural(pBlitter, true, CrTdTexGet(pTexData), &paSrcRegions[i], &DstRect, 1, fFlags);
    813814            }
    814815        }
     
    820821}
    821822
    822 void renderspuVBoxCompositorBlit ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter)
    823 {
    824     VBOXVR_SCR_COMPOSITOR_ITERATOR CIter;
    825     PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
    826     CrVrScrCompositorIterInit(pCompositor, &CIter);
    827     while ((pEntry = CrVrScrCompositorIterNext(&CIter)) != NULL)
     823void renderspuVBoxCompositorBlit ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter)
     824{
     825    VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter;
     826    const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry;
     827    CrVrScrCompositorConstIterInit(pCompositor, &CIter);
     828    while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL)
    828829    {
    829830        uint32_t cRegions;
     
    833834        if (RT_SUCCESS(rc))
    834835        {
    835             CrBltBlitTexMural(pBlitter, true, &pEntry->Tex, paSrcRegions, paDstRegions, cRegions, fFlags);
     836            const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry);
     837            CrBltBlitTexMural(pBlitter, true, CrTdTexGet(pTexData), paSrcRegions, paDstRegions, cRegions, fFlags);
    836838        }
    837839        else
     
    850852    {
    851853        const CR_BLITTER_WINDOW * pBltInfo = CrBltMuralGetCurrentInfo(window->pBlitter);
    852         if (pBltInfo->Base.id == window->BltInfo.Base.id)
    853         {
    854             CrBltMuralSetCurrent(window->pBlitter, NULL);
     854        if (pBltInfo && pBltInfo->Base.id == window->BltInfo.Base.id)
     855        {
     856            CrBltMuralSetCurrentInfo(window->pBlitter, NULL);
    855857        }
    856858    }
     
    858860    {
    859861        CRASSERT(CrBltMuralGetCurrentInfo(window->pBlitter)->Base.id == window->BltInfo.Base.id);
    860         CrBltMuralSetCurrent(window->pBlitter, NULL);
     862        CrBltMuralSetCurrentInfo(window->pBlitter, NULL);
    861863        CrBltTerm(window->pBlitter);
    862864    }
     
    895897            }
    896898
    897             rc = CrBltInit(pBlitter, &pDefaultCtxInfo->BltInfo, true, true, NULL, render_spu.blitterDispatch);
     899            rc = CrBltInit(pBlitter, &pDefaultCtxInfo->BltInfo, true, true, NULL, &render_spu.blitterDispatch);
    898900
    899901            /* we can release it either way, since it will be retained when used as a shared context */
     
    920922    }
    921923
    922     CrBltMuralSetCurrent(pBlitter, &window->BltInfo);
     924    CrBltMuralSetCurrentInfo(pBlitter, &window->BltInfo);
    923925    return pBlitter;
    924926}
     
    927929{
    928930    int rc;
    929     PCR_BLITTER_CONTEXT pCtxInfo = NULL;
    930     PCR_BLITTER_WINDOW pWindowInfo = NULL;
    931     GET_CONTEXT(pCtx);
    932 
    933     if (pCtx)
    934     {
    935         if (pCtx->currentWindow)
    936         {
    937             pCtxInfo = &pCtx->BltInfo;
    938             pWindowInfo =  &pCtx->currentWindow->BltInfo;
    939         }
    940     }
    941931
    942932    CrBltSetMakeCurrentUserData(pBlitter, i32MakeCurrentUserData);
    943933
    944     rc = CrBltEnter(pBlitter, pCtxInfo, pWindowInfo);
     934    rc = CrBltEnter(pBlitter);
    945935    if (!RT_SUCCESS(rc))
    946936    {
     
    969959    if (!window->pBlitter)
    970960    {
    971         struct VBOXVR_SCR_COMPOSITOR * pTmpCompositor;
     961        const struct VBOXVR_SCR_COMPOSITOR * pTmpCompositor;
    972962        /* just use compositor lock to synchronize */
    973963        pTmpCompositor = renderspuVBoxCompositorAcquire(window);
     
    1006996}
    1007997
    1008 void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData )
     998void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData )
    1009999{
    10101000    PCR_BLITTER pBlitter = renderspuVBoxPresentBlitterGetAndEnter(window, i32MakeCurrentUserData);
     
    10191009}
    10201010
    1021 void renderspuVBoxCompositorSet( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor)
     1011void renderspuVBoxCompositorSet( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor)
    10221012{
    10231013    int rc;
     
    10561046}
    10571047
    1058 struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window)
     1048const struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window)
    10591049{
    10601050    int rc = RTCritSectEnter(&window->CompositorLock);
    10611051    if (RT_SUCCESS(rc))
    10621052    {
    1063         VBOXVR_SCR_COMPOSITOR * pCompositor = window->pCompositor;
     1053        const VBOXVR_SCR_COMPOSITOR * pCompositor = window->pCompositor;
    10641054        if (pCompositor)
    10651055            return pCompositor;
     
    10891079}
    10901080
    1091 int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor)
     1081int renderspuVBoxCompositorTryAcquire(WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR **ppCompositor)
    10921082{
    10931083    int rc = RTCritSectTryEnter(&window->CompositorLock);
     
    15511541        break;
    15521542
     1543    case GL_HH_SET_TMPCTX_MAKE_CURRENT:
     1544        if (type == GL_BYTE && count == sizeof (void*))
     1545                memcpy(&render_spu.blitterDispatch.MakeCurrent, values, count);
     1546        else
     1547                crWarning("unexpected type(%#x) - count(%d) pair", type, count);
     1548        break;
     1549
    15531550    default:
    15541551#if 0
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.h

    r50041 r50095  
    2929#include "cr_server.h"
    3030#include "cr_blitter.h"
     31#include "cr_compositor.h"
    3132
    3233#include <iprt/cdefs.h>
     
    103104    char *title;
    104105
    105     PVBOXVR_SCR_COMPOSITOR pCompositor;
     106    const VBOXVR_SCR_COMPOSITOR *pCompositor;
    106107    /* the composotor lock is used to synchronize the current compositor access,
    107108     * i.e. the compositor can be accessed by a gui refraw thread,
     
    285286    CRConnection **swap_conns;
    286287
    287     SPUDispatchTable *blitterDispatch;
     288    SPUDispatchTable blitterDispatch;
    288289    CRHashTable *blitterTable;
    289290
     
    406407extern void renderspu_SystemSwapBuffers( WindowInfo *window, GLint flags );
    407408extern void renderspu_SystemReparentWindow(WindowInfo *window);
    408 extern void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry );
     409extern void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry );
    409410uint32_t renderspu_SystemPostprocessFunctions(SPUNamedFunctionTable *aFunctions, uint32_t cFunctions, uint32_t cTable);
    410411extern void renderspu_GCWindow(void);
    411412extern int renderspuCreateFunctions( SPUNamedFunctionTable table[] );
    412 extern void renderspuVBoxCompositorSet( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor);
     413extern void renderspuVBoxCompositorSet( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor);
    413414extern void renderspuVBoxCompositorClearAll();
    414415extern int renderspuVBoxCompositorLock(WindowInfo *window);
    415416extern int renderspuVBoxCompositorUnlock(WindowInfo *window);
    416 extern struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window);
    417 extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR **ppCompositor);
     417extern const struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window);
     418extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR **ppCompositor);
    418419extern void renderspuVBoxCompositorRelease( WindowInfo *window);
    419 extern void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData );
     420extern void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData );
    420421extern PCR_BLITTER renderspuVBoxPresentBlitterGet( WindowInfo *window );
    421422void renderspuVBoxPresentBlitterCleanup( WindowInfo *window );
     
    429430extern GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id );
    430431extern GLboolean renderspuInitVisual(VisualInfo *pVisInfo, const char *displayName, GLbitfield visAttribs);
    431 extern void renderspuVBoxCompositorBlit ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter);
    432 extern void renderspuVBoxCompositorBlitStretched ( struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY);
     432extern void renderspuVBoxCompositorBlit ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter);
     433extern void renderspuVBoxCompositorBlitStretched ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY);
    433434extern GLint renderspuCreateContextEx(const char *dpyName, GLint visBits, GLint id, GLint shareCtx);
    434435extern GLint renderspuWindowCreateEx( const char *dpyName, GLint visBits, GLint id );
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_agl.c

    r48291 r50095  
    608608}
    609609
    610 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR * pCompositor, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
     610void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
    611611{
    612612    renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0);
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa.c

    r50041 r50095  
    155155}
    156156
    157 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
     157void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
    158158{
    159159    cocoaViewPresentComposition(window->window, pChangedEntry);
     
    271271    if (!CrGlslIsInited(&render_spu.GlobalShaders))
    272272    {
    273         CrGlslInit(&render_spu.GlobalShaders, render_spu.blitterDispatch);
     273        CrGlslInit(&render_spu.GlobalShaders, &render_spu.blitterDispatch);
    274274    }
    275275
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.h

    r45132 r50095  
    2323#include <OpenGL/OpenGL.h>
    2424#include <cr_vreg.h>
     25#include <cr_compositor.h>
     26
    2527
    2628RT_C_DECLS_BEGIN
     
    4749void cocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef pCtx);
    4850void cocoaViewSetVisibleRegion(NativeNSViewRef pView, GLint cRects, const GLint* paRects);
    49 void cocoaViewPresentComposition(NativeNSViewRef pView, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry);
     51void cocoaViewPresentComposition(NativeNSViewRef pView, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry);
    5052
    5153RT_C_DECLS_END
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_cocoa_helper.m

    r49868 r50095  
    373373- (void)vboxTryDraw;
    374374- (void)vboxTryDrawUI;
    375 - (void)vboxPresent:(PVBOXVR_SCR_COMPOSITOR)pCompositor;
    376 - (void)vboxPresentCS:(PVBOXVR_SCR_COMPOSITOR)pCompositor;
    377 - (void)vboxPresentToDockTileCS:(PVBOXVR_SCR_COMPOSITOR)pCompositor;
    378 - (void)vboxPresentToViewCS:(PVBOXVR_SCR_COMPOSITOR)pCompositor;
    379 - (void)presentComposition:(PVBOXVR_SCR_COMPOSITOR_ENTRY)pChangedEntry;
     375- (void)vboxPresent:(const VBOXVR_SCR_COMPOSITOR*)pCompositor;
     376- (void)vboxPresentCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor;
     377- (void)vboxPresentToDockTileCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor;
     378- (void)vboxPresentToViewCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor;
     379- (void)presentComposition:(const VBOXVR_SCR_COMPOSITOR_ENTRY*)pChangedEntry;
    380380- (void)vboxBlitterSyncWindow;
    381381
     
    790790    [self deleteDockTile];
    791791   
    792     if (m_pGLCtx)
    793     {
    794         if ([m_pGLCtx view] == self)
    795             [m_pGLCtx clearDrawable];
    796 
    797         m_pGLCtx = nil;
    798     }
     792    [self setGLCtx:nil];
     793   
    799794    if (m_pSharedGLCtx)
    800795    {
     
    808803        CrBltTerm(m_pBlitter);
    809804       
     805        RTMemFree(m_pBlitter);
     806       
    810807        m_pBlitter = nil;
    811808    }
     
    836833    /* ensure the context drawable is cleared to avoid holding a reference to inexistent view */
    837834    if (m_pGLCtx)
     835    {
    838836        [m_pGLCtx clearDrawable];
     837        [m_pGLCtx release];
     838        /*[m_pGLCtx performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];*/
     839    }
    839840
    840841    m_pGLCtx = pCtx;
     842    if (pCtx)
     843        [pCtx retain];
    841844}
    842845
     
    11131116    if ([self lockFocusIfCanDraw])
    11141117    {
    1115         VBOXVR_SCR_COMPOSITOR *pCompositor = NULL;
     1118        const const VBOXVR_SCR_COMPOSITOR *pCompositor = NULL;
    11161119        if (!m_pSharedGLCtx)
    11171120            {
     
    11231126                if (m_pBlitter)
    11241127                {
    1125                     int rc = CrBltInit(m_pBlitter, NULL, false, false, &render_spu.GlobalShaders, render_spu.blitterDispatch);
     1128                    int rc = CrBltInit(m_pBlitter, NULL, false, false, &render_spu.GlobalShaders, &render_spu.blitterDispatch);
    11261129                    if (RT_SUCCESS(rc))
    11271130                    {
     
    12181221             * while here we do a reverse order: acquire compositor lock being in gui thread.
    12191222             * this is why we do only try acquire and re-submit repaint event if compositor lock is busy */
    1220             VBOXVR_SCR_COMPOSITOR *pCompositor = NULL;
     1223            const VBOXVR_SCR_COMPOSITOR *pCompositor = NULL;
    12211224            int rc = renderspuVBoxCompositorTryAcquire(m_pWinInfo, &pCompositor);
    12221225            if (RT_SUCCESS(rc))
     
    12281231            else if (rc == VERR_SEM_BUSY)
    12291232            {
     1233                Assert(!pCompositor);
    12301234                /* re-issue to the gui thread */
    12311235# ifdef DEBUG_misha
     
    12341238                [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(vboxTryDrawUI) userInfo:nil repeats:NO];
    12351239            }
    1236             else
     1240            else if (rc != VERR_INVALID_STATE) /* VERR_INVALID_STATE means no compositor, which is ok */
    12371241            {
     1242                Assert(!pCompositor);
    12381243                /* this is somewhat we do not expect */
    12391244                DEBUG_WARN(("renderspuVBoxCompositorTryAcquire failed rc %d", rc));
    12401245            }
    12411246#else
    1242                 VBOXVR_SCR_COMPOSITOR *pCompositor = renderspuVBoxCompositorAcquire(m_pWinInfo);
     1247                const VBOXVR_SCR_COMPOSITOR *pCompositor = renderspuVBoxCompositorAcquire(m_pWinInfo);
    12431248                if (pCompositor)
    12441249                {
     
    12611266}
    12621267
    1263 - (void)vboxPresent:(PVBOXVR_SCR_COMPOSITOR)pCompositor
     1268- (void)vboxPresent:(const VBOXVR_SCR_COMPOSITOR*)pCompositor
    12641269{
    12651270    VBOX_CR_RENDER_CTX_INFO CtxInfo;   
     
    12851290}
    12861291
    1287 - (void)vboxPresentCS:(PVBOXVR_SCR_COMPOSITOR)pCompositor
     1292- (void)vboxPresentCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor
    12881293{
    12891294        {
     
    13381343}
    13391344
    1340 - (void)vboxPresentToViewCS:(PVBOXVR_SCR_COMPOSITOR)pCompositor
     1345- (void)vboxPresentToViewCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor
    13411346{
    13421347    NSRect r = [self frame];
     
    13451350
    13461351#if 1 /* Set to 0 to see the docktile instead of the real output */
    1347     VBOXVR_SCR_COMPOSITOR_ITERATOR CIter;
    1348     PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
     1352    VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter;
     1353    const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry;
    13491354       
    1350     CrVrScrCompositorIterInit(pCompositor, &CIter);
     1355    CrVrScrCompositorConstIterInit(pCompositor, &CIter);
    13511356       
    13521357    glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
     
    13581363    CrVrScrCompositorGetStretching(pCompositor, &xStretch, &yStretch);
    13591364       
    1360     while ((pEntry = CrVrScrCompositorIterNext(&CIter)) != NULL)
     1365    while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL)
    13611366    {
    13621367        uint32_t cRegions;
     
    13671372        {
    13681373            uint32_t i;
    1369             int rc = CrBltEnter(m_pBlitter, NULL, NULL);
     1374            int rc = CrBltEnter(m_pBlitter);
    13701375            if (RT_SUCCESS(rc))
    13711376            {                   
     
    13741379                    const RTRECT * pSrcRect = &paSrcRegions[i];
    13751380                    const RTRECT * pDstRect = &paDstRegions[i];
    1376                     RTRECT SrcRect, DstRect, RestrictSrcRect, RestrictDstRect;
    1377                    
     1381                    RTRECT DstRect, RestrictDstRect;
     1382                    RTRECT SrcRect, RestrictSrcRect;
     1383
    13781384                    vboxNSRectToRect(&m_RootRect, &RestrictDstRect);
    13791385                    VBoxRectIntersected(&RestrictDstRect, pDstRect, &DstRect);
     
    13831389
    13841390                    VBoxRectTranslate(&DstRect, -RestrictDstRect.xLeft, -RestrictDstRect.yTop);
    1385                        
     1391
    13861392                    vboxNSRectToRectUnstretched(&m_RootRect, &RestrictSrcRect, xStretch, yStretch);
     1393                    VBoxRectTranslate(&RestrictSrcRect, -CrVrScrCompositorEntryRectGet(pEntry)->xLeft, -CrVrScrCompositorEntryRectGet(pEntry)->yTop);
    13871394                    VBoxRectIntersected(&RestrictSrcRect, pSrcRect, &SrcRect);
    13881395                   
     
    13931400                    pDstRect = &DstRect;
    13941401                   
    1395                     CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags | CRBLT_F_NOALPHA);
     1402                    const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry);
     1403                   
     1404                    CrBltBlitTexMural(m_pBlitter, true, CrTdTexGet(pTexData), pSrcRect, pDstRect, 1, fFlags | CRBLT_F_NOALPHA);
    13961405                }
    13971406                CrBltLeave(m_pBlitter);
     
    14161425}
    14171426
    1418 - (void)presentComposition:(PVBOXVR_SCR_COMPOSITOR_ENTRY)pChangedEntry
     1427- (void)presentComposition:(const VBOXVR_SCR_COMPOSITOR_ENTRY*)pChangedEntry
    14191428{
    14201429    [self vboxTryDraw];
     
    14381447    Assert(WinInfo.height = m_RootRect.size.height);
    14391448
    1440     /*CrBltMuralSetCurrent(m_pBlitter, NULL);*/
    1441    
    1442     CrBltMuralSetCurrent(m_pBlitter, &WinInfo);
     1449    /*CrBltMuralSetCurrentInfo(m_pBlitter, NULL);*/
     1450   
     1451    CrBltMuralSetCurrentInfo(m_pBlitter, &WinInfo);
    14431452    CrBltCheckUpdateViewport(m_pBlitter);
    14441453}
     
    14471456static int g_cVBoxTgaCtr = 0;
    14481457#endif
    1449 - (void)vboxPresentToDockTileCS:(PVBOXVR_SCR_COMPOSITOR)pCompositor
     1458- (void)vboxPresentToDockTileCS:(const VBOXVR_SCR_COMPOSITOR*)pCompositor
    14501459{
    14511460    NSRect r        = [self frame];
     
    14601469         * heavy performance wise. */
    14611470        uint64_t uiNewTime = RTTimeMilliTS();
    1462         VBOXVR_SCR_COMPOSITOR_ITERATOR CIter;
    1463         PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry;
     1471        VBOXVR_SCR_COMPOSITOR_CONST_ITERATOR CIter;
     1472        const VBOXVR_SCR_COMPOSITOR_ENTRY *pEntry;
    14641473       
    14651474        if (uiNewTime - m_uiDockUpdateTime > 200)
     
    14921501            CrVrScrCompositorGetStretching(pCompositor, &xStretch, &yStretch);
    14931502           
    1494             CrVrScrCompositorIterInit(pCompositor, &CIter);
    1495             while ((pEntry = CrVrScrCompositorIterNext(&CIter)) != NULL)
     1503            CrVrScrCompositorConstIterInit(pCompositor, &CIter);
     1504            while ((pEntry = CrVrScrCompositorConstIterNext(&CIter)) != NULL)
    14961505            {
    14971506                uint32_t cRegions;
     
    15021511                {
    15031512                    uint32_t i;
    1504                     int rc = CrBltEnter(m_pBlitter, NULL, NULL);
     1513                    int rc = CrBltEnter(m_pBlitter);
    15051514                    if (RT_SUCCESS(rc))
    15061515                    {                   
     
    15221531                       
    15231532                            vboxNSRectToRectUnstretched(&m_RootRect, &RestrictSrcRect, xStretch, yStretch);
     1533                            VBoxRectTranslate(&RestrictSrcRect, -CrVrScrCompositorEntryRectGet(pEntry)->xLeft, -CrVrScrCompositorEntryRectGet(pEntry)->yTop);
    15241534                            VBoxRectIntersected(&RestrictSrcRect, pSrcRect, &SrcRect);
    15251535                   
     
    15301540                            pDstRect = &DstRect;
    15311541                           
    1532                             CrBltBlitTexMural(m_pBlitter, true, &pEntry->Tex, pSrcRect, pDstRect, 1, fFlags);
     1542                            const CR_TEXDATA *pTexData = CrVrScrCompositorEntryTexGet(pEntry);
     1543                           
     1544                            CrBltBlitTexMural(m_pBlitter, true, CrTdTexGet(pTexData), pSrcRect, pDstRect, 1, fFlags);
    15331545                        }
    15341546                        CrBltLeave(m_pBlitter);
     
    17471759    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
    17481760
    1749     /*
    17501761    [pCtx release];
    1751     */
     1762    /*[pCtx performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];*/
    17521763
    17531764    [pPool release];
     
    19061917}
    19071918
    1908 void cocoaViewPresentComposition(NativeNSViewRef pView, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry)
     1919void cocoaViewPresentComposition(NativeNSViewRef pView, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry)
    19091920{
    19101921    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_glx.c

    r50041 r50095  
    579579                    if (pWindow)
    580580                    {
    581                         struct VBOXVR_SCR_COMPOSITOR * pCompositor;
     581                        const struct VBOXVR_SCR_COMPOSITOR * pCompositor;
    582582
    583583                        pCompositor = renderspuVBoxCompositorAcquire(pWindow);
     
    19691969}
    19701970
    1971 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
     1971void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
    19721972{
    19731973    /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl,
     
    19761976     * @todo: change to some more generic macro name */
    19771977#ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD
    1978     struct VBOXVR_SCR_COMPOSITOR *pCompositor;
     1978    const struct VBOXVR_SCR_COMPOSITOR *pCompositor;
    19791979    /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */
    19801980    int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor);
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_init.c

    r50041 r50095  
    386386    crSPUCopyDispatchTable( &(render_spu.self), self );
    387387
    388     render_spu.blitterDispatch = &(render_spu.self);
     388    crSPUInitDispatchTable( &(render_spu.blitterDispatch) );
     389    crSPUCopyDispatchTable( &(render_spu.blitterDispatch), self );
    389390
    390391    render_spu.server = (CRServer *)(self->server);
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c

    r50041 r50095  
    431431            if (pWindow)
    432432            {
    433                 struct VBOXVR_SCR_COMPOSITOR * pCompositor;
     433                const struct VBOXVR_SCR_COMPOSITOR * pCompositor;
    434434
    435435                pCompositor = renderspuVBoxCompositorAcquire(pWindow);
     
    12521252}
    12531253
    1254 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
     1254void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
    12551255{
    12561256    /* the CR_RENDER_FORCE_PRESENT_MAIN_THREAD is actually inherited from cocoa backend impl,
     
    12591259     * @todo: change to some more generic macro name */
    12601260#ifndef CR_RENDER_FORCE_PRESENT_MAIN_THREAD
    1261     struct VBOXVR_SCR_COMPOSITOR *pCompositor;
     1261    const struct VBOXVR_SCR_COMPOSITOR *pCompositor;
    12621262    /* we do not want to be blocked with the GUI thread here, so only draw her eif we are really able to do that w/o bllocking */
    12631263    int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor);
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