VirtualBox

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

最後變更 在這個檔案從26084是 15532,由 vboxsync 提交於 16 年 前

crOpenGL: export to OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.3 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#else
27 GET_PACKER_CONTEXT(pc);
28 crMemZero( pc, sizeof(CRPackContext));
29#endif
30 pc->swapping = swapping;
31 pc->Flush = NULL;
32 pc->SendHuge = NULL;
33 pc->updateBBOX = 0;
34 return pc;
35}
36
37
38/* Set packing context for the calling thread */
39void crPackSetContext( CRPackContext *pc )
40{
41#ifdef CHROMIUM_THREADSAFE
42 crSetTSD( &_PackerTSD, pc );
43#else
44 CRASSERT( pc == &cr_packer_globals );
45 (void)pc;
46#endif
47}
48
49
50/* Return packing context for the calling thread */
51CRPackContext *crPackGetContext( void )
52{
53#ifdef CHROMIUM_THREADSAFE
54 return (CRPackContext *) crGetTSD( &_PackerTSD );
55#else
56 return &cr_packer_globals;
57#endif
58}
59
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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