Changeset 46757 in vbox for trunk/src/VBox/GuestHost/OpenGL
- Timestamp:
- Jun 24, 2013 2:30:18 PM (12 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_error.h
r41928 r46757 28 28 29 29 DECLEXPORT(void) crDebug(const char *format, ... ) PRINTF; 30 #ifdef DEBUG_misha 31 typedef void FNCRDEBUG(const char *format, ... ) PRINTF; 32 typedef FNCRDEBUG *PFNCRDEBUG; 33 DECLINLINE(PFNCRDEBUG) crGetDebug() {return crDebug;} 34 # define crWarning (RT_BREAKPOINT(), crDebug) 35 #else 30 36 DECLEXPORT(void) crWarning(const char *format, ... ) PRINTF; 37 #endif 31 38 DECLEXPORT(void) crInfo(const char *format, ... ) PRINTF; 32 39 -
trunk/src/VBox/GuestHost/OpenGL/include/cr_pack.h
r43487 r46757 145 145 #undef CR_UNALIGNED_ACCESS_OKAY 146 146 #endif 147 #ifndef IN_RING0 147 148 extern DECLEXPORT(void) crWriteUnalignedDouble( void *buffer, double d ); 148 149 extern DECLEXPORT(void) crWriteSwappedDouble( void *buffer, double d ); 150 #endif 149 151 150 152 extern DECLEXPORT(void) *crPackAlloc( CR_PACKER_CONTEXT_ARGDECL unsigned int len ); … … 309 311 WRITE_DATA( offset, GLdouble, data ) 310 312 #else 311 #define WRITE_DOUBLE( offset, data ) \ 312 crWriteUnalignedDouble( data_ptr + (offset), (data) ) 313 #endif 314 313 # ifndef IN_RING0 314 # define WRITE_DOUBLE( offset, data ) \ 315 crWriteUnalignedDouble( data_ptr + (offset), (data) ) 316 # else 317 # define WRITE_DOUBLE( offset, data ) \ 318 AssertReleaseFailed() 319 # endif 320 #endif 321 322 #ifndef IN_RING0 315 323 #define WRITE_SWAPPED_DOUBLE( offset, data ) \ 316 324 crWriteSwappedDouble( data_ptr + (offset), (data) ) 325 #else 326 #define WRITE_SWAPPED_DOUBLE( offset, data ) \ 327 AssertReleaseFailed() 328 #endif 317 329 318 330 #define WRITE_OPCODE( pc, opcode ) \ -
trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h
r45251 r46757 72 72 } 73 73 74 DECLINLINE(void) VBoxRectTranslated(const RTRECT * pRect, int32_t x, int32_t y, RTRECT *pResult) 75 { 76 *pResult = *pRect; 77 VBoxRectTranslate(pResult, x, y); 78 } 79 74 80 DECLINLINE(void) VBoxRectMove(RTRECT * pRect, int32_t x, int32_t y) 75 81 { … … 80 86 pRect->xRight = w + x; 81 87 pRect->yBottom = h + y; 88 } 89 90 DECLINLINE(void) VBoxRectMoved(const RTRECT * pRect, int32_t x, int32_t y, RTRECT *pResult) 91 { 92 *pResult = *pRect; 93 VBoxRectMove(pResult, x, y); 82 94 } 83 95 … … 281 293 { 282 294 VBOXVR_COMPOSITOR Compositor; 295 #ifndef IN_RING0 283 296 float StretchX; 284 297 float StretchY; 298 #endif 285 299 uint32_t cRects; 286 300 uint32_t cRectsBuffer; 287 301 PRTRECT paSrcRects; 288 302 PRTRECT paDstRects; 303 #ifndef IN_RING0 289 304 RTCRITSECT CritSect; 305 #endif 290 306 } VBOXVR_SCR_COMPOSITOR, *PVBOXVR_SCR_COMPOSITOR; 291 307 … … 351 367 VBOXVREGDECL(int) CrVrScrCompositorInit(PVBOXVR_SCR_COMPOSITOR pCompositor); 352 368 VBOXVREGDECL(void) CrVrScrCompositorTerm(PVBOXVR_SCR_COMPOSITOR pCompositor); 369 #ifndef IN_RING0 353 370 VBOXVREGDECL(void) CrVrScrCompositorSetStretching(PVBOXVR_SCR_COMPOSITOR pCompositor, float StretchX, float StretchY); 371 #endif 354 372 /* regions are valid until the next CrVrScrCompositor call */ 355 373 VBOXVREGDECL(int) CrVrScrCompositorRegionsGet(PVBOXVR_SCR_COMPOSITOR pCompositor, uint32_t *pcRegions, const RTRECT **ppaSrcRegions, const RTRECT **ppaDstRegions); … … 378 396 } 379 397 398 #ifndef IN_RING0 380 399 DECLINLINE(int) CrVrScrCompositorLock(PVBOXVR_SCR_COMPOSITOR pCompositor) 381 400 { … … 391 410 return rc; 392 411 } 393 412 #endif 394 413 RT_C_DECLS_END 395 414 -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_buffer.c
r43487 r46757 243 243 244 244 #ifdef IN_RING0 245 if(!num_opcodes) 245 if(num_opcodes) 246 { 247 num_opcodes = (num_opcodes + 0x3) & (~0x3); 248 } 249 else 246 250 #endif 247 251 { -
trunk/src/VBox/GuestHost/OpenGL/packer/pack_misc.c
r33475 r46757 8 8 #include "cr_error.h" 9 9 10 void PACK_APIENTRY crPackChromiumParametervCR( GLenum target, GLenum type, GLsizei count, const GLvoid *values)10 void PACK_APIENTRY crPackChromiumParametervCR(CR_PACKER_CONTEXT_ARGDECL GLenum target, GLenum type, GLsizei count, const GLvoid *values) 11 11 { 12 12 CR_GET_PACKER_CONTEXT(pc); … … 30 30 params_length = sizeof(GLint) * count; 31 31 break; 32 #ifndef IN_RING0 32 33 case GL_FLOAT: 33 34 params_length = sizeof(GLfloat) * count; 34 35 break; 36 #endif 35 37 #if 0 36 38 case GL_DOUBLE: … … 75 77 } 76 78 break; 79 #ifndef IN_RING0 77 80 case GL_FLOAT: 78 81 for (i = 0; i < count; i++, pos += sizeof(GLfloat)) { … … 80 83 } 81 84 break; 85 #endif 82 86 #if 0 83 87 case GL_DOUBLE: … … 96 100 } 97 101 98 void PACK_APIENTRY crPackDeleteQueriesARB(GLsizei n, const GLuint * ids) 102 #ifndef IN_RING0 103 void PACK_APIENTRY crPackDeleteQueriesARB(CR_PACKER_CONTEXT_ARGDECL GLsizei n, const GLuint * ids) 99 104 { 100 105 unsigned char *data_ptr; … … 108 113 crPackFree(data_ptr); 109 114 } 115 #endif 116 117 void PACK_APIENTRY crPackVBoxTexPresent( CR_PACKER_CONTEXT_ARGDECL GLuint texture, GLuint cfg, GLint xPos, GLint yPos, GLint cRects, const GLint * pRects ) 118 { 119 GLint i, size, cnt; 120 121 CR_GET_PACKER_CONTEXT(pc); 122 unsigned char *data_ptr; 123 (void) pc; 124 size = 28 + cRects * 4 * sizeof(GLint); 125 CR_GET_BUFFERED_POINTER( pc, size ); 126 WRITE_DATA( 0, GLint, size ); 127 WRITE_DATA( 4, GLenum, CR_VBOXTEXPRESENT_EXTEND_OPCODE ); 128 WRITE_DATA( 8, GLint, texture ); 129 WRITE_DATA( 12, GLint, cfg ); 130 WRITE_DATA( 16, GLint, xPos ); 131 WRITE_DATA( 20, GLint, yPos ); 132 WRITE_DATA( 24, GLint, cRects ); 133 134 cnt = 28; 135 for (i=0; i<cRects; ++i) 136 { 137 WRITE_DATA(cnt, GLint, (GLint) pRects[4*i+0]); 138 WRITE_DATA(cnt+4, GLint, (GLint) pRects[4*i+1]); 139 WRITE_DATA(cnt+8, GLint, (GLint) pRects[4*i+2]); 140 WRITE_DATA(cnt+12, GLint, (GLint) pRects[4*i+3]); 141 cnt += 16; 142 } 143 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 144 CR_UNLOCK_PACKER_CONTEXT(pc); 145 } 146 147 void PACK_APIENTRY crPackWindowPosition( CR_PACKER_CONTEXT_ARGDECL GLint window, GLint x, GLint y ) 148 { 149 CR_GET_PACKER_CONTEXT(pc); 150 unsigned char *data_ptr; 151 (void) pc; 152 CR_GET_BUFFERED_POINTER( pc, 20 ); 153 WRITE_DATA( 0, GLint, 20 ); 154 WRITE_DATA( 4, GLenum, CR_WINDOWPOSITION_EXTEND_OPCODE ); 155 WRITE_DATA( 8, GLint, window ); 156 WRITE_DATA( 12, GLint, x ); 157 WRITE_DATA( 16, GLint, y ); 158 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 159 CR_UNLOCK_PACKER_CONTEXT(pc); 160 } 161 162 void PACK_APIENTRY crPackWindowShow( CR_PACKER_CONTEXT_ARGDECL GLint window, GLint flag ) 163 { 164 CR_GET_PACKER_CONTEXT(pc); 165 unsigned char *data_ptr; 166 (void) pc; 167 CR_GET_BUFFERED_POINTER( pc, 16 ); 168 WRITE_DATA( 0, GLint, 16 ); 169 WRITE_DATA( 4, GLenum, CR_WINDOWSHOW_EXTEND_OPCODE ); 170 WRITE_DATA( 8, GLint, window ); 171 WRITE_DATA( 12, GLint, flag ); 172 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 173 CR_UNLOCK_PACKER_CONTEXT(pc); 174 } 175 176 void PACK_APIENTRY crPackWindowSize( CR_PACKER_CONTEXT_ARGDECL GLint window, GLint w, GLint h ) 177 { 178 CR_GET_PACKER_CONTEXT(pc); 179 unsigned char *data_ptr; 180 (void) pc; 181 CR_GET_BUFFERED_POINTER( pc, 20 ); 182 WRITE_DATA( 0, GLint, 20 ); 183 WRITE_DATA( 4, GLenum, CR_WINDOWSIZE_EXTEND_OPCODE ); 184 WRITE_DATA( 8, GLint, window ); 185 WRITE_DATA( 12, GLint, w ); 186 WRITE_DATA( 16, GLint, h ); 187 WRITE_OPCODE( pc, CR_EXTEND_OPCODE ); 188 CR_UNLOCK_PACKER_CONTEXT(pc); 189 } -
trunk/src/VBox/GuestHost/OpenGL/packer/packer.h
r15532 r46757 19 19 #include "cr_mem.h" 20 20 21 #ifndef IN_RING0 21 22 extern void __PackError( int line, const char *file, GLenum error, const char *info ); 23 #else 24 # define __PackError( line, file, error, info) do { AssertReleaseFailed(); } while (0) 25 #endif 22 26 23 27 #endif /* CR_PACKER_H */ -
trunk/src/VBox/GuestHost/OpenGL/packer/packer_special
r27244 r46757 177 177 UniformMatrix3x4fv 178 178 UniformMatrix4x3fv 179 VBoxTexPresent 180 WindowPosition 181 WindowShow 182 WindowSize -
trunk/src/VBox/GuestHost/OpenGL/util/error.c
r41635 r46757 246 246 } 247 247 248 #ifdef DEBUG_misha 249 # undef crWarning 250 #endif 248 251 DECLEXPORT(void) crWarning(const char *format, ... ) 249 252 { … … 496 499 #else 497 500 if (!output 498 # ifndef DEBUG_misha499 501 || output==stderr 500 # endif501 502 ) 502 503 { … … 505 506 else 506 507 { 507 # ifndef DEBUG_misha508 508 LogRel(("%s\n", txt)); 509 # endif510 509 outputChromiumMessage(output, txt); 511 510 } -
trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
r45627 r46757 17 17 */ 18 18 #include <cr_vreg.h> 19 #include <iprt/memcache.h>20 19 #include <iprt/err.h> 21 20 #include <iprt/assert.h> 22 21 #include <iprt/asm.h> 23 22 24 #ifndef IN_RING025 23 #include <cr_error.h> 26 24 #define WARN(_m) do { crWarning _m ; } while (0) 27 #else 28 # error port me! 29 #endif 30 31 #ifdef DEBUG_misha 32 //# define VBOXVDBG_VR_LAL_DISABLE 33 #endif 34 25 26 #ifndef IN_RING0 27 #include <iprt/memcache.h> 35 28 #ifndef VBOXVDBG_VR_LAL_DISABLE 36 static volatile int32_t g_cVBoxVrInits = 0;37 29 static RTMEMCACHE g_VBoxVrLookasideList; 38 #endif 39 40 static PVBOXVR_REG vboxVrRegCreate() 41 { 42 #ifndef VBOXVDBG_VR_LAL_DISABLE 43 PVBOXVR_REG pReg = (PVBOXVR_REG)RTMemCacheAlloc(g_VBoxVrLookasideList); 44 if (!pReg) 45 { 46 WARN(("ExAllocateFromLookasideListEx failed!")); 47 } 48 return pReg; 49 #else 50 return (PVBOXVR_REG)RTMemAlloc(sizeof (VBOXVR_REG)); 51 #endif 52 } 53 54 static void vboxVrRegTerm(PVBOXVR_REG pReg) 55 { 56 #ifndef VBOXVDBG_VR_LAL_DISABLE 57 RTMemCacheFree(g_VBoxVrLookasideList, pReg); 58 #else 59 RTMemFree(pReg); 60 #endif 61 } 62 63 VBOXVREGDECL(void) VBoxVrListClear(PVBOXVR_LIST pList) 64 { 65 PVBOXVR_REG pReg, pRegNext; 66 67 RTListForEachSafe(&pList->ListHead, pReg, pRegNext, VBOXVR_REG, ListEntry) 68 { 69 vboxVrRegTerm(pReg); 70 } 71 VBoxVrListInit(pList); 72 } 73 74 #define VBOXVR_MEMTAG 'vDBV' 75 76 VBOXVREGDECL(int) VBoxVrInit() 77 { 78 int32_t cNewRefs = ASMAtomicIncS32(&g_cVBoxVrInits); 79 Assert(cNewRefs >= 1); 80 Assert(cNewRefs == 1); /* <- debugging */ 81 if (cNewRefs > 1) 82 return VINF_SUCCESS; 83 84 #ifndef VBOXVDBG_VR_LAL_DISABLE 85 int rc = RTMemCacheCreate(&g_VBoxVrLookasideList, sizeof (VBOXVR_REG), 30 #define vboxVrRegLaAlloc(_c) RTMemCacheAlloc((_c)) 31 #define vboxVrRegLaFree(_c, _e) RTMemCacheFree((_c), (_e)) 32 DECLINLINE(int) vboxVrLaCreate(RTMEMCACHE *pCache, size_t cbElement) 33 { 34 int rc = RTMemCacheCreate(pCache, cbElement, 86 35 0, /* size_t cbAlignment */ 87 36 UINT32_MAX, /* uint32_t cMaxObjects */ … … 93 42 if (!RT_SUCCESS(rc)) 94 43 { 44 WARN(("RTMemCacheCreate failed rc %d", rc)); 45 return rc; 46 } 47 return VINF_SUCCESS; 48 } 49 #define vboxVrLaDestroy(_c) RTMemCacheDestroy((_c)) 50 #endif 51 #else 52 # ifdef RT_OS_WINDOWS 53 # ifdef PAGE_SIZE 54 # undef PAGE_SIZE 55 # endif 56 # ifdef PAGE_SHIFT 57 # undef PAGE_SHIFT 58 # endif 59 # define VBOX_WITH_WORKAROUND_MISSING_PACK 60 # if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK) 61 # define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap 62 # define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap 63 # define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap 64 # define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap 65 # define _interlockedbittestandset _interlockedbittestandset_StupidDDKVsCompilerCrap 66 # define _interlockedbittestandreset _interlockedbittestandreset_StupidDDKVsCompilerCrap 67 # define _interlockedbittestandset64 _interlockedbittestandset64_StupidDDKVsCompilerCrap 68 # define _interlockedbittestandreset64 _interlockedbittestandreset64_StupidDDKVsCompilerCrap 69 # pragma warning(disable : 4163) 70 # ifdef VBOX_WITH_WORKAROUND_MISSING_PACK 71 # pragma warning(disable : 4103) 72 # endif 73 # include <ntddk.h> 74 # pragma warning(default : 4163) 75 # ifdef VBOX_WITH_WORKAROUND_MISSING_PACK 76 # pragma pack() 77 # pragma warning(default : 4103) 78 # endif 79 # undef _InterlockedExchange 80 # undef _InterlockedExchangeAdd 81 # undef _InterlockedCompareExchange 82 # undef _InterlockedAddLargeStatistic 83 # undef _interlockedbittestandset 84 # undef _interlockedbittestandreset 85 # undef _interlockedbittestandset64 86 # undef _interlockedbittestandreset64 87 # else 88 # include <ntddk.h> 89 # endif 90 #ifndef VBOXVDBG_VR_LAL_DISABLE 91 static LOOKASIDE_LIST_EX g_VBoxVrLookasideList; 92 #define vboxVrRegLaAlloc(_c) ExAllocateFromLookasideListEx(&(_c)) 93 #define vboxVrRegLaFree(_c, _e) ExFreeToLookasideListEx(&(_c), (_e)) 94 #define VBOXWDDMVR_MEMTAG 'vDBV' 95 DECLINLINE(int) vboxVrLaCreate(LOOKASIDE_LIST_EX *pCache, size_t cbElement) 96 { 97 NTSTATUS Status = ExInitializeLookasideListEx(pCache, 98 NULL, /* PALLOCATE_FUNCTION_EX Allocate */ 99 NULL, /* PFREE_FUNCTION_EX Free */ 100 NonPagedPool, 101 0, /* ULONG Flags */ 102 cbElement, 103 VBOXWDDMVR_MEMTAG, 104 0 /* USHORT Depth - reserved, must be null */ 105 ); 106 if (!NT_SUCCESS(Status)) 107 { 108 WARN(("ExInitializeLookasideListEx failed, Status (0x%x)", Status)); 109 return VERR_GENERAL_FAILURE; 110 } 111 112 return VINF_SUCCESS; 113 } 114 #define vboxVrLaDestroy(_c) ExDeleteLookasideListEx(&(_c)) 115 #endif 116 # else 117 # error "port me!" 118 # endif 119 #endif 120 121 #ifdef DEBUG_misha 122 //# define VBOXVDBG_VR_LAL_DISABLE 123 #endif 124 125 #ifndef VBOXVDBG_VR_LAL_DISABLE 126 static volatile int32_t g_cVBoxVrInits = 0; 127 #endif 128 129 static PVBOXVR_REG vboxVrRegCreate() 130 { 131 #ifndef VBOXVDBG_VR_LAL_DISABLE 132 PVBOXVR_REG pReg = (PVBOXVR_REG)vboxVrRegLaAlloc(g_VBoxVrLookasideList); 133 if (!pReg) 134 { 135 WARN(("ExAllocateFromLookasideListEx failed!")); 136 } 137 return pReg; 138 #else 139 return (PVBOXVR_REG)RTMemAlloc(sizeof (VBOXVR_REG)); 140 #endif 141 } 142 143 static void vboxVrRegTerm(PVBOXVR_REG pReg) 144 { 145 #ifndef VBOXVDBG_VR_LAL_DISABLE 146 vboxVrRegLaFree(g_VBoxVrLookasideList, pReg); 147 #else 148 RTMemFree(pReg); 149 #endif 150 } 151 152 VBOXVREGDECL(void) VBoxVrListClear(PVBOXVR_LIST pList) 153 { 154 PVBOXVR_REG pReg, pRegNext; 155 156 RTListForEachSafe(&pList->ListHead, pReg, pRegNext, VBOXVR_REG, ListEntry) 157 { 158 vboxVrRegTerm(pReg); 159 } 160 VBoxVrListInit(pList); 161 } 162 163 #define VBOXVR_MEMTAG 'vDBV' 164 165 VBOXVREGDECL(int) VBoxVrInit() 166 { 167 int32_t cNewRefs = ASMAtomicIncS32(&g_cVBoxVrInits); 168 Assert(cNewRefs >= 1); 169 Assert(cNewRefs == 1); /* <- debugging */ 170 if (cNewRefs > 1) 171 return VINF_SUCCESS; 172 173 #ifndef VBOXVDBG_VR_LAL_DISABLE 174 int rc = vboxVrLaCreate(&g_VBoxVrLookasideList, sizeof (VBOXVR_REG)); 175 if (!RT_SUCCESS(rc)) 176 { 95 177 WARN(("ExInitializeLookasideListEx failed, rc (%d)", rc)); 96 178 return rc; … … 109 191 110 192 #ifndef VBOXVDBG_VR_LAL_DISABLE 111 RTMemCacheDestroy(g_VBoxVrLookasideList);193 vboxVrLaDestroy(g_VBoxVrLookasideList); 112 194 #endif 113 195 } … … 1542 1624 int rc = VBoxVrListRectsGet(&pCEntry->Vr, cRects, pEntry->paDstRects); 1543 1625 AssertRC(rc); 1544 if (pCompositor->StretchX >= 1. && pCompositor->StretchY >= 1. /* <- stretching can not zero some rects */ 1545 && !pEntry->Pos.x && !pEntry->Pos.y) 1626 if ( 1627 #ifndef IN_RING0 1628 pCompositor->StretchX >= 1. && pCompositor->StretchY >= 1. /* <- stretching can not zero some rects */ 1629 && 1630 #endif 1631 !pEntry->Pos.x && !pEntry->Pos.y 1632 ) 1546 1633 { 1547 1634 memcpy(pEntry->paSrcRects, pEntry->paDstRects, cRects * sizeof (*pEntry->paSrcRects)); … … 1551 1638 for (uint32_t i = 0; i < cRects; ++i) 1552 1639 { 1553 pEntry->paSrcRects[i].xLeft = (int32_t)((pEntry->paDstRects[i].xLeft - pEntry->Pos.x) * pCompositor->StretchX); 1554 pEntry->paSrcRects[i].yTop = (int32_t)((pEntry->paDstRects[i].yTop - pEntry->Pos.y) * pCompositor->StretchY); 1555 pEntry->paSrcRects[i].xRight = (int32_t)((pEntry->paDstRects[i].xRight - pEntry->Pos.x) * pCompositor->StretchX); 1556 pEntry->paSrcRects[i].yBottom = (int32_t)((pEntry->paDstRects[i].yBottom - pEntry->Pos.y) * pCompositor->StretchY); 1557 } 1558 1559 bool canZeroX = (pCompositor->StretchX < 1); 1560 bool canZeroY = (pCompositor->StretchY < 1); 1640 pEntry->paSrcRects[i].xLeft = (int32_t)((pEntry->paDstRects[i].xLeft - pEntry->Pos.x)); 1641 pEntry->paSrcRects[i].yTop = (int32_t)((pEntry->paDstRects[i].yTop - pEntry->Pos.y)); 1642 pEntry->paSrcRects[i].xRight = (int32_t)((pEntry->paDstRects[i].xRight - pEntry->Pos.x)); 1643 pEntry->paSrcRects[i].yBottom = (int32_t)((pEntry->paDstRects[i].yBottom - pEntry->Pos.y)); 1644 #ifndef IN_RING0 1645 if (pCompositor->StretchX != 1.) 1646 { 1647 pEntry->paSrcRects[i].xLeft = (int32_t)(pEntry->paSrcRects[i].xLeft * pCompositor->StretchX); 1648 pEntry->paSrcRects[i].xRight = (int32_t)(pEntry->paSrcRects[i].xRight * pCompositor->StretchX); 1649 } 1650 if (pCompositor->StretchY != 1.) 1651 { 1652 pEntry->paSrcRects[i].yTop = (int32_t)(pEntry->paSrcRects[i].yTop * pCompositor->StretchY); 1653 pEntry->paSrcRects[i].yBottom = (int32_t)(pEntry->paSrcRects[i].yBottom * pCompositor->StretchY); 1654 } 1655 #endif 1656 } 1657 1658 #ifndef IN_RING0 1659 bool canZeroX = (pCompositor->StretchX < 1.); 1660 bool canZeroY = (pCompositor->StretchY < 1.); 1561 1661 if (canZeroX && canZeroY) 1562 1662 { … … 1589 1689 } 1590 1690 } 1591 } 1592 1691 #endif 1692 } 1593 1693 pEntry->cRects = cRects; 1594 1694 pData->paDstRects += cRects; … … 1980 2080 { 1981 2081 memset(pCompositor, 0, sizeof (*pCompositor)); 2082 #ifndef IN_RING0 1982 2083 int rc = RTCritSectInit(&pCompositor->CritSect); 1983 if (RT_SUCCESS(rc)) 1984 { 1985 VBoxVrCompositorInit(&pCompositor->Compositor, NULL); 1986 pCompositor->StretchX = 1.0; 1987 pCompositor->StretchY = 1.0; 1988 return VINF_SUCCESS; 1989 } 1990 else 2084 if (!RT_SUCCESS(rc)) 1991 2085 { 1992 2086 WARN(("RTCritSectInit failed rc %d", rc)); 1993 } 1994 return rc; 2087 return rc; 2088 } 2089 #endif 2090 VBoxVrCompositorInit(&pCompositor->Compositor, NULL); 2091 #ifndef IN_RING0 2092 pCompositor->StretchX = 1.0; 2093 pCompositor->StretchY = 1.0; 2094 #endif 2095 return VINF_SUCCESS; 1995 2096 } 1996 2097 … … 2002 2103 if (pCompositor->paSrcRects) 2003 2104 RTMemFree(pCompositor->paSrcRects); 2004 2105 #ifndef IN_RING0 2005 2106 RTCritSectDelete(&pCompositor->CritSect); 2107 #endif 2006 2108 } 2007 2109 … … 2018 2120 VBoxVrCompositorVisit(&pCompositor->Compositor, crVrScrCompositorEntrySetAllChangedCb, (void*)fChanged); 2019 2121 } 2020 2122 #ifndef IN_RING0 2021 2123 VBOXVREGDECL(void) CrVrScrCompositorSetStretching(PVBOXVR_SCR_COMPOSITOR pCompositor, float StretchX, float StretchY) 2022 2124 { … … 2026 2128 CrVrScrCompositorEntrySetAllChanged(pCompositor, true); 2027 2129 } 2028 2130 #endif 2029 2131 /* regions are valid until the next CrVrScrCompositor call */ 2030 2132 VBOXVREGDECL(int) CrVrScrCompositorRegionsGet(PVBOXVR_SCR_COMPOSITOR pCompositor, uint32_t *pcRegions, const RTRECT **ppaSrcRegions, const RTRECT **ppaDstRegions)
Note:
See TracChangeset
for help on using the changeset viewer.