VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_init.c@ 39265

最後變更 在這個檔案從39265是 39265,由 vboxsync 提交於 13 年 前

crOpenGL: flush on glEnd if some begin-end data was sent to host already - fix Win8+WinSAT halt

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.5 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#include "cr_error.h"
8#include "cr_mem.h"
9#include "packer.h"
10#include <stdio.h>
11
12#ifdef CHROMIUM_THREADSAFE
13CRtsd _PackerTSD;
14int cr_packer_globals; /* dummy - for the sake of packer.def */
15#else
16int _PackerTSD; /* dummy - for the sake of packer.def */ /* drm1 */
17DLLDATA(CRPackContext) cr_packer_globals;
18#endif
19
20CRPackContext *crPackNewContext( int swapping )
21{
22#ifdef CHROMIUM_THREADSAFE
23 CRPackContext *pc = crCalloc(sizeof(CRPackContext));
24 if (!pc)
25 return NULL;
26 crInitMutex(&pc->mutex);
27#else
28 GET_PACKER_CONTEXT(pc);
29 crMemZero( pc, sizeof(CRPackContext));
30#endif
31 pc->enmBeginEndState = CRPackBeginEndStateNone;
32 pc->swapping = swapping;
33 pc->Flush = NULL;
34 pc->SendHuge = NULL;
35 pc->updateBBOX = 0;
36 return pc;
37}
38
39void crPackDeleteContext(CRPackContext *pc)
40{
41#ifdef CHROMIUM_THREADSAFE
42 crFreeMutex(&pc->mutex);
43 crFree(pc);
44#endif
45}
46
47/* Set packing context for the calling thread */
48void crPackSetContext( CRPackContext *pc )
49{
50#ifdef CHROMIUM_THREADSAFE
51 crSetTSD( &_PackerTSD, pc );
52#else
53 CRASSERT( pc == &cr_packer_globals );
54 (void)pc;
55#endif
56}
57
58
59/* Return packing context for the calling thread */
60CRPackContext *crPackGetContext( void )
61{
62#ifdef CHROMIUM_THREADSAFE
63 return (CRPackContext *) crGetTSD( &_PackerTSD );
64#else
65 return &cr_packer_globals;
66#endif
67}
68
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette