Last change
on this file since 19223 was 15532, checked in by vboxsync, 16 years ago |
crOpenGL: export to OSE
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Id
|
File size:
1.3 KB
|
Line | |
---|
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
|
---|
13 | CRtsd _PackerTSD;
|
---|
14 | int cr_packer_globals; /* dummy - for the sake of packer.def */
|
---|
15 | #else
|
---|
16 | int _PackerTSD; /* dummy - for the sake of packer.def */ /* drm1 */
|
---|
17 | DLLDATA(CRPackContext) cr_packer_globals;
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | CRPackContext *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 */
|
---|
39 | void 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 */
|
---|
51 | CRPackContext *crPackGetContext( void )
|
---|
52 | {
|
---|
53 | #ifdef CHROMIUM_THREADSAFE
|
---|
54 | return (CRPackContext *) crGetTSD( &_PackerTSD );
|
---|
55 | #else
|
---|
56 | return &cr_packer_globals;
|
---|
57 | #endif
|
---|
58 | }
|
---|
59 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.