VirtualBox

Changeset 53586 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 21, 2014 4:06:53 PM (10 years ago)
Author:
vboxsync
Message:

Some style cleanups (no actual changes).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h

    r50944 r53586  
    11/* $Id$ */
    2 
    32/** @file
    43 * Visible Regions processing API
     
    65
    76/*
    8  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    98 *
    109 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1615 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1716 */
     17
    1818#ifndef ___cr_vreg_h_
    1919#define ___cr_vreg_h_
     
    3939typedef struct VBOXVR_LIST
    4040{
    41     RTLISTNODE ListHead;
     41    RTLISTANCHOR ListHead;
    4242    uint32_t cEntries;
    43 } VBOXVR_LIST, *PVBOXVR_LIST;
    44 
    45 DECLINLINE(int) VBoxRectCmp(const RTRECT * pRect1, const RTRECT * pRect2)
    46 {
    47     return memcmp(pRect1, pRect2, sizeof (*pRect1));
     43} VBOXVR_LIST;
     44typedef VBOXVR_LIST *PVBOXVR_LIST;
     45typedef VBOXVR_LIST const *PCVBOXVR_LIST;
     46
     47DECLINLINE(int) VBoxRectCmp(PCRTRECT pRect1, PCRTRECT pRect2)
     48{
     49    return memcmp(pRect1, pRect2, sizeof(*pRect1));
    4850}
    4951
    5052#ifndef IN_RING0
    51 #define CR_FLOAT_RCAST(_t, _v) ((_t)((float)(_v) + 0.5))
     53# define CR_FLOAT_RCAST(_t, _v) ((_t)((float)(_v) + 0.5))
    5254
    5355DECLINLINE(void) VBoxRectScale(PRTRECT pRect, float xScale, float yScale)
    5456{
    55     pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft * xScale);
    56     pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop * yScale);
    57     pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight * xScale);
     57    pRect->xLeft   = CR_FLOAT_RCAST(int32_t, pRect->xLeft  * xScale);
     58    pRect->yTop    = CR_FLOAT_RCAST(int32_t, pRect->yTop    * yScale);
     59    pRect->xRight  = CR_FLOAT_RCAST(int32_t, pRect->xRight * xScale);
    5860    pRect->yBottom = CR_FLOAT_RCAST(int32_t, pRect->yBottom * yScale);
    5961}
    6062
    61 DECLINLINE(void) VBoxRectScaled(const RTRECT *pRect, float xScale, float yScale, PRTRECT pResult)
     63DECLINLINE(void) VBoxRectScaled(PCRTRECT pRect, float xScale, float yScale, PRTRECT pResult)
    6264{
    6365    *pResult = *pRect;
     
    6769DECLINLINE(void) VBoxRectUnscale(PRTRECT pRect, float xScale, float yScale)
    6870{
    69     pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft / xScale);
    70     pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop / yScale);
    71     pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight / xScale);
     71    pRect->xLeft   = CR_FLOAT_RCAST(int32_t, pRect->xLeft  / xScale);
     72    pRect->yTop    = CR_FLOAT_RCAST(int32_t, pRect->yTop    / yScale);
     73    pRect->xRight  = CR_FLOAT_RCAST(int32_t, pRect->xRight / xScale);
    7274    pRect->yBottom = CR_FLOAT_RCAST(int32_t, pRect->yBottom / yScale);
    7375}
    7476
    75 DECLINLINE(void) VBoxRectUnscaled(const RTRECT *pRect, float xScale, float yScale, PRTRECT pResult)
     77DECLINLINE(void) VBoxRectUnscaled(PCRTRECT pRect, float xScale, float yScale, PRTRECT pResult)
    7678{
    7779    *pResult = *pRect;
    7880    VBoxRectUnscale(pResult, xScale, yScale);
    7981}
    80 #endif
    81 
    82 DECLINLINE(void) VBoxRectIntersect(PRTRECT pRect1, const RTRECT * pRect2)
     82
     83#endif /* IN_RING0 */
     84
     85DECLINLINE(void) VBoxRectIntersect(PRTRECT pRect1, PCRTRECT pRect2)
    8386{
    8487    Assert(pRect1);
    8588    Assert(pRect2);
    86     pRect1->xLeft = RT_MAX(pRect1->xLeft, pRect2->xLeft);
    87     pRect1->yTop = RT_MAX(pRect1->yTop, pRect2->yTop);
    88     pRect1->xRight = RT_MIN(pRect1->xRight, pRect2->xRight);
     89    pRect1->xLeft   = RT_MAX(pRect1->xLeft,  pRect2->xLeft);
     90    pRect1->yTop    = RT_MAX(pRect1->yTop,    pRect2->yTop);
     91    pRect1->xRight  = RT_MIN(pRect1->xRight, pRect2->xRight);
    8992    pRect1->yBottom = RT_MIN(pRect1->yBottom, pRect2->yBottom);
    9093    /* ensure the rect is valid */
    91     pRect1->xRight = RT_MAX(pRect1->xRight, pRect1->xLeft);
     94    pRect1->xRight  = RT_MAX(pRect1->xRight, pRect1->xLeft);
    9295    pRect1->yBottom = RT_MAX(pRect1->yBottom, pRect1->yTop);
    9396}
    9497
    95 DECLINLINE(void) VBoxRectIntersected(const RTRECT *pRect1, const RTRECT * pRect2, RTRECT *pResult)
     98DECLINLINE(void) VBoxRectIntersected(PCRTRECT pRect1, PCRTRECT pRect2, PRTRECT pResult)
    9699{
    97100    *pResult = *pRect1;
     
    100103
    101104
    102 DECLINLINE(void) VBoxRectTranslate(RTRECT * pRect, int32_t x, int32_t y)
     105DECLINLINE(void) VBoxRectTranslate(PRTRECT pRect, int32_t x, int32_t y)
    103106{
    104107    pRect->xLeft   += x;
     
    108111}
    109112
    110 DECLINLINE(void) VBoxRectTranslated(const RTRECT * pRect, int32_t x, int32_t y, RTRECT *pResult)
     113DECLINLINE(void) VBoxRectTranslated(PCRTRECT pRect, int32_t x, int32_t y, PRTRECT pResult)
    111114{
    112115    *pResult = *pRect;
     
    114117}
    115118
    116 DECLINLINE(void) VBoxRectInvertY(RTRECT * pRect)
     119DECLINLINE(void) VBoxRectInvertY(PRTRECT pRect)
    117120{
    118121    int32_t y = pRect->yTop;
     
    121124}
    122125
    123 DECLINLINE(void) VBoxRectInvertedY(const RTRECT * pRect, RTRECT * pResult)
     126DECLINLINE(void) VBoxRectInvertedY(PCRTRECT pRect, PRTRECT pResult)
    124127{
    125128    *pResult = *pRect;
     
    127130}
    128131
    129 DECLINLINE(void) VBoxRectMove(RTRECT * pRect, int32_t x, int32_t y)
    130 {
    131     int32_t w = pRect->xRight - pRect->xLeft;
    132     int32_t h = pRect->yBottom - pRect->yTop;
     132DECLINLINE(void) VBoxRectMove(PRTRECT pRect, int32_t x, int32_t y)
     133{
     134    int32_t cx = pRect->xRight - pRect->xLeft;
     135    int32_t cy = pRect->yBottom - pRect->yTop;
    133136    pRect->xLeft   = x;
    134137    pRect->yTop    = y;
    135     pRect->xRight  = w + x;
    136     pRect->yBottom = h + y;
    137 }
    138 
    139 DECLINLINE(void) VBoxRectMoved(const RTRECT * pRect, int32_t x, int32_t y, RTRECT *pResult)
     138    pRect->xRight  = cx + x;
     139    pRect->yBottom = cy + y;
     140}
     141
     142DECLINLINE(void) VBoxRectMoved(PCRTRECT pRect, int32_t x, int32_t y, PRTRECT pResult)
    140143{
    141144    *pResult = *pRect;
     
    143146}
    144147
    145 DECLINLINE(bool) VBoxRectCovers(const RTRECT *pRect, const RTRECT *pCovered)
    146 {
    147     Assert(pRect);
    148     Assert(pCovered);
     148DECLINLINE(bool) VBoxRectCovers(PCRTRECT pRect, PCRTRECT pCovered)
     149{
     150    AssertPtr(pRect);
     151    AssertPtr(pCovered);
    149152    if (pRect->xLeft > pCovered->xLeft)
    150153        return false;
     
    158161}
    159162
    160 DECLINLINE(bool) VBoxRectIsZero(const RTRECT *pRect)
     163DECLINLINE(bool) VBoxRectIsZero(PCRTRECT pRect)
    161164{
    162165    return pRect->xLeft == pRect->xRight || pRect->yTop == pRect->yBottom;
    163166}
    164167
    165 DECLINLINE(bool) VBoxRectIsIntersect(const RTRECT * pRect1, const RTRECT * pRect2)
    166 {
    167     return !((pRect1->xLeft < pRect2->xLeft && pRect1->xRight <= pRect2->xLeft)
    168             || (pRect2->xLeft < pRect1->xLeft && pRect2->xRight <= pRect1->xLeft)
    169             || (pRect1->yTop < pRect2->yTop && pRect1->yBottom <= pRect2->yTop)
    170             || (pRect2->yTop < pRect1->yTop && pRect2->yBottom <= pRect1->yTop));
    171 }
    172 
    173 DECLINLINE(uint32_t) VBoxVrListRectsCount(const VBOXVR_LIST *pList)
     168DECLINLINE(bool) VBoxRectIsIntersect(PCRTRECT pRect1, PCRTRECT pRect2)
     169{
     170    return !(   (pRect1->xLeft < pRect2->xLeft && pRect1->xRight <= pRect2->xLeft)
     171             || (pRect2->xLeft < pRect1->xLeft && pRect2->xRight <= pRect1->xLeft)
     172             || (pRect1->yTop  < pRect2->yTop && pRect1->yBottom <= pRect2->yTop)
     173             || (pRect2->yTop  < pRect1->yTop  && pRect2->yBottom <= pRect1->yTop) );
     174}
     175
     176DECLINLINE(uint32_t) VBoxVrListRectsCount(PCVBOXVR_LIST pList)
    174177{
    175178    return pList->cEntries;
    176179}
    177180
    178 DECLINLINE(bool) VBoxVrListIsEmpty(const VBOXVR_LIST *pList)
     181DECLINLINE(bool) VBoxVrListIsEmpty(PCVBOXVR_LIST pList)
    179182{
    180183    return !VBoxVrListRectsCount(pList);
     
    194197VBOXVREGDECL(void) VBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y);
    195198
    196 VBOXVREGDECL(int) VBoxVrListCmp(const VBOXVR_LIST *pList1, const VBOXVR_LIST *pList2);
    197 
    198 VBOXVREGDECL(int) VBoxVrListRectsSet(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
    199 VBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
    200 VBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
    201 VBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, RTRECT * aRects);
    202 
    203 VBOXVREGDECL(int) VBoxVrListClone(const VBOXVR_LIST *pList, VBOXVR_LIST *pDstList);
     199VBOXVREGDECL(int) VBoxVrListCmp(PCVBOXVR_LIST pList1, PCVBOXVR_LIST pList2);
     200
     201VBOXVREGDECL(int) VBoxVrListRectsSet(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
     202VBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
     203VBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
     204VBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, PRTRECT paRects);
     205
     206VBOXVREGDECL(int) VBoxVrListClone(PCVBOXVR_LIST pList, VBOXVR_LIST *pDstList);
    204207
    205208/* NOTE: with the current implementation the VBoxVrListIntersect is faster than VBoxVrListRectsIntersect,
    206  * i.e. VBoxVrListRectsIntersect is actually a convenience function that create a temporary list and calls VBoxVrListIntersect internally */
    207 VBOXVREGDECL(int) VBoxVrListRectsIntersect(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged);
    208 VBOXVREGDECL(int) VBoxVrListIntersect(PVBOXVR_LIST pList, const VBOXVR_LIST *pList2, bool *pfChanged);
     209 * i.e. VBoxVrListRectsIntersect is actually a convenience function that create a temporary list and calls
     210 * VBoxVrListIntersect internally. */
     211VBOXVREGDECL(int) VBoxVrListRectsIntersect(PVBOXVR_LIST pList, uint32_t cRects, PCRTRECT paRects, bool *pfChanged);
     212VBOXVREGDECL(int) VBoxVrListIntersect(PVBOXVR_LIST pList, PCVBOXVR_LIST pList2, bool *pfChanged);
    209213
    210214VBOXVREGDECL(int) VBoxVrInit(void);
     
    215219    PVBOXVR_LIST pList;
    216220    PRTLISTNODE pNextEntry;
    217 } VBOXVR_LIST_ITERATOR, *PVBOXVR_LIST_ITERATOR;
     221} VBOXVR_LIST_ITERATOR;
     222typedef VBOXVR_LIST_ITERATOR *PVBOXVR_LIST_ITERATOR;
     223typedef VBOXVR_LIST_ITERATOR const *PCVBOXVR_LIST_ITERATOR;
    218224
    219225DECLINLINE(void) VBoxVrListIterInit(PVBOXVR_LIST pList, PVBOXVR_LIST_ITERATOR pIter)
     
    227233    RTLISTNODE ListEntry;
    228234    RTRECT Rect;
    229 } VBOXVR_REG, *PVBOXVR_REG;
    230 
    231 #define PVBOXVR_REG_FROM_ENTRY(_pEntry) ((PVBOXVR_REG)(((uint8_t*)(_pEntry)) - RT_OFFSETOF(VBOXVR_REG, ListEntry)))
     235} VBOXVR_REG;
     236typedef VBOXVR_REG *PVBOXVR_REG;
     237typedef VBOXVR_REG const *PCVBOXVR_REG;
     238
     239#define PVBOXVR_REG_FROM_ENTRY(_pEntry)     RT_FROM_MEMBER(_pEntry, VBOXVR_REG, ListEntry)
    232240
    233241DECLINLINE(PCRTRECT) VBoxVrListIterNext(PVBOXVR_LIST_ITERATOR pIter)
     
    236244    if (pNextEntry != &pIter->pList->ListHead)
    237245    {
    238         PCRTRECT pRect = &(PVBOXVR_REG_FROM_ENTRY(pNextEntry)->Rect);
     246        PCRTRECT pRect = &PVBOXVR_REG_FROM_ENTRY(pNextEntry)->Rect;
    239247        pIter->pNextEntry = pNextEntry->pNext;
    240248        return pRect;
     
    248256    VBOXVR_LIST Vr;
    249257    uint32_t cRefs;
    250 } VBOXVR_COMPOSITOR_ENTRY, *PVBOXVR_COMPOSITOR_ENTRY;
     258} VBOXVR_COMPOSITOR_ENTRY;
     259typedef VBOXVR_COMPOSITOR_ENTRY *PVBOXVR_COMPOSITOR_ENTRY;
     260typedef VBOXVR_COMPOSITOR_ENTRY const *PCVBOXVR_COMPOSITOR_ENTRY;
    251261
    252262struct VBOXVR_COMPOSITOR;
    253263
    254 typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_RELEASED(const struct VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry);
     264typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_RELEASED(const struct VBOXVR_COMPOSITOR *pCompositor,
     265                                                             PVBOXVR_COMPOSITOR_ENTRY pEntry,
     266                                                             PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry);
    255267typedef FNVBOXVRCOMPOSITOR_ENTRY_RELEASED *PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED;
    256268
    257269typedef struct VBOXVR_COMPOSITOR
    258270{
    259     RTLISTNODE List;
     271    RTLISTANCHOR List;
    260272    PFNVBOXVRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased;
    261 } VBOXVR_COMPOSITOR, *PVBOXVR_COMPOSITOR;
    262 
    263 typedef DECLCALLBACK(bool) FNVBOXVRCOMPOSITOR_VISITOR(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, void *pvVisitor);
     273} VBOXVR_COMPOSITOR;
     274typedef VBOXVR_COMPOSITOR *PVBOXVR_COMPOSITOR;
     275typedef VBOXVR_COMPOSITOR const *PCVBOXVR_COMPOSITOR;
     276
     277typedef DECLCALLBACK(bool) FNVBOXVRCOMPOSITOR_VISITOR(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     278                                                      void *pvVisitor);
    264279typedef FNVBOXVRCOMPOSITOR_VISITOR *PFNVBOXVRCOMPOSITOR_VISITOR;
    265280
     
    268283VBOXVREGDECL(void) VBoxVrCompositorRegionsClear(PVBOXVR_COMPOSITOR pCompositor, bool *pfChanged);
    269284VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry);
    270 DECLINLINE(bool) VBoxVrCompositorEntryIsInList(const VBOXVR_COMPOSITOR_ENTRY *pEntry)
     285
     286DECLINLINE(bool) VBoxVrCompositorEntryIsInList(PCVBOXVR_COMPOSITOR_ENTRY pEntry)
    271287{
    272288    return !VBoxVrListIsEmpty(&pEntry->Vr);
     
    284300#define CRBLT_FOP_COMBINE(_f1, _f2)     ((((_f1) ^ (_f2)) & CRBLT_FTYPE_XOR) | (((_f1) | (_f2)) & CRBLT_FTYPE_OR))
    285301
    286 #define CRBLT_FLAGS_FROM_FILTER(_f) ( ((_f) & GL_LINEAR) ? CRBLT_F_LINEAR : 0)
    287 #define CRBLT_FILTER_FROM_FLAGS(_f) (((_f) & CRBLT_F_LINEAR) ? GL_LINEAR : GL_NEAREST)
     302#define CRBLT_FLAGS_FROM_FILTER(_f)     ( ((_f) & GL_LINEAR) ? CRBLT_F_LINEAR : 0)
     303#define CRBLT_FILTER_FROM_FLAGS(_f)     (((_f) & CRBLT_F_LINEAR) ? GL_LINEAR : GL_NEAREST)
    288304
    289305/* compositor regions changed */
     
    301317
    302318VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry);
    303 VBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pNewEntry);
    304 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, PVBOXVR_COMPOSITOR_ENTRY *ppReplacedEntry, uint32_t *pfChangeFlags);
    305 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
    306 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
    307 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
    308 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, const VBOXVR_LIST *pList2, bool *pfChanged);
    309 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersectAll(PVBOXVR_COMPOSITOR pCompositor, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged);
    310 VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersectAll(PVBOXVR_COMPOSITOR pCompositor, const VBOXVR_LIST *pList2, bool *pfChanged);
    311 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, int32_t x, int32_t y, bool *pfChanged);
     319VBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     320                                                PVBOXVR_COMPOSITOR_ENTRY pNewEntry);
     321VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     322                                                  uint32_t cRegions, PCRTRECT paRegions,
     323                                                  PVBOXVR_COMPOSITOR_ENTRY *ppReplacedEntry, uint32_t *pfChangeFlags);
     324VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     325                                                    uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged);
     326VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     327                                                  uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged);
     328VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     329                                                        uint32_t cRegions, PCRTRECT paRegions, bool *pfChanged);
     330VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersect(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     331                                                     PCVBOXVR_LIST pList2, bool *pfChanged);
     332VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsIntersectAll(PVBOXVR_COMPOSITOR pCompositor, uint32_t cRegions, PCRTRECT paRegions,
     333                                                           bool *pfChanged);
     334VBOXVREGDECL(int) VBoxVrCompositorEntryListIntersectAll(PVBOXVR_COMPOSITOR pCompositor, PCVBOXVR_LIST pList2, bool *pfChanged);
     335VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry,
     336                                                        int32_t x, int32_t y, bool *pfChanged);
    312337VBOXVREGDECL(void) VBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor);
    313338
    314 DECLINLINE(bool) VBoxVrCompositorIsEmpty(const VBOXVR_COMPOSITOR *pCompositor)
     339DECLINLINE(bool) VBoxVrCompositorIsEmpty(PCVBOXVR_COMPOSITOR pCompositor)
    315340{
    316341    return RTListIsEmpty(&pCompositor->List);
     
    321346    PVBOXVR_COMPOSITOR pCompositor;
    322347    PRTLISTNODE pNextEntry;
    323 } VBOXVR_COMPOSITOR_ITERATOR ,*PVBOXVR_COMPOSITOR_ITERATOR;
     348} VBOXVR_COMPOSITOR_ITERATOR;
     349typedef VBOXVR_COMPOSITOR_ITERATOR *PVBOXVR_COMPOSITOR_ITERATOR;
    324350
    325351typedef struct VBOXVR_COMPOSITOR_CONST_ITERATOR
    326352{
    327     const VBOXVR_COMPOSITOR *pCompositor;
    328     const RTLISTNODE *pNextEntry;
    329 } VBOXVR_COMPOSITOR_CONST_ITERATOR ,*PVBOXVR_COMPOSITOR_CONST_ITERATOR;
     353    PCVBOXVR_COMPOSITOR pCompositor;
     354    PCRTLISTNODE pNextEntry;
     355} VBOXVR_COMPOSITOR_CONST_ITERATOR;
     356typedef VBOXVR_COMPOSITOR_CONST_ITERATOR *PVBOXVR_COMPOSITOR_CONST_ITERATOR;
    330357
    331358DECLINLINE(void) VBoxVrCompositorIterInit(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ITERATOR pIter)
     
    335362}
    336363
    337 DECLINLINE(void) VBoxVrCompositorConstIterInit(const VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)
     364DECLINLINE(void) VBoxVrCompositorConstIterInit(PCVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)
    338365{
    339366    pIter->pCompositor = pCompositor;
     
    341368}
    342369
    343 #define VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(_p) ((PVBOXVR_COMPOSITOR_ENTRY)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXVR_COMPOSITOR_ENTRY, Node)))
    344 #define VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(_p) ((const VBOXVR_COMPOSITOR_ENTRY*)(((uint8_t*)(_p)) - RT_OFFSETOF(VBOXVR_COMPOSITOR_ENTRY, Node)))
     370#define VBOXVR_COMPOSITOR_ENTRY_FROM_NODE(_p)       RT_FROM_MEMBER(_p, VBOXVR_COMPOSITOR_ENTRY, Node)
     371#define VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(_p) RT_FROM_MEMBER(_p, const VBOXVR_COMPOSITOR_ENTRY, Node)
    345372
    346373DECLINLINE(PVBOXVR_COMPOSITOR_ENTRY) VBoxVrCompositorIterNext(PVBOXVR_COMPOSITOR_ITERATOR pIter)
     
    356383}
    357384
    358 DECLINLINE(const VBOXVR_COMPOSITOR_ENTRY*) VBoxVrCompositorConstIterNext(PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)
    359 {
    360     const RTLISTNODE *pNextEntry = pIter->pNextEntry;
     385DECLINLINE(PCVBOXVR_COMPOSITOR_ENTRY) VBoxVrCompositorConstIterNext(PVBOXVR_COMPOSITOR_CONST_ITERATOR pIter)
     386{
     387    PCRTLISTNODE pNextEntry = pIter->pNextEntry;
    361388    if (pNextEntry != &pIter->pCompositor->List)
    362389    {
    363         const VBOXVR_COMPOSITOR_ENTRY *pEntry = VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(pNextEntry);
     390        PCVBOXVR_COMPOSITOR_ENTRY pEntry = VBOXVR_COMPOSITOR_CONST_ENTRY_FROM_NODE(pNextEntry);
    364391        pIter->pNextEntry = pNextEntry->pNext;
    365392        return pEntry;
     
    370397typedef struct VBOXVR_TEXTURE
    371398{
    372     int32_t width;
    373     int32_t height;
     399    int32_t  width;
     400    int32_t  height;
    374401    uint32_t target;
    375402    uint32_t hwid;
    376 } VBOXVR_TEXTURE, *PVBOXVR_TEXTURE;
     403} VBOXVR_TEXTURE;
     404typedef VBOXVR_TEXTURE *PVBOXVR_TEXTURE;
     405typedef VBOXVR_TEXTURE const *PCVBOXVR_TEXTURE;
    377406
    378407RT_C_DECLS_END
    379408
    380 #endif /* #ifndef ___cr_vreg_h_ */
     409#endif
     410
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