96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/* $Id$ */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/** @file
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * Visible Regions processing API
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync */
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync/*
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync * Copyright (C) 2012-2014 Oracle Corporation
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync *
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * available from http://www.virtualbox.org. This file is free software;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * you can redistribute it and/or modify it under the terms of the GNU
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * General Public License (GPL) as published by the Free Software
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync */
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#ifndef ___cr_vreg_h_
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#define ___cr_vreg_h_
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#include <iprt/list.h>
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync#include <iprt/types.h>
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync#include <iprt/mem.h>
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync#include <iprt/string.h>
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync#include <iprt/assert.h>
8be5264d31d6a6ec949ff2285764c9af57298b52vboxsync#include <iprt/critsect.h>
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync#include <iprt/asm.h>
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync#ifndef IN_RING0
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync# define VBOXVREGDECL(_type) DECLEXPORT(_type)
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync#else
c51890c6c8865dbcebc76aacb395dcbf4dd8b5d1vboxsync/** @todo r=bird: Using RTDECL is just SOO wrong! */
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync# define VBOXVREGDECL(_type) RTDECL(_type)
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync#endif
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsyncRT_C_DECLS_BEGIN
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef struct VBOXVR_LIST
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync RTLISTANCHOR ListHead;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync uint32_t cEntries;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_LIST;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_LIST *PVBOXVR_LIST;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_LIST const *PCVBOXVR_LIST;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(int) VBoxRectCmp(PCRTRECT pRect1, PCRTRECT pRect2)
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync return memcmp(pRect1, pRect2, sizeof(*pRect1));
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync}
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync#ifndef IN_RING0
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync# define CR_FLOAT_RCAST(_t, _v) ((_t)((float)(_v) + 0.5))
aa0deb489db448ba3b1e2f4dfd1fbaf8cb7a9d95vboxsync
6e519506bee0a7f680824b1ca5d8e3fead3ae95evboxsyncDECLINLINE(void) VBoxRectScale(PRTRECT pRect, float xScale, float yScale)
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft * xScale);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop * yScale);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight * xScale);
6e519506bee0a7f680824b1ca5d8e3fead3ae95evboxsync pRect->yBottom = CR_FLOAT_RCAST(int32_t, pRect->yBottom * yScale);
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync}
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectScaled(PCRTRECT pRect, float xScale, float yScale, PRTRECT pResult)
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync{
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync *pResult = *pRect;
6e519506bee0a7f680824b1ca5d8e3fead3ae95evboxsync VBoxRectScale(pResult, xScale, yScale);
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync}
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsyncDECLINLINE(void) VBoxRectUnscale(PRTRECT pRect, float xScale, float yScale)
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft / xScale);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop / yScale);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight / xScale);
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync pRect->yBottom = CR_FLOAT_RCAST(int32_t, pRect->yBottom / yScale);
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync}
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectUnscaled(PCRTRECT pRect, float xScale, float yScale, PRTRECT pResult)
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync{
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync *pResult = *pRect;
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync VBoxRectUnscale(pResult, xScale, yScale);
7ea49b4765b66fc68d2e6c1cb2a647b53a4aea24vboxsync}
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync#endif /* IN_RING0 */
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectIntersect(PRTRECT pRect1, PCRTRECT pRect2)
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync{
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync Assert(pRect1);
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync Assert(pRect2);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect1->xLeft = RT_MAX(pRect1->xLeft, pRect2->xLeft);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect1->yTop = RT_MAX(pRect1->yTop, pRect2->yTop);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect1->xRight = RT_MIN(pRect1->xRight, pRect2->xRight);
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync pRect1->yBottom = RT_MIN(pRect1->yBottom, pRect2->yBottom);
01b42e7722398cb01d56485aef9af15f1c417769vboxsync /* ensure the rect is valid */
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect1->xRight = RT_MAX(pRect1->xRight, pRect1->xLeft);
01b42e7722398cb01d56485aef9af15f1c417769vboxsync pRect1->yBottom = RT_MAX(pRect1->yBottom, pRect1->yTop);
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync}
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectIntersected(PCRTRECT pRect1, PCRTRECT pRect2, PRTRECT pResult)
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync{
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync *pResult = *pRect1;
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync VBoxRectIntersect(pResult, pRect2);
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync}
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectTranslate(PRTRECT pRect, int32_t x, int32_t y)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync pRect->xLeft += x;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync pRect->yTop += y;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync pRect->xRight += x;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync pRect->yBottom += y;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectTranslated(PCRTRECT pRect, int32_t x, int32_t y, PRTRECT pResult)
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync{
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync *pResult = *pRect;
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync VBoxRectTranslate(pResult, x, y);
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync}
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectInvertY(PRTRECT pRect)
24e27201b1438d88569467f104a0e3cb1df190edvboxsync{
24e27201b1438d88569467f104a0e3cb1df190edvboxsync int32_t y = pRect->yTop;
24e27201b1438d88569467f104a0e3cb1df190edvboxsync pRect->yTop = pRect->yBottom;
24e27201b1438d88569467f104a0e3cb1df190edvboxsync pRect->yBottom = y;
24e27201b1438d88569467f104a0e3cb1df190edvboxsync}
24e27201b1438d88569467f104a0e3cb1df190edvboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectInvertedY(PCRTRECT pRect, PRTRECT pResult)
24e27201b1438d88569467f104a0e3cb1df190edvboxsync{
24e27201b1438d88569467f104a0e3cb1df190edvboxsync *pResult = *pRect;
24e27201b1438d88569467f104a0e3cb1df190edvboxsync VBoxRectInvertY(pResult);
24e27201b1438d88569467f104a0e3cb1df190edvboxsync}
24e27201b1438d88569467f104a0e3cb1df190edvboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectMove(PRTRECT pRect, int32_t x, int32_t y)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync int32_t cx = pRect->xRight - pRect->xLeft;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync int32_t cy = pRect->yBottom - pRect->yTop;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync pRect->xLeft = x;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync pRect->yTop = y;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->xRight = cx + x;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync pRect->yBottom = cy + y;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxRectMoved(PCRTRECT pRect, int32_t x, int32_t y, PRTRECT pResult)
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync{
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync *pResult = *pRect;
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync VBoxRectMove(pResult, x, y);
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync}
7b6926b2bf44f326f40e1d9d1ce33a4dff0a2c67vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(bool) VBoxRectCovers(PCRTRECT pRect, PCRTRECT pCovered)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync AssertPtr(pRect);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync AssertPtr(pCovered);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync if (pRect->xLeft > pCovered->xLeft)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return false;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync if (pRect->yTop > pCovered->yTop)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return false;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync if (pRect->xRight < pCovered->xRight)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return false;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync if (pRect->yBottom < pCovered->yBottom)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return false;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return true;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(bool) VBoxRectIsZero(PCRTRECT pRect)
66a94fee6b0acc21c078369f49d97020cc03ab11vboxsync{
66a94fee6b0acc21c078369f49d97020cc03ab11vboxsync return pRect->xLeft == pRect->xRight || pRect->yTop == pRect->yBottom;
66a94fee6b0acc21c078369f49d97020cc03ab11vboxsync}
66a94fee6b0acc21c078369f49d97020cc03ab11vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(bool) VBoxRectIsIntersect(PCRTRECT pRect1, PCRTRECT pRect2)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync return !( (pRect1->xLeft < pRect2->xLeft && pRect1->xRight <= pRect2->xLeft)
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync || (pRect2->xLeft < pRect1->xLeft && pRect2->xRight <= pRect1->xLeft)
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync || (pRect1->yTop < pRect2->yTop && pRect1->yBottom <= pRect2->yTop)
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync || (pRect2->yTop < pRect1->yTop && pRect2->yBottom <= pRect1->yTop) );
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(uint32_t) VBoxVrListRectsCount(PCVBOXVR_LIST pList)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return pList->cEntries;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(bool) VBoxVrListIsEmpty(PCVBOXVR_LIST pList)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return !VBoxVrListRectsCount(pList);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsyncDECLINLINE(void) VBoxVrListInit(PVBOXVR_LIST pList)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync RTListInit(&pList->ListHead);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync pList->cEntries = 0;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsyncVBOXVREGDECL(void) VBoxVrListClear(PVBOXVR_LIST pList);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
d331ca5667e19a46f1e967617184483bec985e86vboxsync/* moves list data to pDstList and empties the pList */
d331ca5667e19a46f1e967617184483bec985e86vboxsyncVBOXVREGDECL(void) VBoxVrListMoveTo(PVBOXVR_LIST pList, PVBOXVR_LIST pDstList);
d331ca5667e19a46f1e967617184483bec985e86vboxsync
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsyncVBOXVREGDECL(void) VBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListCmp(PCVBOXVR_LIST pList1, PCVBOXVR_LIST pList2);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListRectsSet(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, PRTRECT paRects);
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListClone(PCVBOXVR_LIST pList, VBOXVR_LIST *pDstList);
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync/* NOTE: with the current implementation the VBoxVrListIntersect is faster than VBoxVrListRectsIntersect,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync * i.e. VBoxVrListRectsIntersect is actually a convenience function that create a temporary list and calls
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync * VBoxVrListIntersect internally. */
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListRectsIntersect(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrListIntersect(PVBOXVR_LIST pList, PCVBOXVR_LIST pList2, bool *pfChanged);
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync
b554f49f62cfc1184e3b4b49ec337eceffafbb71vboxsyncVBOXVREGDECL(int) VBoxVrInit(void);
b554f49f62cfc1184e3b4b49ec337eceffafbb71vboxsyncVBOXVREGDECL(void) VBoxVrTerm(void);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsynctypedef struct VBOXVR_LIST_ITERATOR
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync PVBOXVR_LIST pList;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync PRTLISTNODE pNextEntry;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_LIST_ITERATOR;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_LIST_ITERATOR *PVBOXVR_LIST_ITERATOR;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_LIST_ITERATOR const *PCVBOXVR_LIST_ITERATOR;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsyncDECLINLINE(void) VBoxVrListIterInit(PVBOXVR_LIST pList, PVBOXVR_LIST_ITERATOR pIter)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync pIter->pList = pList;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync pIter->pNextEntry = pList->ListHead.pNext;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync}
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsynctypedef struct VBOXVR_REG
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync RTLISTNODE ListEntry;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync RTRECT Rect;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_REG;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_REG *PVBOXVR_REG;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_REG const *PCVBOXVR_REG;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync#define PVBOXVR_REG_FROM_ENTRY(_pEntry) RT_FROM_MEMBER(_pEntry, VBOXVR_REG, ListEntry)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
6715b8ee12df87a566f92449a44e907ec10aef91vboxsyncDECLINLINE(PCRTRECT) VBoxVrListIterNext(PVBOXVR_LIST_ITERATOR pIter)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync PRTLISTNODE pNextEntry = pIter->pNextEntry;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync if (pNextEntry != &pIter->pList->ListHead)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync {
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PCRTRECT pRect = &PVBOXVR_REG_FROM_ENTRY(pNextEntry)->Rect;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync pIter->pNextEntry = pNextEntry->pNext;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync return pRect;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync }
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync return NULL;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync}
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef struct VBOXVR_COMPOSITOR_ENTRY
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync RTLISTNODE Node;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync VBOXVR_LIST Vr;
ea1cc8df95dba6fca9c36c94f565ef95c7802a36vboxsync uint32_t cRefs;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_COMPOSITOR_ENTRY;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_COMPOSITOR_ENTRY *PVBOXVR_COMPOSITOR_ENTRY;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_COMPOSITOR_ENTRY const *PCVBOXVR_COMPOSITOR_ENTRY;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsyncstruct VBOXVR_COMPOSITOR;
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_RELEASED(const struct VBOXVR_COMPOSITOR *pCompositor,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry);
ea1cc8df95dba6fca9c36c94f565ef95c7802a36vboxsynctypedef FNVBOXVRCOMPOSITOR_ENTRY_RELEASED *PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED;
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef struct VBOXVR_COMPOSITOR
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync RTLISTANCHOR List;
ea1cc8df95dba6fca9c36c94f565ef95c7802a36vboxsync PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_COMPOSITOR;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_COMPOSITOR *PVBOXVR_COMPOSITOR;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_COMPOSITOR const *PCVBOXVR_COMPOSITOR;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef DECLCALLBACK(bool) FNVBOXVRCOMPOSITOR_VISITOR(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync void *pvVisitor);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsynctypedef FNVBOXVRCOMPOSITOR_VISITOR *PFNVBOXVRCOMPOSITOR_VISITOR;
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
ea1cc8df95dba6fca9c36c94f565ef95c7802a36vboxsyncVBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased);
8cfe2efff2058bd07777056112155ea5353dcfbavboxsyncVBOXVREGDECL(void) VBoxVrCompositorClear(PVBOXVR_COMPOSITOR pCompositor);
8cfe2efff2058bd07777056112155ea5353dcfbavboxsyncVBOXVREGDECL(void) VBoxVrCompositorRegionsClear(PVBOXVR_COMPOSITOR pCompositor, bool *pfChanged);
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsyncVBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(bool) VBoxVrCompositorEntryIsInList(PCVBOXVR_COMPOSITOR_ENTRY pEntry)
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync{
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync return !VBoxVrListIsEmpty(&pEntry->Vr);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync}
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define CRBLT_F_LINEAR 0x00000001
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define CRBLT_F_INVERT_SRC_YCOORDS 0x00000002
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define CRBLT_F_INVERT_DST_YCOORDS 0x00000004
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define CRBLT_F_INVERT_YCOORDS (CRBLT_F_INVERT_SRC_YCOORDS | CRBLT_F_INVERT_DST_YCOORDS)
d7bd3e8bc4c337f385a92e0e5528525abba906c2vboxsync/* the blit operation with discard the source alpha channel values and set the destination alpha values to 1.0 */
d7bd3e8bc4c337f385a92e0e5528525abba906c2vboxsync#define CRBLT_F_NOALPHA 0x00000010
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define CRBLT_FTYPE_XOR CRBLT_F_INVERT_YCOORDS
8d1da51eb6665874aa82bf03668e03d1a0d63223vboxsync#define CRBLT_FTYPE_OR (CRBLT_F_LINEAR | CRBLT_F_NOALPHA)
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define CRBLT_FOP_COMBINE(_f1, _f2) ((((_f1) ^ (_f2)) & CRBLT_FTYPE_XOR) | (((_f1) | (_f2)) & CRBLT_FTYPE_OR))
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync#define CRBLT_FLAGS_FROM_FILTER(_f) ( ((_f) & GL_LINEAR) ? CRBLT_F_LINEAR : 0)
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync#define CRBLT_FILTER_FROM_FLAGS(_f) (((_f) & CRBLT_F_LINEAR) ? GL_LINEAR : GL_NEAREST)
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync/* compositor regions changed */
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define VBOXVR_COMPOSITOR_CF_REGIONS_CHANGED 0x00000001
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync/* other entries changed along while doing current entry modification
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync * always comes with VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED */
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define VBOXVR_COMPOSITOR_CF_OTHER_ENTRIES_REGIONS_CHANGED 0x00000002
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync/* only current entry regions changed
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync * can come wither with VBOXVR_COMPOSITOR_CF_REGIONS_CHANGED or with VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED */
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED 0x00000004
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync/* the given entry has replaced some other entry, while overal regions did NOT change.
6902a98267d5180fb081cb5273751d0a628bf04dvboxsync * always comes with VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED */
8cfe2efff2058bd07777056112155ea5353dcfbavboxsync#define VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED 0x00000008
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsync
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsyncVBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PVBOXVR_COMPOSITOR_ENTRY pNewEntry);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync uint32_t cRegions, PCRTRECT paRegions,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PVBOXVR_COMPOSITOR_ENTRY *ppReplacedEntry, uint32_t *pfChangeFlags);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PCVBOXVR_LIST pList2, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersectAll(PVBOXVR_COMPOSITOR pCompositor, uint32_t cRegions, PCRTRECT paRegions,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryListIntersectAll(PVBOXVR_COMPOSITOR pCompositor, PCVBOXVR_LIST pList2, bool *pfChanged);
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncVBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync int32_t x, int32_t y, bool *pfChanged);
ddd5bf03356cc0515b0f42ed9048a6364e7eb1e2vboxsyncVBOXVREGDECL(void) VBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor);
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(bool) VBoxVrCompositorIsEmpty(PCVBOXVR_COMPOSITOR pCompositor)
6ee161d72f994dd23bce113a7b1aef8fe60c1766vboxsync{
6ee161d72f994dd23bce113a7b1aef8fe60c1766vboxsync return RTListIsEmpty(&pCompositor->List);
6ee161d72f994dd23bce113a7b1aef8fe60c1766vboxsync}
6ee161d72f994dd23bce113a7b1aef8fe60c1766vboxsync
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsynctypedef struct VBOXVR_COMPOSITOR_ITERATOR
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync PVBOXVR_COMPOSITOR pCompositor;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync PRTLISTNODE pNextEntry;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_COMPOSITOR_ITERATOR;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_COMPOSITOR_ITERATOR *PVBOXVR_COMPOSITOR_ITERATOR;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
01df41f7a4e5f7de195a059541d1c89676da9673vboxsynctypedef struct VBOXVR_COMPOSITOR_CONST_ITERATOR
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PCVBOXVR_COMPOSITOR pCompositor;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PCRTLISTNODE pNextEntry;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_COMPOSITOR_CONST_ITERATOR;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_COMPOSITOR_CONST_ITERATOR *PVBOXVR_COMPOSITOR_CONST_ITERATOR;
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsyncDECLINLINE(void) VBoxVrCompositorIterInit(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ITERATOR pIter)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync pIter->pCompositor = pCompositor;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync pIter->pNextEntry = pCompositor->List.pNext;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync}
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(void) VBoxVrCompositorConstIterInit(PCVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync{
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync pIter->pCompositor = pCompositor;
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync pIter->pNextEntry = pCompositor->List.pNext;
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync}
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync#define VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(_p) RT_FROM_MEMBER(_p, VBOXVR_COMPOSITOR_ENTRY, Node)
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync#define VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(_p) RT_FROM_MEMBER(_p, const VBOXVR_COMPOSITOR_ENTRY, Node)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsyncDECLINLINE(PVBOXVR_COMPOSITOR_ENTRY) VBoxVrCompositorIterNext(PVBOXVR_COMPOSITOR_ITERATOR pIter)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync PRTLISTNODE pNextEntry = pIter->pNextEntry;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync if (pNextEntry != &pIter->pCompositor->List)
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync {
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync PVBOXVR_COMPOSITOR_ENTRY pEntry = VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(pNextEntry);
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync pIter->pNextEntry = pNextEntry->pNext;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync return pEntry;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync }
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync return NULL;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync}
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsyncDECLINLINE(PCVBOXVR_COMPOSITOR_ENTRY) VBoxVrCompositorConstIterNext(PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PCRTLISTNODE pNextEntry = pIter->pNextEntry;
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync if (pNextEntry != &pIter->pCompositor->List)
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync {
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync PCVBOXVR_COMPOSITOR_ENTRY pEntry = VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(pNextEntry);
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync pIter->pNextEntry = pNextEntry->pNext;
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync return pEntry;
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync }
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync return NULL;
01df41f7a4e5f7de195a059541d1c89676da9673vboxsync}
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsynctypedef struct VBOXVR_TEXTURE
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync{
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync int32_t width;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync int32_t height;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync uint32_t target;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync uint32_t hwid;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync} VBOXVR_TEXTURE;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_TEXTURE *PVBOXVR_TEXTURE;
89ca900d1870d002a185e83bf861ce463acd7de8vboxsynctypedef VBOXVR_TEXTURE const *PCVBOXVR_TEXTURE;
2f4c1bacd54af5063c3185cc8eab03e4e8ef9b90vboxsync
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsyncRT_C_DECLS_END
96a93b5e6bd7da64f6be955c9fd7569b80c8ae2evboxsync
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync#endif
89ca900d1870d002a185e83bf861ce463acd7de8vboxsync