VirtualBox

Ignore:
Timestamp:
Dec 14, 2011 11:12:17 AM (13 years ago)
Author:
vboxsync
Message:

wine/XPDM: 1. Additional swapchain creation fixes 2. De-libwine'ize wined3d 3. Single context per swapchain 4. wine & crOgl current context sync fixes 5. Proper Get/ReleaseDC handling

Location:
trunk/src/VBox/GuestHost/OpenGL/include
Files:
2 edited

Legend:

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

    r39568 r39602  
    4747
    4848#ifdef CHROMIUM_THREADSAFE
    49 #include "cr_threads.h"
     49# include <cr_threads.h>
    5050#endif
    5151
     
    133133     * => Thread2 still refers to destroyed ctx1
    134134     * */
    135     CRTSDREFDATA
     135    VBOXTLSREFDATA
    136136#endif
    137137
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_threads.h

    r39578 r39602  
    101101extern DECLEXPORT(void) crSignalSemaphore(CRsemaphore *s);
    102102
    103 typedef DECLCALLBACK(void) FNCRTSDREFDTOR(void*);
    104 typedef FNCRTSDREFDTOR *PFNCRTSDREFDTOR;
     103#define VBoxTlsRefGetImpl(_tls) (crGetTSD((CRtsd*)(_tls)))
     104#define VBoxTlsRefSetImpl(_tls, _val) (crSetTSD((CRtsd*)(_tls), (_val)))
     105#define VBoxTlsRefAssertImpl CRASSERT
     106#include <VBox/VBoxVideo3D.h>
    105107
    106 typedef enum {
    107     CRTSDREFDATA_STATE_UNDEFINED = 0,
    108     CRTSDREFDATA_STATE_INITIALIZED,
    109     CRTSDREFDATA_STATE_TOBE_DESTROYED,
    110     CRTSDREFDATA_STATE_DESTROYING,
    111     CRTSDREFDATA_STATE_32BIT_HACK = 0x7fffffff
    112 } CRTSDREFDATA_STATE;
    113 
    114 #define CRTSDREFDATA \
    115     volatile int32_t cTsdRefs; \
    116     uint32_t enmTsdRefState; \
    117     PFNCRTSDREFDTOR pfnTsdRefDtor; \
    118 
    119 #define crTSDRefInit(_p, _pfnDtor) do { \
    120         (_p)->cTsdRefs = 1; \
    121         (_p)->enmTsdRefState = CRTSDREFDATA_STATE_INITIALIZED; \
    122         (_p)->pfnTsdRefDtor = (_pfnDtor); \
    123     } while (0)
    124 
    125 #define crTSDRefIsFunctional(_p) (!!((_p)->enmTsdRefState == CRTSDREFDATA_STATE_INITIALIZED))
    126 
    127 #define crTSDRefAddRef(_p) do { \
    128         int cRefs = ASMAtomicIncS32(&(_p)->cTsdRefs); \
    129         CRASSERT(cRefs > 1 || (_p)->enmTsdRefState == CRTSDREFDATA_STATE_DESTROYING); \
    130     } while (0)
    131 
    132 #define crTSDRefRelease(_p) do { \
    133         int cRefs = ASMAtomicDecS32(&(_p)->cTsdRefs); \
    134         CRASSERT(cRefs >= 0); \
    135         if (!cRefs && (_p)->enmTsdRefState != CRTSDREFDATA_STATE_DESTROYING /* <- avoid recursion if crTSDRefAddRef/Release is called from dtor */) { \
    136             (_p)->enmTsdRefState = CRTSDREFDATA_STATE_DESTROYING; \
    137             (_p)->pfnTsdRefDtor((_p)); \
    138         } \
    139     } while (0)
    140 
    141 #define crTSDRefReleaseMarkDestroy(_p) do { \
    142         (_p)->enmTsdRefState = CRTSDREFDATA_STATE_TOBE_DESTROYED; \
    143     } while (0)
    144 
    145 #define crTSDRefGetCurrent(_t, _pTsd) ((_t*) crGetTSD((_pTsd)))
    146 
    147 #define crTSDRefSetCurrent(_t, _pTsd, _p) do { \
    148         _t * oldCur = crTSDRefGetCurrent(_t, _pTsd); \
    149         if (oldCur != (_p)) { \
    150             crSetTSD((_pTsd), (_p)); \
    151             if (oldCur) { \
    152                 crTSDRefRelease(oldCur); \
    153             } \
    154             if ((_p)) { \
    155                 crTSDRefAddRef((_t*)(_p)); \
    156             } \
    157         } \
    158     } while (0)
    159108#ifdef __cplusplus
    160109}
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