- Timestamp:
- May 7, 2010 12:55:08 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r25303 r29205 191 191 DECLEXPORT(void) crStateDiffContext( CRContext *from, CRContext *to ); 192 192 DECLEXPORT(void) crStateSwitchContext( CRContext *from, CRContext *to ); 193 DECLEXPORT(void) crStateApplyFBImage(CRContext *to); 193 194 194 195 #ifndef IN_GUEST -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_diff.c
r29090 r29205 121 121 } 122 122 123 void crState SwitchContext( CRContext *from, CRContext *to)123 void crStateApplyFBImage(CRContext *to) 124 124 { 125 CRbitvalue *bitID = to->bitid;126 CRStateBits *sb = GetCurrentBits();127 128 if (CHECKDIRTY(sb->attrib.dirty, bitID))129 {130 crStateAttribSwitch(&(sb->attrib), bitID, from, to );131 }132 if (CHECKDIRTY(sb->transform.dirty, bitID))133 {134 crStateTransformSwitch( &(sb->transform), bitID, from, to );135 }136 if (CHECKDIRTY(sb->pixel.dirty, bitID))137 {138 crStatePixelSwitch(&(sb->pixel), bitID, from, to );139 }140 if (CHECKDIRTY(sb->viewport.dirty, bitID))141 {142 crStateViewportSwitch(&(sb->viewport), bitID, from, to );143 }144 if (CHECKDIRTY(sb->fog.dirty, bitID))145 {146 crStateFogSwitch(&(sb->fog), bitID, from, to );147 }148 if (CHECKDIRTY(sb->texture.dirty, bitID))149 {150 crStateTextureSwitch( &(sb->texture), bitID, from, to );151 }152 if (CHECKDIRTY(sb->lists.dirty, bitID))153 {154 crStateListsSwitch(&(sb->lists), bitID, from, to );155 }156 if (CHECKDIRTY(sb->buffer.dirty, bitID))157 {158 crStateBufferSwitch( &(sb->buffer), bitID, from, to );159 }160 #ifdef CR_ARB_vertex_buffer_object161 if (CHECKDIRTY(sb->bufferobject.dirty, bitID))162 {163 crStateBufferObjectSwitch( &(sb->bufferobject), bitID, from, to );164 }165 #endif166 if (CHECKDIRTY(sb->client.dirty, bitID))167 {168 crStateClientSwitch( &(sb->client), bitID, from, to );169 }170 #if 0171 if (CHECKDIRTY(sb->hint.dirty, bitID))172 {173 crStateHintSwitch( &(sb->hint), bitID, from, to );174 }175 #endif176 if (CHECKDIRTY(sb->lighting.dirty, bitID))177 {178 crStateLightingSwitch( &(sb->lighting), bitID, from, to );179 }180 if (CHECKDIRTY(sb->occlusion.dirty, bitID))181 {182 crStateOcclusionSwitch( &(sb->occlusion), bitID, from, to );183 }184 if (CHECKDIRTY(sb->line.dirty, bitID))185 {186 crStateLineSwitch( &(sb->line), bitID, from, to );187 }188 if (CHECKDIRTY(sb->point.dirty, bitID))189 {190 crStatePointSwitch( &(sb->point), bitID, from, to );191 }192 if (CHECKDIRTY(sb->polygon.dirty, bitID))193 {194 crStatePolygonSwitch( &(sb->polygon), bitID, from, to );195 }196 if (CHECKDIRTY(sb->program.dirty, bitID))197 {198 crStateProgramSwitch( &(sb->program), bitID, from, to );199 }200 if (CHECKDIRTY(sb->stencil.dirty, bitID))201 {202 crStateStencilSwitch( &(sb->stencil), bitID, from, to );203 }204 if (CHECKDIRTY(sb->eval.dirty, bitID))205 {206 crStateEvaluatorSwitch( &(sb->eval), bitID, from, to );207 }208 #ifdef CR_ARB_imaging209 if (CHECKDIRTY(sb->imaging.dirty, bitID))210 {211 crStateImagingSwitch( &(sb->imaging), bitID, from, to );212 }213 #endif214 #if 0215 if (CHECKDIRTY(sb->selection.dirty, bitID))216 {217 crStateSelectionSwitch( &(sb->selection), bitID, from, to );218 }219 #endif220 #ifdef CR_NV_register_combiners221 if (CHECKDIRTY(sb->regcombiner.dirty, bitID) && to->extensions.NV_register_combiners)222 {223 crStateRegCombinerSwitch( &(sb->regcombiner), bitID, from, to );224 }225 #endif226 #ifdef CR_ARB_multisample227 if (CHECKDIRTY(sb->multisample.dirty, bitID))228 {229 crStateMultisampleSwitch( &(sb->multisample), bitID, from, to );230 }231 #endif232 #ifdef CR_ARB_multisample233 if (CHECKDIRTY(sb->multisample.dirty, bitID))234 {235 crStateMultisampleSwitch(&(sb->multisample), bitID, from, to );236 }237 #endif238 #ifdef CR_EXT_framebuffer_object239 /*Note, this should go after crStateTextureSwitch*/240 crStateFramebufferObjectSwitch(from, to);241 #endif242 #ifdef CR_OPENGL_VERSION_2_0243 crStateGLSLSwitch(from, to);244 #endif245 if (CHECKDIRTY(sb->current.dirty, bitID))246 {247 crStateCurrentSwitch( &(sb->current), bitID, from, to );248 }249 250 125 if (to->pImage) 251 126 { … … 280 155 diff_api.Finish(); 281 156 157 crDebug("Applied %ix%i fb image", pVP->viewportW, pVP->viewportH); 158 282 159 crFree(to->pImage); 283 160 to->pImage = NULL; 284 161 } 285 162 } 163 164 void crStateSwitchContext( CRContext *from, CRContext *to ) 165 { 166 CRbitvalue *bitID = to->bitid; 167 CRStateBits *sb = GetCurrentBits(); 168 169 if (CHECKDIRTY(sb->attrib.dirty, bitID)) 170 { 171 crStateAttribSwitch(&(sb->attrib), bitID, from, to ); 172 } 173 if (CHECKDIRTY(sb->transform.dirty, bitID)) 174 { 175 crStateTransformSwitch( &(sb->transform), bitID, from, to ); 176 } 177 if (CHECKDIRTY(sb->pixel.dirty, bitID)) 178 { 179 crStatePixelSwitch(&(sb->pixel), bitID, from, to ); 180 } 181 if (CHECKDIRTY(sb->viewport.dirty, bitID)) 182 { 183 crStateViewportSwitch(&(sb->viewport), bitID, from, to ); 184 } 185 if (CHECKDIRTY(sb->fog.dirty, bitID)) 186 { 187 crStateFogSwitch(&(sb->fog), bitID, from, to ); 188 } 189 if (CHECKDIRTY(sb->texture.dirty, bitID)) 190 { 191 crStateTextureSwitch( &(sb->texture), bitID, from, to ); 192 } 193 if (CHECKDIRTY(sb->lists.dirty, bitID)) 194 { 195 crStateListsSwitch(&(sb->lists), bitID, from, to ); 196 } 197 if (CHECKDIRTY(sb->buffer.dirty, bitID)) 198 { 199 crStateBufferSwitch( &(sb->buffer), bitID, from, to ); 200 } 201 #ifdef CR_ARB_vertex_buffer_object 202 if (CHECKDIRTY(sb->bufferobject.dirty, bitID)) 203 { 204 crStateBufferObjectSwitch( &(sb->bufferobject), bitID, from, to ); 205 } 206 #endif 207 if (CHECKDIRTY(sb->client.dirty, bitID)) 208 { 209 crStateClientSwitch( &(sb->client), bitID, from, to ); 210 } 211 #if 0 212 if (CHECKDIRTY(sb->hint.dirty, bitID)) 213 { 214 crStateHintSwitch( &(sb->hint), bitID, from, to ); 215 } 216 #endif 217 if (CHECKDIRTY(sb->lighting.dirty, bitID)) 218 { 219 crStateLightingSwitch( &(sb->lighting), bitID, from, to ); 220 } 221 if (CHECKDIRTY(sb->occlusion.dirty, bitID)) 222 { 223 crStateOcclusionSwitch( &(sb->occlusion), bitID, from, to ); 224 } 225 if (CHECKDIRTY(sb->line.dirty, bitID)) 226 { 227 crStateLineSwitch( &(sb->line), bitID, from, to ); 228 } 229 if (CHECKDIRTY(sb->point.dirty, bitID)) 230 { 231 crStatePointSwitch( &(sb->point), bitID, from, to ); 232 } 233 if (CHECKDIRTY(sb->polygon.dirty, bitID)) 234 { 235 crStatePolygonSwitch( &(sb->polygon), bitID, from, to ); 236 } 237 if (CHECKDIRTY(sb->program.dirty, bitID)) 238 { 239 crStateProgramSwitch( &(sb->program), bitID, from, to ); 240 } 241 if (CHECKDIRTY(sb->stencil.dirty, bitID)) 242 { 243 crStateStencilSwitch( &(sb->stencil), bitID, from, to ); 244 } 245 if (CHECKDIRTY(sb->eval.dirty, bitID)) 246 { 247 crStateEvaluatorSwitch( &(sb->eval), bitID, from, to ); 248 } 249 #ifdef CR_ARB_imaging 250 if (CHECKDIRTY(sb->imaging.dirty, bitID)) 251 { 252 crStateImagingSwitch( &(sb->imaging), bitID, from, to ); 253 } 254 #endif 255 #if 0 256 if (CHECKDIRTY(sb->selection.dirty, bitID)) 257 { 258 crStateSelectionSwitch( &(sb->selection), bitID, from, to ); 259 } 260 #endif 261 #ifdef CR_NV_register_combiners 262 if (CHECKDIRTY(sb->regcombiner.dirty, bitID) && to->extensions.NV_register_combiners) 263 { 264 crStateRegCombinerSwitch( &(sb->regcombiner), bitID, from, to ); 265 } 266 #endif 267 #ifdef CR_ARB_multisample 268 if (CHECKDIRTY(sb->multisample.dirty, bitID)) 269 { 270 crStateMultisampleSwitch( &(sb->multisample), bitID, from, to ); 271 } 272 #endif 273 #ifdef CR_ARB_multisample 274 if (CHECKDIRTY(sb->multisample.dirty, bitID)) 275 { 276 crStateMultisampleSwitch(&(sb->multisample), bitID, from, to ); 277 } 278 #endif 279 #ifdef CR_EXT_framebuffer_object 280 /*Note, this should go after crStateTextureSwitch*/ 281 crStateFramebufferObjectSwitch(from, to); 282 #endif 283 #ifdef CR_OPENGL_VERSION_2_0 284 crStateGLSLSwitch(from, to); 285 #endif 286 if (CHECKDIRTY(sb->current.dirty, bitID)) 287 { 288 crStateCurrentSwitch( &(sb->current), bitID, from, to ); 289 } 290 291 #ifdef WINDOWS 292 crStateApplyFBImage(to); 293 #endif 294 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r29017 r29205 1123 1123 1124 1124 crHashtableWalk(cr_server.muralTable, crVBoxServerCheckMuralCB, NULL); 1125 1126 #ifndef WINDOWS 1127 /*Restore FB content for clients, which have current window on a screen being remapped*/ 1128 { 1129 GLint i; 1130 1131 for (i = 0; i < cr_server.numClients; i++) 1132 { 1133 cr_server.curClient = cr_server.clients[i]; 1134 if (cr_server.curClient->currentCtx 1135 && cr_server.curClient->currentCtx->pImage 1136 && cr_server.curClient->currentMural 1137 && cr_server.curClient->currentMural->screenId == sIndex 1138 && cr_server.curClient->currentCtx->viewport.viewportH == h 1139 && cr_server.curClient->currentCtx->viewport.viewportW == w) 1140 { 1141 int clientWindow = cr_server.curClient->currentWindow; 1142 int clientContext = cr_server.curClient->currentContextNumber; 1143 1144 if (clientWindow && clientWindow != cr_server.currentWindow) 1145 { 1146 crServerDispatchMakeCurrent(clientWindow, 0, clientContext); 1147 } 1148 1149 crStateApplyFBImage(cr_server.curClient->currentCtx); 1150 } 1151 } 1152 cr_server.curClient = NULL; 1153 } 1154 #endif 1125 1155 1126 1156 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.