Changeset 43888 in vbox
- Timestamp:
- Nov 15, 2012 9:23:50 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 82105
- Location:
- trunk
- Files:
-
- 1 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h
r41404 r43888 90 90 /* Update the window visible region. */ 91 91 DECLR3CALLBACKMEMBER(void, H3DORVisibleRegion, (void *pvInstance, 92 uint32_t cRects, RTRECT *paRects));92 uint32_t cRects, const RTRECT *paRects)); 93 93 /* A rendered 3D frame is ready. Format of pvData is "pszFormat" parameter of H3DORBegin. */ 94 94 DECLR3CALLBACKMEMBER(void, H3DORFrame, (void *pvInstance, -
trunk/src/VBox/Additions/common/crOpenGL/stub.c
r42518 r43888 152 152 stub.spu->dispatch_table.WindowVisibleRegion( window, cRects, pRects ); 153 153 } 154 } 155 156 void APIENTRY crTexPresent(GLuint texture, GLuint cfg, GLint xPos, GLint yPos, GLint cRects, GLint *pRects) 157 { 158 crError("not expected!"); 154 159 } 155 160 -
trunk/src/VBox/GuestHost/OpenGL/Makefile.kmk
r42499 r43888 77 77 util/url.c \ 78 78 util/warp.c \ 79 util/vreg.cpp \ 79 80 util/vboxhgcm.c \ 80 81 $(VBOX_PATH_CROGL_GENFILES)/debug_opcodes.c -
trunk/src/VBox/GuestHost/OpenGL/glapi_parser/APIspec.txt
r42499 r43888 8372 8372 chromium extpack 8373 8373 8374 name TexPresent 8375 return void 8376 param texture GLuint 8377 param cfg GLuint 8378 param xPos GLint 8379 param yPos GLint 8380 param cRects GLint 8381 param pRects GLint * 8382 category Chromium 8383 props nolist 8384 chromium extpack 8385 chrelopcode 0 8386 8374 8387 name WindowShow 8375 8388 return void -
trunk/src/VBox/GuestHost/OpenGL/include/chromium.h
r42536 r43888 768 768 extern void APIENTRY crWindowVisibleRegion( GLint window, GLint cRects, void *pRects ); 769 769 extern void APIENTRY crWindowShow( GLint window, GLint flag ); 770 extern void APIENTRY crTexPresent(GLuint texture, GLuint cfg, GLint xPos, GLint yPos, GLint cRects, GLint *pRects); 770 771 771 772 typedef int (CR_APIENTRY *CR_PROC)(); -
trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
r43874 r43888 28 28 #include <VBox/Hardware/VBoxVideoVBE.h> 29 29 30 #include "cr_vreg.h" 31 30 32 #ifdef __cplusplus 31 33 extern "C" { … … 56 58 int32_t x, int32_t y, uint32_t w, uint32_t h)); 57 59 DECLR3CALLBACKMEMBER(void, CRORVisibleRegion, (void *pvInstance, 58 uint32_t cRects, RTRECT *paRects));60 uint32_t cRects, const RTRECT *paRects)); 59 61 DECLR3CALLBACKMEMBER(void, CRORFrame, (void *pvInstance, 60 62 void *pvData, uint32_t cbData)); … … 175 177 176 178 179 /* BLITTER */ 180 typedef struct CR_BLITTER_BUFFER 181 { 182 GLuint cbBuffer; 183 GLvoid * pvBuffer; 184 } CR_BLITTER_BUFFER, *PCR_BLITTER_BUFFER; 185 186 typedef struct CR_BLITTER_TEXTURE 187 { 188 GLint width; 189 GLint height; 190 GLenum target; 191 GLuint hwid; 192 } CR_BLITTER_TEXTURE, *PCR_BLITTER_TEXTURE; 193 194 typedef union CR_BLITTER_FLAGS 195 { 196 struct 197 { 198 uint32_t Initialized : 1; 199 uint32_t SupportsFBO : 1; 200 uint32_t SupportsFBOBlit : 1; 201 uint32_t Reserved : 29; 202 }; 203 uint32_t Value; 204 } CR_BLITTER_FLAGS, *PCR_BLITTER_FLAGS; 205 206 typedef DECLCALLBACK(int) FNCRBLT_BLITTER(struct CR_BLITTER *pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *paSrcRect, const PRTRECTSIZE pDstSize, const RTRECT *paDstRect, uint32_t cRects, uint32_t fFlags); 207 typedef FNCRBLT_BLITTER *PFNCRBLT_BLITTER; 208 209 #define CRBLT_F_LINEAR 0x00000001 210 211 typedef struct CR_BLITTER 212 { 213 GLuint idFBO; 214 CR_BLITTER_FLAGS Flags; 215 PFNCRBLT_BLITTER pfnBlt; 216 CR_BLITTER_BUFFER Verticies; 217 CR_BLITTER_BUFFER Indicies; 218 RTRECTSIZE CurrentSetSize; 219 CRMuralInfo *pCurrentMural; 220 CRContextInfo CtxInfo; 221 CRContextInfo *pRestoreCtxInfo; 222 CRMuralInfo *pRestoreMural; 223 } CR_BLITTER, *PCR_BLITTER; 224 225 int CrBltInit(PCR_BLITTER pBlitter, CRMuralInfo *pCurrentMural, GLint visualBits); 226 void CrBltTerm(PCR_BLITTER pBlitter); 227 228 static DECLINLINE(GLboolean) CrBltSupportsTexTex(PCR_BLITTER pBlitter) 229 { 230 return pBlitter->Flags.SupportsFBO; 231 } 232 233 DECLINLINE(GLboolean) CrBltIsEntered(PCR_BLITTER pBlitter) 234 { 235 return !!pBlitter->pRestoreCtxInfo; 236 } 237 238 void CrBltMuralSetCurrent(PCR_BLITTER pBlitter, CRMuralInfo *pMural); 239 240 void CrBltLeave(PCR_BLITTER pBlitter); 241 int CrBltEnter(PCR_BLITTER pBlitter, CRContextInfo *pRestoreCtxInfo, CRMuralInfo *pRestoreMural); 242 void CrBltBlitTexMural(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *paSrcRects, const RTRECT *paDstRects, uint32_t cRects, uint32_t fFlags); 243 void CrBltBlitTexTex(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *pSrcRect, CR_BLITTER_TEXTURE *pDst, const RTRECT *pDstRect, uint32_t cRects, uint32_t fFlags); 244 /* */ 245 246 /* PRESENTER */ 247 struct CR_PRESENTER; 248 struct CR_PRESENTER_ENTRY; 249 250 typedef DECLCALLBACK(int) FNCRDISPLAY_REGIONS_CHANGED(struct CR_PRESENTER *pPresenter); 251 typedef FNCRDISPLAY_REGIONS_CHANGED *PFNCRDISPLAY_REGIONS_CHANGED; 252 253 typedef DECLCALLBACK(int) FNCRDISPLAY_DRAW_ENTRY(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter); 254 typedef FNCRDISPLAY_DRAW_ENTRY *PFNCRDISPLAY_DRAW_ENTRY; 255 256 typedef DECLCALLBACK(int) FNCRDISPLAY_DRAW_TEXTURE(struct CR_PRESENTER *pPresenter, PCR_BLITTER pBlitter, 257 CR_BLITTER_TEXTURE *pTexture, const RTRECT *paSrcRects, const RTRECT *paDstRects, uint32_t cRects); 258 typedef FNCRDISPLAY_DRAW_TEXTURE *PFNCRDISPLAY_DRAW_TEXTURE; 259 260 typedef struct CR_PRESENTER_ENTRY 261 { 262 VBOXVR_COMPOSITOR_ENTRY Ce; 263 CR_BLITTER_TEXTURE Texture; 264 RTPOINT Pos; 265 PRTRECT paSrcRects; 266 PRTRECT paDstRects; 267 uint32_t cRects; 268 } CR_PRESENTER_ENTRY, *PCR_PRESENTER_ENTRY; 269 270 typedef struct CR_PRESENTER 271 { 272 VBOXVR_COMPOSITOR Compositor; 273 float StretchX; 274 float StretchY; 275 PFNCRDISPLAY_REGIONS_CHANGED pfnRegionsChanged; 276 PFNCRDISPLAY_DRAW_ENTRY pfnDrawEntry; 277 PFNCRDISPLAY_DRAW_TEXTURE pfnDrawTexture; 278 uint32_t cRects; 279 uint32_t cRectsBuffer; 280 PRTRECT paSrcRects; 281 PRTRECT paDstRects; 282 } CR_PRESENTER, *PCR_PRESENTER; 283 284 285 DECLCALLBACK(int) CrPtCbDrawEntrySingle(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter); 286 DECLCALLBACK(int) CrPtCbDrawEntryAll(struct CR_PRESENTER *pPresenter, struct CR_PRESENTER_ENTRY *pEntry, PCR_BLITTER pBlitter); 287 288 DECLINLINE(void) CrPtEntryInit(PCR_PRESENTER_ENTRY pEntry, PCR_BLITTER_TEXTURE pTextureData) 289 { 290 VBoxVrCompositorEntryInit(&pEntry->Ce); 291 pEntry->Texture = *pTextureData; 292 memset(&pEntry->Pos, 0, sizeof (CR_PRESENTER_ENTRY) - RT_OFFSETOF(CR_PRESENTER_ENTRY, Pos)); 293 } 294 DECLINLINE(bool) CrPtEntryIsUsed(const PCR_PRESENTER_ENTRY pEntry) 295 { 296 return VBoxVrCompositorEntryIsInList(&pEntry->Ce); 297 } 298 int CrPtEntryPresent(PCR_PRESENTER pPresenter, PCR_PRESENTER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, PCR_BLITTER pBlitter); 299 int CrPtEntryRemove(PCR_PRESENTER pPresenter, PCR_PRESENTER_ENTRY pEntry); 300 int CrPtInit(PCR_PRESENTER pPresenter, PFNCRDISPLAY_REGIONS_CHANGED pfnRegionsChanged, PFNCRDISPLAY_DRAW_ENTRY pfnDrawEntry, PFNCRDISPLAY_DRAW_TEXTURE pfnDrawTexture); 301 void CrPtTerm(PCR_PRESENTER pPresenter); 302 void CrPtSetStretching(PCR_PRESENTER pPresenter, float StretchX, float StretchY); 303 /* regions are valid until the next CrPt call */ 304 int CrPtGetRegions(PCR_PRESENTER pPresenter, uint32_t *pcRegions, const RTRECT **ppaRegions); 305 /* */ 306 307 /* DISPLAY */ 308 309 typedef struct CR_DISPLAY_ENTRY 310 { 311 CR_PRESENTER_ENTRY Pe; 312 } CR_DISPLAY_ENTRY, *PCR_DISPLAY_ENTRY; 313 314 typedef struct CR_DISPLAY 315 { 316 CR_PRESENTER Presenter; 317 CRMuralInfo Mural; 318 CRCreateInfo_t MuralCreateInfo; 319 PCR_BLITTER pBlitter; 320 } CR_DISPLAY, *PCR_DISPLAY; 321 322 int CrDpInit(PCR_DISPLAY pDisplay); 323 void CrDpTerm(PCR_DISPLAY pDisplay); 324 DECLINLINE(void) CrDpBlitterSet(PCR_DISPLAY pDisplay, PCR_BLITTER pBlitter) 325 { 326 pDisplay->pBlitter = pBlitter; 327 } 328 bool CrDpBlitterTest(PCR_DISPLAY pDisplay, PCR_BLITTER pBlitter); 329 void CrDpResize(PCR_DISPLAY pDisplay, uint32_t width, uint32_t height, 330 uint32_t stretchedWidth, uint32_t stretchedHeight); 331 void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, PCR_BLITTER_TEXTURE pTextureData); 332 void CrDpEntryCleanup(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry); 333 int CrDpPresentTexture(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions); 334 DECLINLINE(bool) CrDpEntryIsUsed(PCR_DISPLAY_ENTRY pEntry) 335 { 336 return CrPtEntryIsUsed(&pEntry->Pe); 337 } 338 339 DECLINLINE(CRMuralInfo*) CrDpGetMural(PCR_DISPLAY pDisplay) 340 { 341 return &pDisplay->Mural; 342 } 343 344 DECLINLINE(CRCreateInfo_t*) CrDpGetMuralCreateInfo(PCR_DISPLAY pDisplay) 345 { 346 return &pDisplay->MuralCreateInfo; 347 } 348 349 350 typedef struct CR_DISPLAY_ENTRY_MAP 351 { 352 CRHashTable * pTextureMap; 353 } CR_DISPLAY_ENTRY_MAP, *PCR_DISPLAY_ENTRY_MAP; 354 355 int CrDemInit(PCR_DISPLAY_ENTRY_MAP pMap); 356 void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap); 357 PCR_DISPLAY_ENTRY CrDemEntryGetCreate(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture, CRContextInfo *pCtxInfo); 358 void CrDemEntryDestroy(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture); 359 360 /* */ 361 362 177 363 typedef struct { 178 364 unsigned short tcpip_port; … … 196 382 GLint currentWindow; 197 383 GLint currentNativeWindow; 384 CRMuralInfo *currentMural; 198 385 199 386 CRHashTable *muralTable; /**< hash table where all murals are stored */ … … 286 473 287 474 GLboolean bUseMultipleContexts; 475 476 uint8_t fPresentBlitterInited; 477 CR_DISPLAY_ENTRY_MAP PresentTexturepMap; 478 CR_BLITTER PresentBlitter; 479 uint32_t DisplaysInitMap[(CR_MAX_GUEST_MONITORS + 31)/32]; 480 CR_DISPLAY aDispplays[CR_MAX_GUEST_MONITORS]; 288 481 } CRServer; 289 482 -
trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h
r43834 r43888 21 21 #include <iprt/list.h> 22 22 #include <iprt/types.h> 23 #include <iprt/mem.h> 24 #include <iprt/string.h> 25 #include <iprt/assert.h> 26 27 #ifndef IN_RING0 28 # define VBOXVREGDECL(_type) DECLEXPORT(_type) 29 #else 30 # define VBOXVREGDECL(_type) RTDECL(_type) 31 #endif 32 33 23 34 24 35 RT_C_DECLS_BEGIN … … 30 41 } VBOXVR_LIST, *PVBOXVR_LIST; 31 42 32 DECLINLINE(void) VBoxRectRectTranslate(RTRECT * pRect, int32_t x, int32_t y) 43 DECLINLINE(int) VBoxRectCmp(const RTRECT * pRect1, const RTRECT * pRect2) 44 { 45 return memcmp(pRect1, pRect2, sizeof (*pRect1)); 46 } 47 48 DECLINLINE(void) VBoxRectTranslate(RTRECT * pRect, int32_t x, int32_t y) 33 49 { 34 50 pRect->xLeft += x; … … 38 54 } 39 55 40 DECLINLINE(void) VBoxRect RectMove(RTRECT * pRect, int32_t x, int32_t y)56 DECLINLINE(void) VBoxRectMove(RTRECT * pRect, int32_t x, int32_t y) 41 57 { 42 LONGw = pRect->xRight - pRect->xLeft;43 LONGh = pRect->yBottom - pRect->yTop;58 int32_t w = pRect->xRight - pRect->xLeft; 59 int32_t h = pRect->yBottom - pRect->yTop; 44 60 pRect->xLeft = x; 45 61 pRect->yTop = y; … … 48 64 } 49 65 50 DECLINLINE(bool) VBoxRect RectIsCoveres(const RTRECT *pRect, const RTRECT *pCovered)66 DECLINLINE(bool) VBoxRectIsCoveres(const RTRECT *pRect, const RTRECT *pCovered) 51 67 { 52 68 Assert(pRect); … … 63 79 } 64 80 65 DECLINLINE(bool) VBoxRect RectIsIntersect(const RTRECT * pRect1, const RTRECT * pRect2)81 DECLINLINE(bool) VBoxRectIsIntersect(const RTRECT * pRect1, const RTRECT * pRect2) 66 82 { 67 83 return !((pRect1->xLeft < pRect2->xLeft && pRect1->xRight <= pRect2->xLeft) … … 76 92 } 77 93 78 DECLINLINE(bool) VBoxVrListIsEmpty( PVBOXVR_LIST pList)94 DECLINLINE(bool) VBoxVrListIsEmpty(const PVBOXVR_LIST pList) 79 95 { 80 96 return !VBoxVrListRectsCount(pList); … … 87 103 } 88 104 89 voidVBoxVrListClear(PVBOXVR_LIST pList);105 VBOXVREGDECL(void) VBoxVrListClear(PVBOXVR_LIST pList); 90 106 91 voidVBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y);107 VBOXVREGDECL(void) VBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y); 92 108 93 int VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, const PRTRECT aRects, bool *pfChanged); 94 int VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, const PRTRECT aRects, bool *pfChanged); 95 int VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, PRTRECT aRects); 109 VBOXVREGDECL(int) VBoxVrListCmp(PVBOXVR_LIST pList1, PVBOXVR_LIST pList2); 96 110 97 int VBoxVrInit(); 98 void VBoxVrTerm(); 111 VBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged); 112 VBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged); 113 VBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, RTRECT * aRects); 114 115 VBOXVREGDECL(int) VBoxVrInit(); 116 VBOXVREGDECL(void) VBoxVrTerm(); 99 117 100 118 typedef struct VBOXVR_COMPOSITOR_ENTRY … … 104 122 } VBOXVR_COMPOSITOR_ENTRY, *PVBOXVR_COMPOSITOR_ENTRY; 105 123 124 struct VBOXVR_COMPOSITOR; 125 126 typedef DECLCALLBACK(void) FNVBOXVRCOMPOSITOR_ENTRY_REMOVED(const struct VBOXVR_COMPOSITOR *pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry); 127 typedef FNVBOXVRCOMPOSITOR_ENTRY_REMOVED *PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED; 128 106 129 typedef struct VBOXVR_COMPOSITOR 107 130 { 108 131 RTLISTNODE List; 132 PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED pfnEntryRemoved; 109 133 } VBOXVR_COMPOSITOR, *PVBOXVR_COMPOSITOR; 110 134 … … 112 136 typedef FNVBOXVRCOMPOSITOR_VISITOR *PFNVBOXVRCOMPOSITOR_VISITOR; 113 137 114 void VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor); 115 void VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry); 116 DECLINLINE(bool) VBoxVrCompositorEntryIsInList(PVBOXVR_COMPOSITOR_ENTRY pEntry) 138 VBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED pfnEntryRemoved); 139 VBOXVREGDECL(void) VBoxVrCompositorTerm(PVBOXVR_COMPOSITOR pCompositor); 140 VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry); 141 DECLINLINE(bool) VBoxVrCompositorEntryIsInList(const PVBOXVR_COMPOSITOR_ENTRY pEntry) 117 142 { 118 143 return !VBoxVrListIsEmpty(&pEntry->Vr); 119 144 } 120 bool VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry); 121 int VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 122 int VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 123 int VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 124 int VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, int32_t x, int32_t y, bool *pfChanged); 125 void VBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor); 145 146 #define VBOXVR_COMPOSITOR_CF_ENTRIES_REGIONS_CHANGED 0x00000001 147 #define VBOXVR_COMPOSITOR_CF_COMPOSITED_REGIONS_CHANGED 0x00000002 148 149 VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry); 150 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, uint32_t *pfChangeFlags); 151 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 152 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); 153 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, int32_t x, int32_t y, bool *pfChanged); 154 VBOXVREGDECL(void) VBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor); 126 155 127 156 RT_C_DECLS_END -
trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
r43834 r43888 21 21 #include <iprt/assert.h> 22 22 23 #ifndef IN_RING0 24 #include <cr_error.h> 25 #define WARN(_m) do { crWarning _m ; } while (0) 26 #else 27 # error port me! 28 #endif 29 23 30 typedef struct VBOXVR_REG 24 31 { … … 60 67 } 61 68 62 voidVBoxVrListClear(PVBOXVR_LIST pList)69 VBOXVREGDECL(void) VBoxVrListClear(PVBOXVR_LIST pList) 63 70 { 64 71 PVBOXVR_REG pReg, pRegNext; … … 73 80 #define VBOXVR_MEMTAG 'vDBV' 74 81 75 intVBoxVrInit()82 VBOXVREGDECL(int) VBoxVrInit() 76 83 { 77 84 #ifndef VBOXVDBG_VR_LAL_DISABLE … … 94 101 } 95 102 96 voidVBoxVrTerm()103 VBOXVREGDECL(void) VBoxVrTerm() 97 104 { 98 105 #ifndef VBOXVDBG_VR_LAL_DISABLE … … 106 113 static DECLCALLBACK(int) vboxVrRegNonintersectedComparator(const RTRECT* pRect1, const RTRECT* pRect2) 107 114 { 108 Assert(!VBoxRect RectIsIntersect(pRect1, pRect2));115 Assert(!VBoxRectIsIntersect(pRect1, pRect2)); 109 116 if (pRect1->yTop != pRect2->yTop) 110 117 return pRect1->yTop - pRect2->yTop; … … 195 202 } 196 203 197 static int vboxVrListRegIntersectSubstNoJoin(P RTLISTNODEpList1, PVBOXVR_REG pReg1, const RTRECT * pRect2)204 static int vboxVrListRegIntersectSubstNoJoin(PVBOXVR_LIST pList1, PVBOXVR_REG pReg1, const RTRECT * pRect2) 198 205 { 199 206 uint32_t topLim = VBOXVR_INVALID_COORD; … … 208 215 RTListInit(&List); 209 216 210 Assert(VBoxRect RectIsIntersect(&pReg1->Rect, pRect2));217 Assert(VBoxRectIsIntersect(&pReg1->Rect, pRect2)); 211 218 212 219 if (pReg1->Rect.yTop < pRect2->yTop) … … 263 270 vboxVrRegTerm(pReg1); 264 271 265 if ( IsListEmpty(&List))272 if (RTListIsEmpty(&List)) 266 273 return VINF_SUCCESS; /* the region is covered by the pRect2 */ 267 274 … … 474 481 pData->fChanged = true; 475 482 476 Assert(VBoxRect RectIsIntersect(&pReg1->Rect, pRect2));483 Assert(VBoxRectIsIntersect(&pReg1->Rect, pRect2)); 477 484 478 485 /* NOTE: the pReg1 will be invalid after the vboxVrListRegIntersectSubstNoJoin call!!! */ 479 486 int rc = vboxVrListRegIntersectSubstNoJoin(pList, pReg1, pRect2); 480 if (R C_SUCCESS(rc))487 if (RT_SUCCESS(rc)) 481 488 { 482 489 *ppNext = pPrev->pNext; … … 490 497 } 491 498 492 static int vboxVrListSubstNoJoin(PVBOXVR_LIST pList, uint32_t cRects, const PRTRECTaRects, bool *pfChanged)499 static int vboxVrListSubstNoJoin(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged) 493 500 { 494 501 if (VBoxVrListIsEmpty(pList)) … … 513 520 514 521 #if 0 515 static const PRTRECT vboxVrRectsOrder(uint32_t cRects, const PRTRECTaRects)522 static const RTRECT * vboxVrRectsOrder(uint32_t cRects, const RTRECT * aRects) 516 523 { 517 524 #ifdef DEBUG … … 523 530 { 524 531 RTRECT *pRectJ = &aRects[j]; 525 Assert(!VBoxRect RectIsIntersect(pRectI, pRectJ));532 Assert(!VBoxRectIsIntersect(pRectI, pRectJ)); 526 533 } 527 534 } … … 575 582 #endif 576 583 577 voidVBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y)584 VBOXVREGDECL(void) VBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y) 578 585 { 579 586 for (PRTLISTNODE pEntry1 = pList->ListHead.pNext; pEntry1 != &pList->ListHead; pEntry1 = pEntry1->pNext) 580 587 { 581 588 PVBOXVR_REG pReg1 = PVBOXVR_REG_FROM_ENTRY(pEntry1); 582 VBoxRect RectTranslate(&pReg1->Rect, x, y);583 } 584 } 585 586 int VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, const PRTRECTaRects, bool *pfChanged)589 VBoxRectTranslate(&pReg1->Rect, x, y); 590 } 591 } 592 593 VBOXVREGDECL(int) VBoxVrListRectsSubst(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged) 587 594 { 588 595 #if 0 589 const PRTRECTpRects = vboxVrRectsOrder(cRects, aRects);596 const RTRECT * pRects = vboxVrRectsOrder(cRects, aRects); 590 597 if (!pRects) 591 598 { … … 615 622 } 616 623 617 int VBoxVrListRectsAdd(PRTLISTNODE pList, uint32_t cRects, const PRTRECTaRects, bool *pfChanged)624 VBOXVREGDECL(int) VBoxVrListRectsAdd(PVBOXVR_LIST pList, uint32_t cRects, const RTRECT * aRects, bool *pfChanged) 618 625 { 619 626 uint32_t cCovered = 0; … … 628 635 { 629 636 RTRECT *pRectJ = &aRects[j]; 630 Assert(!VBoxRect RectIsIntersect(pRectI, pRectJ));637 Assert(!VBoxRectIsIntersect(pRectI, pRectJ)); 631 638 } 632 639 } … … 641 648 { 642 649 PVBOXVR_REG pReg1 = PVBOXVR_REG_FROM_ENTRY(pEntry1); 643 if (VBoxRect RectIsCoveres(&pReg1->Rect, &aRects[i]))650 if (VBoxRectIsCoveres(&pReg1->Rect, &aRects[i])) 644 651 { 645 652 cCovered++; … … 659 666 VBOXVR_LIST DiffList; 660 667 VBoxVrListInit(&DiffList); 661 PRTRECTpListRects = NULL;668 RTRECT * pListRects = NULL; 662 669 uint32_t cAllocatedRects = 0; 663 670 bool fNeedRectreate = true; … … 695 702 if (pListRects) 696 703 RTMemFree(pListRects); 697 pListRects = ( PRTRECT)RTMemAlloc(sizeof (RTRECT) * cAllocatedRects);704 pListRects = (RTRECT *)RTMemAlloc(sizeof (RTRECT) * cAllocatedRects); 698 705 if (!pListRects) 699 706 { … … 745 752 } 746 753 747 int VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, PRTRECTaRects)754 VBOXVREGDECL(int) VBoxVrListRectsGet(PVBOXVR_LIST pList, uint32_t cRects, RTRECT * aRects) 748 755 { 749 756 if (cRects < VBoxVrListRectsCount(pList)) … … 759 766 } 760 767 761 762 void VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor) 768 VBOXVREGDECL(int) VBoxVrListCmp(PVBOXVR_LIST pList1, PVBOXVR_LIST pList2) 769 { 770 int cTmp = pList1->cEntries - pList2->cEntries; 771 if (cTmp) 772 return cTmp; 773 774 PVBOXVR_REG pReg1, pReg2; 775 776 for (pReg1 = RTListNodeGetNext(&pList1->ListHead, VBOXVR_REG, ListEntry), 777 pReg2 = RTListNodeGetNext(&pList2->ListHead, VBOXVR_REG, ListEntry); 778 !RTListNodeIsDummy(&pList1->ListHead, pReg1, VBOXVR_REG, ListEntry); 779 pReg1 = RT_FROM_MEMBER(pReg1->ListEntry.pNext, VBOXVR_REG, ListEntry), 780 pReg2 = RT_FROM_MEMBER(pReg2->ListEntry.pNext, VBOXVR_REG, ListEntry)) 781 { 782 Assert(!RTListNodeIsDummy(&pList2->ListHead, pReg2, VBOXVR_REG, ListEntry)); 783 cTmp = VBoxRectCmp(&pReg1->Rect, &pReg2->Rect); 784 if (cTmp) 785 return cTmp; 786 } 787 Assert(RTListNodeIsDummy(&pList2->ListHead, pReg2, VBOXVR_REG, ListEntry)); 788 return 0; 789 } 790 791 VBOXVREGDECL(void) VBoxVrCompositorInit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_ENTRY_REMOVED pfnEntryRemoved) 763 792 { 764 793 RTListInit(&pCompositor->List); 794 pCompositor->pfnEntryRemoved = pfnEntryRemoved; 795 } 796 797 VBOXVREGDECL(void) VBoxVrCompositorTerm(PVBOXVR_COMPOSITOR pCompositor) 798 { 799 PVBOXVR_COMPOSITOR_ENTRY pEntry, pEntryNext; 800 RTListForEachSafe(&pCompositor->List, pEntry, pEntryNext, VBOXVR_COMPOSITOR_ENTRY, Node); 801 { 802 VBoxVrCompositorEntryRemove(pCompositor, pEntry); 803 } 765 804 } 766 805 … … 770 809 } 771 810 772 static DECLINLINE(void) vboxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry )811 static DECLINLINE(void) vboxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry) 773 812 { 774 813 RTListNodeRemove(&pEntry->Node); 775 } 776 777 void VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry) 814 if (pCompositor->pfnEntryRemoved) 815 pCompositor->pfnEntryRemoved(pCompositor, pEntry, pReplacingEntry); 816 } 817 818 VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry) 778 819 { 779 820 VBoxVrListInit(&pEntry->Vr); 780 821 } 781 822 782 boolVBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry)823 VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry) 783 824 { 784 825 if (!VBoxVrCompositorEntryIsInList(pEntry)) 785 826 return false; 786 827 VBoxVrListClear(&pEntry->Vr); 787 vboxVrCompositorEntryRemove(pCompositor, pEntry );828 vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL); 788 829 return true; 789 830 } 790 831 791 static int vboxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, RTRECT *paRects, bool *pfChanged)832 static int vboxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT * paRects, bool *pfChanged) 792 833 { 793 834 bool fChanged; … … 798 839 { 799 840 Assert(fChanged); 800 vboxVrCompositorEntryRemove(pCompositor, pEntry );841 vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL); 801 842 } 802 843 if (pfChanged) … … 809 850 } 810 851 811 int VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, RTRECT *paRects, bool *pfChanged) 812 { 813 bool fChanged = false, fCurChanged = false, fEntryInList = false; 852 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT *paRects, uint32_t *pfChangeFlags) 853 { 854 bool fOthersChanged = false, fCurChanged = false, fEntryChanged = false, fEntryInList = false, fEntryReplaces = false; 855 PVBOXVR_COMPOSITOR_ENTRY pCur; 814 856 int rc = VINF_SUCCESS; 815 PVBOXVR_COMPOSITOR_ENTRY pCur;816 857 817 858 if (!cRects) 818 859 { 819 if (pfChange d)820 *pfChange d = false;860 if (pfChangeFlags) 861 *pfChangeFlags = 0; 821 862 return VINF_SUCCESS; 863 } 864 865 if (pEntry) 866 { 867 fEntryInList = VBoxVrCompositorEntryIsInList(pEntry); 868 rc = VBoxVrListRectsAdd(&pEntry->Vr, cRects, paRects, &fEntryChanged); 869 if (RT_SUCCESS(rc)) 870 { 871 if (VBoxVrListIsEmpty(&pEntry->Vr)) 872 { 873 WARN(("Empty rectangles passed in, is it expected?")); 874 if (pfChangeFlags) 875 *pfChangeFlags = 0; 876 return VINF_SUCCESS; 877 } 878 } 879 else 880 { 881 WARN(("VBoxVrListRectsAdd failed, rc %d", rc)); 882 return rc; 883 } 884 885 Assert(!VBoxVrListIsEmpty(&pEntry->Vr)); 822 886 } 823 887 … … 827 891 if (pCur == pEntry) 828 892 { 829 fEntryInList = true; 830 rc = VBoxVrListRectsAdd(&pCur->Vr, cRects, paRects, &fCurChanged); 831 if (RT_SUCCESS(rc)) 832 { 833 fChanged |= fCurChanged; 834 Assert(!VBoxVrListIsEmpty(&pCur->Vr)); 893 Assert(fEntryInList); 894 } 895 else 896 { 897 if (pEntry && !VBoxVrListCmp(&pCur->Vr, &pEntry->Vr)) 898 { 899 VBoxVrListClear(&pCur->Vr); 900 vboxVrCompositorEntryRemove(pCompositor, pCur, pEntry); 901 fEntryReplaces = true; 835 902 } 836 903 else 837 904 { 838 WARN(("VBoxVrListRectsAdd failed, rc %d", rc)); 839 return rc; 840 } 841 } 842 else 843 { 844 rc = vboxVrCompositorEntryRegionsSubst(pCompositor, pCur, cRects, paRects, fCurChanged); 845 if (RT_SUCCESS(rc)) 846 fChanged |= fCurChanged; 847 else 848 { 849 WARN(("vboxVrCompositorEntryRegionsSubst failed, rc %d", rc)); 850 return rc; 905 rc = vboxVrCompositorEntryRegionsSubst(pCompositor, pCur, cRects, paRects, &fCurChanged); 906 if (RT_SUCCESS(rc)) 907 fOthersChanged |= fCurChanged; 908 else 909 { 910 WARN(("vboxVrCompositorEntryRegionsSubst failed, rc %d", rc)); 911 return rc; 912 } 851 913 } 852 914 } … … 857 919 if (pEntry && !fEntryInList) 858 920 { 859 Assert( VBoxVrListIsEmpty(&pEntry->Vr));860 rc = VBoxVrListRectsAdd(&pEntry->Vr, cRects, paRects, &fCurChanged);861 if (RT_SUCCESS(rc))862 { 863 fChanged |= fCurChanged;864 if (!VBoxVrListIsEmpty(&pEntry->Vr))865 {866 Assert(fCurChanged);867 vboxVrCompositorEntryAdd(pCompositor, pEntry);868 }869 }870 else871 {872 WARN(("VBoxVrListRectsAdd failed, rc %d", rc));873 return rc;874 }875 } 876 877 if (pfChanged)878 *pfChanged = fChanged; 921 Assert(!VBoxVrListIsEmpty(&pEntry->Vr)); 922 vboxVrCompositorEntryAdd(pCompositor, pEntry); 923 } 924 925 if (pfChangeFlags) 926 { 927 uint32_t fFlags = 0; 928 if (fOthersChanged) 929 fFlags = VBOXVR_COMPOSITOR_CF_ENTRIES_REGIONS_CHANGED | VBOXVR_COMPOSITOR_CF_COMPOSITED_REGIONS_CHANGED; 930 else if (fEntryReplaces) 931 { 932 Assert(fEntryChanged); 933 fFlags = VBOXVR_COMPOSITOR_CF_ENTRIES_REGIONS_CHANGED; 934 } 935 else if (fEntryChanged) 936 fFlags = VBOXVR_COMPOSITOR_CF_ENTRIES_REGIONS_CHANGED | VBOXVR_COMPOSITOR_CF_COMPOSITED_REGIONS_CHANGED; 937 938 *pfChangeFlags = fFlags; 939 } 940 879 941 return VINF_SUCCESS; 880 942 } 881 943 882 int VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT *paRects, bool *pfChanged) 883 { 884 bool fChanged; 944 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT * paRects, bool *pfChanged) 945 { 885 946 if (!pEntry) 886 947 { … … 899 960 } 900 961 901 rc = vboxVrCompositorEntryRegionsSubst(pCompositor, pEntry, cRects, paRects, pfChanged);962 int rc = vboxVrCompositorEntryRegionsSubst(pCompositor, pEntry, cRects, paRects, pfChanged); 902 963 if (RT_SUCCESS(rc)) 903 964 return VINF_SUCCESS; … … 907 968 } 908 969 909 intVBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT *paRects, bool *pfChanged)970 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSet(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRects, const RTRECT *paRects, bool *pfChanged) 910 971 { 911 972 if (!pEntry) … … 918 979 919 980 bool fChanged = false, fCurChanged = false; 981 uint32_t fChangeFlags = 0; 920 982 int rc; 921 983 fCurChanged = VBoxVrCompositorEntryRemove(pCompositor, pEntry); 984 fChanged |= fCurChanged; 985 986 rc = VBoxVrCompositorEntryRegionsAdd(pCompositor, pEntry, cRects, paRects, &fChangeFlags); 922 987 if (RT_SUCCESS(rc)) 923 fChanged |= fCurChanged; 924 else 925 { 926 WARN(("VBoxVrCompositorEntryRegionsClear failed, rc %d", rc)); 927 return rc; 928 } 929 930 rc = VBoxVrCompositorEntryRegionsAdd(pCompositor, pEntry, cRects, paRects, fCurChanged); 931 if (RT_SUCCESS(rc)) 932 fChanged |= fCurChanged; 988 fChanged |= !!fChangeFlags; 933 989 else 934 990 { … … 944 1000 } 945 1001 946 intVBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, int32_t x, int32_t y, bool *pfChanged)1002 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsTranslate(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, int32_t x, int32_t y, bool *pfChanged) 947 1003 { 948 1004 if (!pEntry) … … 981 1037 cRects = VBoxVrListRectsCount(&pEntry->Vr); 982 1038 Assert(cRects); 983 paRects = RTMemAlloc(cRects * sizeof (RTRECT));1039 paRects = (RTRECT*)RTMemAlloc(cRects * sizeof (RTRECT)); 984 1040 if (!paRects) 985 1041 { … … 1014 1070 } 1015 1071 1016 voidVBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor)1072 VBOXVREGDECL(void) VBoxVrCompositorVisit(PVBOXVR_COMPOSITOR pCompositor, PFNVBOXVRCOMPOSITOR_VISITOR pfnVisitor, void *pvVisitor) 1017 1073 { 1018 1074 PVBOXVR_COMPOSITOR_ENTRY pEntry, pEntryNext; -
trunk/src/VBox/HostServices/SharedOpenGL/Makefile.kmk
r43010 r43888 134 134 crserverlib/server_muralfbo.c \ 135 135 crserverlib/server_texture.c \ 136 crserverlib/server_blitter.cpp \ 137 crserverlib/server_presenter.cpp \ 136 138 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.c \ 137 139 $(VBOX_PATH_CROGL_GENFILES)/server_retval.c \ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r40691 r43888 18 18 #ifdef VBOX_WITH_CRHGSMI 19 19 # include <VBox/VBoxVideo.h> 20 21 #include <iprt/cdefs.h> 22 23 RT_C_DECLS_BEGIN 20 24 21 25 extern uint8_t* g_pvVRamBase; … … 109 113 GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID); 110 114 GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID); 115 GLint crServerMuralInit(CRMuralInfo *mural, const char *dpyName, GLint visBits, GLint preloadWinID); 116 void crServerMuralTerm(CRMuralInfo *mural); 117 void crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height); 111 118 112 119 void crServerCreateInfoDeleteCB(void *data); … … 129 136 int32_t crVBoxServerInternalClientRead(CRClient *pClient, uint8_t *pBuffer, uint32_t *pcbBuffer); 130 137 138 RT_C_DECLS_END 139 131 140 #endif /* CR_SERVER_H */ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_blitter.cpp
r43834 r43888 28 28 #include <iprt/cdefs.h> 29 29 #include <iprt/types.h> 30 31 typedef struct CR_BLITTER_STATE 32 { 33 GLint drawFB; 34 GLint readFB; 35 } CR_BLITTER_STATE, *PCR_BLITTER_STATE; 36 37 typedef struct CR_BLITTER_BUFFER 38 { 39 GLuint cbBuffer; 40 GLvoid * pvBuffer; 41 } CR_BLITTER_BUFFER, *PCR_BLITTER_BUFFER; 42 43 typedef struct CR_BLITTER_TEXTURE 44 { 45 GLint width; 46 GLint height; 47 GLenum target; 48 GLuint hwid; 49 } CR_BLITTER_TEXTURE, *PCR_BLITTER_TEXTURE; 50 51 typedef DECLCALLBACK(int) FNCRBLT_BLITTER(struct CR_BLITTER *pBlitter, CR_BLITTER_TEXTURE *pSrc, RECT *paSrcRect, PRTRECTSIZE pDstSize, RECT *paDstRect, uint32_t cRects, uint32_t fFlags); 52 typedef FNCRBLT_BLITTER *PFNCRBLT_BLITTER; 53 54 typedef union CR_BLITTER_FLAGS 55 { 56 struct 57 { 58 uint32_t Initialized : 1; 59 uint32_t SupportsFBO : 1; 60 uint32_t SupportsFBOBlit : 1; 61 uint32_t Reserved : 29; 62 }; 63 uint32_t Value; 64 } CR_BLITTER_FLAGS, *PCR_BLITTER_FLAGS; 65 66 typedef struct CR_BLITTER 67 { 68 GLint idFBO; 69 CR_BLITTER_FLAGS Flags; 70 PFNCRBLT_BLITTER pfnBlt; 71 CR_BLITTER_BUFFER Verticies; 72 CR_BLITTER_BUFFER Indicies; 73 RTRECTSIZE CurrentSetSize; 74 CRMuralInfo *pCurrentMural; 75 CRContextInfo CtxInfo; 76 CRContextInfo *pRestoreCtxInfo; 77 CRMuralInfo *pRestoreMural; 78 } CR_BLITTER, *PCR_BLITTER; 79 80 int crBltInit(PCR_BLITTER pBlitter, CRMuralInfo *pCurrentMural) 30 #include <iprt/mem.h> 31 32 33 int CrBltInit(PCR_BLITTER pBlitter, CRMuralInfo *pCurrentMural, GLint visualBits) 81 34 { 82 35 memset(pBlitter, 0, sizeof (*pBlitter)); … … 90 43 91 44 pBlitter->CtxInfo.CreateInfo.pszDpyName = ""; 92 pBlitter->CtxInfo.CreateInfo.visualBits = CR_RGB_BIT | CR_DOUBLE_BIT;45 pBlitter->CtxInfo.CreateInfo.visualBits = visualBits; 93 46 pBlitter->CtxInfo.SpuContext = cr_server.head_spu->dispatch_table.CreateContext(pBlitter->CtxInfo.CreateInfo.pszDpyName, 94 47 pBlitter->CtxInfo.CreateInfo.visualBits, … … 100 53 } 101 54 55 CrBltMuralSetCurrent(pBlitter, pCurrentMural); 56 102 57 return VINF_SUCCESS; 103 58 } 104 59 105 void crBltTerm(PCR_BLITTER pBlitter)60 void CrBltTerm(PCR_BLITTER pBlitter) 106 61 { 107 62 cr_server.head_spu->dispatch_table.DestroyContext(pBlitter->CtxInfo.SpuContext); 108 63 } 109 64 110 static DECLINLINE(GLboolean) crBltSupportsTexTex(PCR_BLITTER pBlitter) 111 { 112 return pBlitter->Flags.SupportsFBO; 113 } 114 115 DECLINLINE(GLboolean) crBltIsEntered(PCR_BLITTER pBlitter) 116 { 117 return !!pBlitter->pRestoreCtxInfo; 118 } 119 120 void crBltMuralSetCurrent(PCR_BLITTER pBlitter, CRMuralInfo *pMural) 65 void CrBltMuralSetCurrent(PCR_BLITTER pBlitter, CRMuralInfo *pMural) 121 66 { 122 67 if (pBlitter->pCurrentMural == pMural) … … 125 70 pBlitter->pCurrentMural = pMural; 126 71 127 if (! crBltIsEntered(pBlitter))72 if (!CrBltIsEntered(pBlitter)) 128 73 return; 129 74 … … 134 79 } 135 80 136 #define CRBLT_F_LINEAR 0x00000001137 138 81 #define CRBLT_FILTER_FROM_FLAGS(_f) (((_f) & CRBLT_F_LINEAR) ? GL_LINEAR : GL_NEAREST) 139 82 140 static DECLCALLBACK(int) crBltBlitTexBufImplFbo(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, RECT *paSrcRect, PRTRECTSIZE pDstSize,RECT *paDstRect, uint32_t cRects, uint32_t fFlags)83 static DECLCALLBACK(int) crBltBlitTexBufImplFbo(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *paSrcRect, const PRTRECTSIZE pDstSize, const RTRECT *paDstRect, uint32_t cRects, uint32_t fFlags) 141 84 { 142 85 GLenum filter = CRBLT_FILTER_FROM_FLAGS(fFlags); … … 147 90 for (UINT i = 0; i < cRects; ++i) 148 91 { 149 RECT * pSrcRect = &paSrcRect[i];150 RECT * pDstRect = &paDstRect[i];92 const RTRECT * pSrcRect = &paSrcRect[i]; 93 const RTRECT * pDstRect = &paDstRect[i]; 151 94 cr_server.head_spu->dispatch_table.BlitFramebufferEXT( 152 pSrcRect-> left, pSrcRect->top, pSrcRect->right, pSrcRect->bottom,153 pDstRect-> left, pDstRect->top, pDstRect->right, pDstRect->bottom,95 pSrcRect->xLeft, pSrcRect->yTop, pSrcRect->xRight, pSrcRect->yBottom, 96 pDstRect->xLeft, pDstRect->yTop, pDstRect->xRight, pDstRect->yBottom, 154 97 GL_COLOR_BUFFER_BIT, filter); 155 98 } … … 159 102 160 103 /* GL_TRIANGLE_FAN */ 161 static DECLINLINE(GLfloat*) crBltVtRectTFNormalized( RECT *pRect, uint32_t normalX, uint32_t normalY, GLfloat* pBuff)162 { 163 /* left top */164 pBuff[0] = ((float)pRect-> left)/((float)normalX);165 pBuff[1] = ((float)pRect-> top)/((float)normalY);166 167 /* left bottom */104 static DECLINLINE(GLfloat*) crBltVtRectTFNormalized(const RTRECT *pRect, uint32_t normalX, uint32_t normalY, GLfloat* pBuff) 105 { 106 /* xLeft yTop */ 107 pBuff[0] = ((float)pRect->xLeft)/((float)normalX); 108 pBuff[1] = ((float)pRect->yTop)/((float)normalY); 109 110 /* xLeft yBottom */ 168 111 pBuff[2] = pBuff[0]; 169 pBuff[3] = ((float)pRect-> bottom)/((float)normalY);170 171 /* right bottom */172 pBuff[4] = ((float)pRect-> right)/((float)normalX);112 pBuff[3] = ((float)pRect->yBottom)/((float)normalY); 113 114 /* xRight yBottom */ 115 pBuff[4] = ((float)pRect->xRight)/((float)normalX); 173 116 pBuff[5] = pBuff[3]; 174 117 175 /* right top */118 /* xRight yTop */ 176 119 pBuff[6] = pBuff[4]; 177 120 pBuff[7] = pBuff[1]; … … 179 122 } 180 123 181 static DECLINLINE(GLint*) crBltVtRectTF( RECT *pRect, uint32_t normalX, uint32_t normalY, GLint* pBuff)182 { 183 /* left top */184 pBuff[0] = pRect-> left;185 pBuff[1] = pRect-> top;186 187 /* left bottom */124 static DECLINLINE(GLint*) crBltVtRectTF(const RTRECT *pRect, uint32_t normalX, uint32_t normalY, GLint* pBuff) 125 { 126 /* xLeft yTop */ 127 pBuff[0] = pRect->xLeft; 128 pBuff[1] = pRect->yTop; 129 130 /* xLeft yBottom */ 188 131 pBuff[2] = pBuff[0]; 189 pBuff[3] = pRect-> bottom;190 191 /* right bottom */192 pBuff[4] = pRect-> right;132 pBuff[3] = pRect->yBottom; 133 134 /* xRight yBottom */ 135 pBuff[4] = pRect->xRight; 193 136 pBuff[5] = pBuff[3]; 194 137 195 /* right top */138 /* xRight yTop */ 196 139 pBuff[6] = pBuff[4]; 197 140 pBuff[7] = pBuff[1]; … … 216 159 217 160 /* Indexed GL_TRIANGLES */ 218 static DECLINLINE(GLfloat*) crBltVtRectITNormalized( RECT *pRect, uint32_t normalX, uint32_t normalY, GLfloat* pBuff, GLubyte **ppIndex, GLubyte *piBase)161 static DECLINLINE(GLfloat*) crBltVtRectITNormalized(const RTRECT *pRect, uint32_t normalX, uint32_t normalY, GLfloat* pBuff, GLubyte **ppIndex, GLubyte *piBase) 219 162 { 220 163 GLfloat* ret = crBltVtRectTFNormalized(pRect, normalX, normalY, pBuff); 221 164 222 165 if (ppIndex) 223 *ppIndex = crBltVtFillRectIndicies(*ppIndex, *piBase);166 *ppIndex = crBltVtFillRectIndicies(*ppIndex, piBase); 224 167 225 168 return ret; 226 169 } 227 170 228 static DECLINLINE(GLint*) crBltVtRectIT(R ECT *pRect, uint32_t normalX, uint32_t normalY, GLint* pBuff, GLubyte **ppIndex, GLubyte *piBase)171 static DECLINLINE(GLint*) crBltVtRectIT(RTRECT *pRect, uint32_t normalX, uint32_t normalY, GLint* pBuff, GLubyte **ppIndex, GLubyte *piBase) 229 172 { 230 173 GLint* ret = crBltVtRectTF(pRect, normalX, normalY, pBuff); 231 174 232 175 if (ppIndex) 233 *ppIndex = crBltVtFillRectIndicies(*ppIndex, *piBase);176 *ppIndex = crBltVtFillRectIndicies(*ppIndex, piBase); 234 177 235 178 return ret; … … 249 192 250 193 251 static GLfloat* crBltVtRectsITNormalized( RECT *paRects, uint32_t cRects, uint32_t normalX, uint32_t normalY, GLfloat* pBuff, GLubyte **ppIndex, GLubyte *piBase)194 static GLfloat* crBltVtRectsITNormalized(const RTRECT *paRects, uint32_t cRects, uint32_t normalX, uint32_t normalY, GLfloat* pBuff, GLubyte **ppIndex, GLubyte *piBase) 252 195 { 253 196 for (uint32_t i = 0; i < cRects; ++i) 254 197 { 255 pBuff = crBltVtRectITNormalized( *paRects[i], normalX, normalY, pBuff, ppIndex, piBase);198 pBuff = crBltVtRectITNormalized(&paRects[i], normalX, normalY, pBuff, ppIndex, piBase); 256 199 } 257 200 return pBuff; … … 281 224 } 282 225 283 static DECLCALLBACK(int) crBltBlitTexBufImplDraw2D(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, RECT *paSrcRect, PRTRECTSIZE pDstSize,RECT *paDstRect, uint32_t cRects, uint32_t fFlags)226 static DECLCALLBACK(int) crBltBlitTexBufImplDraw2D(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *paSrcRect, const PRTRECTSIZE pDstSize, const RTRECT *paDstRect, uint32_t cRects, uint32_t fFlags) 284 227 { 285 228 GLuint normalX, normalY; … … 321 264 { 322 265 crWarning("Unsupported texture target 0x%x", pSrc->target); 323 return ;324 } 325 } 326 327 CRASSERT(pSrc->hwid);266 return VERR_INVALID_PARAMETER; 267 } 268 } 269 270 Assert(pSrc->hwid); 328 271 329 272 cr_server.head_spu->dispatch_table.BindTexture(pSrc->target, pSrc->hwid); … … 372 315 GLuint cElements = crBltVtGetNumVerticiesIT(cRects); 373 316 GLuint cIndicies = crBltVtGetNumIndiciesIT(cRects); 374 GLu intiIdxBase = 0;317 GLubyte iIdxBase = 0; 375 318 if (bUseSameVerticies) 376 319 { … … 401 344 cr_server.head_spu->dispatch_table.DisableClientState(GL_VERTEX_ARRAY); 402 345 } 403 } 404 405 int crBltInitOnMakeCurent(PCR_BLITTER pBlitter) 406 { 407 const char * pszExtension = cr_server.head_spu->dispatch_table.GetString(GL_EXTENSIONS); 346 347 return VINF_SUCCESS; 348 } 349 350 static int crBltInitOnMakeCurent(PCR_BLITTER pBlitter) 351 { 352 const char * pszExtension = (const char*)cr_server.head_spu->dispatch_table.GetString(GL_EXTENSIONS); 408 353 if (crStrstr(pszExtension, "GL_EXT_framebuffer_object")) 409 354 { 410 355 pBlitter->Flags.SupportsFBO = 1; 411 356 cr_server.head_spu->dispatch_table.GenFramebuffersEXT(1, &pBlitter->idFBO); 412 CRASSERT(pBlitter->idFBO);357 Assert(pBlitter->idFBO); 413 358 } 414 359 else … … 429 374 } 430 375 431 void crBltLeave(PCR_BLITTER pBlitter)432 { 433 CRASSERT(crBltIsEntered(pBlitter));376 void CrBltLeave(PCR_BLITTER pBlitter) 377 { 378 Assert(CrBltIsEntered(pBlitter)); 434 379 435 380 if (pBlitter->pRestoreCtxInfo != &pBlitter->CtxInfo) … … 441 386 } 442 387 443 int crBltEnter(PCR_BLITTER pBlitter, CRContextInfo *pRestoreCtxInfo, CRMuralInfo *pRestoreMural)388 int CrBltEnter(PCR_BLITTER pBlitter, CRContextInfo *pRestoreCtxInfo, CRMuralInfo *pRestoreMural) 444 389 { 445 390 if (!pBlitter->pCurrentMural) … … 449 394 } 450 395 451 if ( crBltIsEntered(pBlitter))396 if (CrBltIsEntered(pBlitter)) 452 397 { 453 398 crWarning("blitter is entered already!"); … … 468 413 469 414 crWarning("crBltInitOnMakeCurent failed, rc %d", rc); 470 crBltLeave(pBlitter);415 CrBltLeave(pBlitter); 471 416 return rc; 472 417 } 473 418 474 static void crBltBlitTexBuf(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, RECT *paSrcRects, GLenum enmDstBuff, PRTRECTSIZE pDstSize,RECT *paDstRects, uint32_t cRects, uint32_t fFlags)419 static void crBltBlitTexBuf(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *paSrcRects, GLenum enmDstBuff, const PRTRECTSIZE pDstSize, const RTRECT *paDstRects, uint32_t cRects, uint32_t fFlags) 475 420 { 476 421 cr_server.head_spu->dispatch_table.DrawBuffer(enmDstBuff); … … 479 424 } 480 425 481 void crBltBlitTexMural(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, RECT *paSrcRects,RECT *paDstRects, uint32_t cRects, uint32_t fFlags)426 void CrBltBlitTexMural(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *paSrcRects, const RTRECT *paDstRects, uint32_t cRects, uint32_t fFlags) 482 427 { 483 428 RTRECTSIZE DstSize = {pBlitter->pCurrentMural->width, pBlitter->pCurrentMural->height}; … … 486 431 } 487 432 488 void crBltBlitTexTex(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, RECT *pSrcRect, CR_BLITTER_TEXTURE *pDst,RECT *pDstRect, uint32_t cRects, uint32_t fFlags)433 void CrBltBlitTexTex(PCR_BLITTER pBlitter, CR_BLITTER_TEXTURE *pSrc, const RTRECT *pSrcRect, CR_BLITTER_TEXTURE *pDst, const RTRECT *pDstRect, uint32_t cRects, uint32_t fFlags) 489 434 { 490 435 RTRECTSIZE DstSize = {pDst->width, pDst->height}; … … 499 444 // cr_server.head_spu->dispatch_table.FramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); 500 445 501 crBltBlitTexBuf(pBlitter, pSrc, pSrcRect, GL_DRAW_FRAMEBUFFER, DstSize, pDstRect, cRects, fFlags); 502 } 446 crBltBlitTexBuf(pBlitter, pSrc, pSrcRect, GL_DRAW_FRAMEBUFFER, &DstSize, pDstRect, cRects, fFlags); 447 } 448 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.c
r43182 r43888 389 389 cr_server.currentWindow = window; 390 390 cr_server.currentNativeWindow = nativeWindow; 391 cr_server.currentMural = mural; 391 392 } 392 393 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch_header.py
r15532 r43888 23 23 #include "chromium.h" 24 24 #include "state/cr_statetypes.h" 25 26 #if defined(__cplusplus) 27 extern "C" { 28 #endif 29 25 30 """ 26 31 … … 37 42 print '%s SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString( params )) 38 43 39 print '#endif /* SERVER_DISPATCH_HEADER */' 44 print """ 45 #if defined(__cplusplus) 46 } 47 #endif 48 49 #endif /* SERVER_DISPATCH_HEADER */ 50 """ -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_special
r41258 r43888 249 249 DrawBuffer 250 250 ReadBuffer 251 TexPresent -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r43744 r43888 17 17 } 18 18 19 GLint crServerMuralInit(CRMuralInfo *mural, const char *dpyName, GLint visBits, GLint preloadWinID) 20 { 21 CRMuralInfo *defaultMural; 22 GLint dims[2]; 23 GLint windowID = -1; 24 /* 25 * Have first SPU make a new window. 26 */ 27 GLint spuWindow = cr_server.head_spu->dispatch_table.WindowCreate( dpyName, visBits ); 28 if (spuWindow < 0) { 29 crServerReturnValue( &spuWindow, sizeof(spuWindow) ); 30 return spuWindow; 31 } 32 33 /* get initial window size */ 34 cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims); 35 36 defaultMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, 0); 37 CRASSERT(defaultMural); 38 mural->gX = 0; 39 mural->gY = 0; 40 mural->width = dims[0]; 41 mural->height = dims[1]; 42 43 mural->spuWindow = spuWindow; 44 mural->screenId = 0; 45 mural->bVisible = GL_FALSE; 46 mural->bUseFBO = GL_FALSE; 47 48 mural->cVisibleRects = 0; 49 mural->pVisibleRects = NULL; 50 mural->bReceivedRects = GL_FALSE; 51 52 mural->pvOutputRedirectInstance = NULL; 53 54 /* generate ID for this new window/mural (special-case for file conns) */ 55 if (cr_server.curClient && cr_server.curClient->conn->type == CR_FILE) 56 windowID = spuWindow; 57 else 58 windowID = preloadWinID<0 ? crServerGenerateID(&cr_server.idsPool.freeWindowID) : preloadWinID; 59 60 crServerSetupOutputRedirect(mural); 61 62 return windowID; 63 } 19 64 20 65 GLint … … 23 68 CRMuralInfo *mural; 24 69 GLint windowID = -1; 25 GLint spuWindow;26 GLint dims[2];27 70 CRCreateInfo_t *pCreateInfo; 28 71 … … 55 98 } 56 99 57 /*58 * Have first SPU make a new window.59 */60 spuWindow = cr_server.head_spu->dispatch_table.WindowCreate( dpyName, visBits );61 if (spuWindow < 0) {62 crServerReturnValue( &spuWindow, sizeof(spuWindow) );63 return spuWindow;64 }65 66 /* get initial window size */67 cr_server.head_spu->dispatch_table.GetChromiumParametervCR(GL_WINDOW_SIZE_CR, spuWindow, GL_INT, 2, dims);68 100 69 101 /* … … 71 103 */ 72 104 mural = (CRMuralInfo *) crCalloc(sizeof(CRMuralInfo)); 73 if (mural) { 74 CRMuralInfo *defaultMural = (CRMuralInfo *) crHashtableSearch(cr_server.muralTable, 0); 75 CRASSERT(defaultMural); 76 mural->gX = 0; 77 mural->gY = 0; 78 mural->width = dims[0]; 79 mural->height = dims[1]; 80 81 mural->spuWindow = spuWindow; 82 mural->screenId = 0; 83 mural->bVisible = GL_FALSE; 84 mural->bUseFBO = GL_FALSE; 85 86 mural->cVisibleRects = 0; 87 mural->pVisibleRects = NULL; 88 mural->bReceivedRects = GL_FALSE; 89 90 mural->pvOutputRedirectInstance = NULL; 91 92 /* generate ID for this new window/mural (special-case for file conns) */ 93 if (cr_server.curClient && cr_server.curClient->conn->type == CR_FILE) 94 windowID = spuWindow; 95 else 96 windowID = preloadWinID<0 ? crServerGenerateID(&cr_server.idsPool.freeWindowID) : preloadWinID; 97 crHashtableAdd(cr_server.muralTable, windowID, mural); 98 99 pCreateInfo = (CRCreateInfo_t *) crAlloc(sizeof(CRCreateInfo_t)); 100 pCreateInfo->pszDpyName = dpyName ? crStrdup(dpyName) : NULL; 101 pCreateInfo->visualBits = visBits; 102 crHashtableAdd(cr_server.pWindowCreateInfoTable, windowID, pCreateInfo); 103 104 crServerSetupOutputRedirect(mural); 105 } 105 if (!mural) 106 { 107 crWarning("crCalloc failed!"); 108 return -1; 109 } 110 111 windowID = crServerMuralInit(mural, dpyName, visBits, preloadWinID); 112 if (windowID < 0) 113 { 114 crWarning("crServerMuralInit failed!"); 115 crFree(mural); 116 return windowID; 117 } 118 119 crHashtableAdd(cr_server.muralTable, windowID, mural); 120 121 pCreateInfo = (CRCreateInfo_t *) crAlloc(sizeof(CRCreateInfo_t)); 122 pCreateInfo->pszDpyName = dpyName ? crStrdup(dpyName) : NULL; 123 pCreateInfo->visualBits = visBits; 124 crHashtableAdd(cr_server.pWindowCreateInfoTable, windowID, pCreateInfo); 106 125 107 126 crDebug("CRServer: client %p created new window %d (SPU window %d)", 108 cr_server.curClient, windowID, spuWindow);127 cr_server.curClient, windowID, mural->spuWindow); 109 128 110 129 if (windowID != -1 && !cr_server.bIsInLoadingState) { … … 138 157 } 139 158 159 void crServerMuralTerm(CRMuralInfo *mural) 160 { 161 if (mural->pvOutputRedirectInstance) 162 { 163 cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance); 164 mural->pvOutputRedirectInstance = NULL; 165 } 166 167 crServerRedirMuralFBO(mural, GL_FALSE); 168 crServerDeleteMuralFBO(mural); 169 170 cr_server.head_spu->dispatch_table.WindowDestroy( mural->spuWindow ); 171 172 if (mural->pVisibleRects) 173 { 174 crFree(mural->pVisibleRects); 175 } 176 } 177 140 178 void SERVER_DISPATCH_APIENTRY 141 179 crServerDispatchWindowDestroy( GLint window ) … … 158 196 } 159 197 160 if (mural->pvOutputRedirectInstance) 161 { 162 cr_server.outputRedirect.CROREnd(mural->pvOutputRedirectInstance); 163 mural->pvOutputRedirectInstance = NULL; 164 } 198 crDebug("CRServer: Destroying window %d (spu window %d)", window, mural->spuWindow); 199 200 crServerMuralTerm(mural); 165 201 166 202 if (cr_server.currentWindow == window) 167 203 { 168 204 cr_server.currentWindow = -1; 169 }170 171 crServerRedirMuralFBO(mural, GL_FALSE);172 crServerDeleteMuralFBO(mural);173 174 crDebug("CRServer: Destroying window %d (spu window %d)", window, mural->spuWindow);175 cr_server.head_spu->dispatch_table.WindowDestroy( mural->spuWindow );205 CRASSERT(cr_server.currentMural == mural); 206 cr_server.currentMural = NULL; 207 } 208 else 209 { 210 CRASSERT(cr_server.currentMural != mural); 211 } 176 212 177 213 if (cr_server.curClient) … … 236 272 crHashtableDelete(cr_server.pWindowCreateInfoTable, window, crServerCreateInfoDeleteCB); 237 273 238 if (mural->pVisibleRects)239 {240 crFree(mural->pVisibleRects);241 }242 274 crHashtableDelete(cr_server.muralTable, window, crFree); 275 } 276 277 void crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height) 278 { 279 mural->width = width; 280 mural->height = height; 281 282 if (cr_server.curClient && cr_server.curClient->currentMural == mural) 283 { 284 crStateGetCurrent()->buffer.width = mural->width; 285 crStateGetCurrent()->buffer.height = mural->height; 286 } 287 288 crServerCheckMuralGeometry(mural); 289 290 cr_server.head_spu->dispatch_table.WindowSize(mural->spuWindow, width, height); 243 291 } 244 292 … … 257 305 } 258 306 259 mural->width = width; 260 mural->height = height; 261 262 if (cr_server.curClient && cr_server.curClient->currentMural == mural) 263 { 264 crStateGetCurrent()->buffer.width = mural->width; 265 crStateGetCurrent()->buffer.height = mural->height; 266 } 267 268 crServerCheckMuralGeometry(mural); 269 270 cr_server.head_spu->dispatch_table.WindowSize(mural->spuWindow, width, height); 307 crServerMuralSize(mural, width, height); 271 308 272 309 /* Work-around Intel driver bug */ -
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r43350 r43888 243 243 int32_t x, int32_t y, uint32_t w, uint32_t h); 244 244 static DECLCALLBACK(void) H3DORVisibleRegion(void *pvInstance, 245 uint32_t cRects, RTRECT *paRects);245 uint32_t cRects, const RTRECT *paRects); 246 246 static DECLCALLBACK(void) H3DORFrame(void *pvInstance, 247 247 void *pvData, uint32_t cbData); -
trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
r43462 r43888 1836 1836 1837 1837 /* static */ DECLCALLBACK(void) ConsoleVRDPServer::H3DORVisibleRegion(void *pvInstance, 1838 uint32_t cRects, RTRECT *paRects)1838 uint32_t cRects, const RTRECT *paRects) 1839 1839 { 1840 1840 LogFlowFunc(("ins %p %d\n", pvInstance, cRects));
Note:
See TracChangeset
for help on using the changeset viewer.